Error calling Sgels

General CULA Dense (LAPACK & BLAS) support and troubleshooting. Use this forum if you are having a general problem or have encountered a bug.

Error calling Sgels

Postby jrk1982 » Thu Sep 10, 2009 2:14 pm

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;
}
Image
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

Postby kyle » Thu Sep 10, 2009 2:42 pm

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.
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm

Re:Error calling Sgels

Postby dan » Thu Sep 10, 2009 6:23 pm

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
dan
Administrator
 
Posts: 61
Joined: Thu Jul 23, 2009 2:29 pm

Re:Error calling Sgels

Postby jrk1982 » Thu Sep 10, 2009 6:50 pm

Thanks. Copy paste error :) I will try the suggestion tomorrow and update.
Image
Senior Developer, AccelerEyes
PhD Student, Dept. of ECE,
UC Santa Barbara
jrk1982
 
Posts: 26
Joined: Thu Aug 13, 2009 8:48 pm


Return to CULA Dense Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron