Error calling Sgels
4 posts
• Page 1 of 1
Error calling Sgels
I'm trying to write a small piece of test code for sgels. I get an error
"Invalid value for parameter -8".
Code:
int main(int argc, char** argv)
{
#ifdef NDEBUG
int M = 2;
#else
int M = 2;
#endif
int N = 4;
int LWORK = 0;
culaStatus status;
float* A = NULL , *b = NULL;
float A1[8] = {0.1209, 0.8746, 0.5964, 0.6757, 0.6432, 0.3369, 0.4949, 0.4142};
float b1[4] = {0.0892, 0.5664, 0.5626, 0.1655};
A = A1;
b = b1;
status = culaInitialize();
checkStatus(status);
printf("Calling SGELS\n");
status = culaSgels('N',
M,
N,
M,
(culaFloat *)A,
M,
(culaFloat *)b,
M);
checkStatus(status);
printf("Shutting down CULA\n");
culaShutdown();
return EXIT_SUCCESS;
}
"Invalid value for parameter -8".
Code:
int main(int argc, char** argv)
{
#ifdef NDEBUG
int M = 2;
#else
int M = 2;
#endif
int N = 4;
int LWORK = 0;
culaStatus status;
float* A = NULL , *b = NULL;
float A1[8] = {0.1209, 0.8746, 0.5964, 0.6757, 0.6432, 0.3369, 0.4949, 0.4142};
float b1[4] = {0.0892, 0.5664, 0.5626, 0.1655};
A = A1;
b = b1;
status = culaInitialize();
checkStatus(status);
printf("Calling SGELS\n");
status = culaSgels('N',
M,
N,
M,
(culaFloat *)A,
M,
(culaFloat *)b,
M);
checkStatus(status);
printf("Shutting down CULA\n");
culaShutdown();
return EXIT_SUCCESS;
}

Senior Developer, AccelerEyes
PhD Student, Dept. of ECE,
UC Santa Barbara
- jrk1982
- Posts: 26
- Joined: Thu Aug 13, 2009 8:48 pm
Re:Error calling Sgels
jrk1982,
Our interface follows a convention similar to the LAPACK interface. For your example, LDB (parameter 8) must be greater than the maximum of N or M.
Our interface follows a convention similar to the LAPACK interface. For your example, LDB (parameter 8) must be greater than the maximum of N or M.
- kyle
- Administrator
- Posts: 301
- Joined: Fri Jun 12, 2009 7:47 pm
Re:Error calling Sgels
jrk1982,
Also note that you're freeing memory on the stack. While this isn't related to the ldb error, it will be a problem sometime in the future.
Dan
Also note that you're freeing memory on the stack. While this isn't related to the ldb error, it will be a problem sometime in the future.
Dan
- dan
- Administrator
- Posts: 61
- Joined: Thu Jul 23, 2009 2:29 pm
Re:Error calling Sgels
Thanks. Copy paste error :) I will try the suggestion tomorrow and update.

Senior Developer, AccelerEyes
PhD Student, Dept. of ECE,
UC Santa Barbara
- jrk1982
- Posts: 26
- Joined: Thu Aug 13, 2009 8:48 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests