Problem with cublasAlloc

Hi,

I’m having a problem using cublasAlloc. It won’t return CUBLAS_STATUS_SUCCESS even if I build it using -deviceemu. The arrays are really small.

I’m using Windows XP 32 bits.

Thanks,
Rosália

Well… What DOES it return? Look at the manual and check the return values:

Return Values
CUBLAS_STATUS_NOT_INITIALIZED if CUBLAS library was not initialized
CUBLAS_STATUS_INVALID_VALUE if n <= 0 or elemSize <= 0
CUBLAS_STATUS_ALLOC_FAILED if the object could not be allocated
due to lack of resources.
CUBLAS_STATUS_SUCCESS if storage was successfully allocated

Hi,

So, I’ve tested a little further (sorry I didn’t do this before) and realized that cublas is not able to initialize, somehow. (cublasInit() returns CUBLAS_STATUS_NOT_INITIALIZED). I’m using -deviceemu, so it can’t be a device problem. It’s a very simple program, in fact, it’s the first example of cublas library documentation.

Any help would be appreciated,
Rosália

Ok, got it from another forum. You’re not supposed to link cublas.lib if you’re using -deviceemu, only cublasemu.lib.

Thanks for the help!