In the files in testing directory of MAGMA can I see that before to use the functions the macro TESTING_CUDA_INIT() is called. This macro is defined in testings.h as
- Code: Select all
#define TESTING_CUDA_INIT() \
CUdevice dev; \
CUcontext context; \
if( CUDA_SUCCESS != cuInit( 0 ) ) { \
fprintf(stderr, "CUDA: Not initialized\n" ); exit(-1); \
} \
if( CUDA_SUCCESS != cuDeviceGet( &dev, 0 ) ) { \
fprintf(stderr, "CUDA: Cannot get the device\n"); exit(-1); \
} \
if( CUDA_SUCCESS != cuCtxCreate( &context, 0, dev ) ) { \
fprintf(stderr, "CUDA: Cannot create the context\n"); exit(-1); \
} \
if( CUBLAS_STATUS_SUCCESS != cublasInit( ) ) { \
fprintf(stderr, "CUBLAS: Not initialized\n"); exit(-1); \
} \
printout_devices( );
My question is, is mandatory to initialize CUDA for use MAGMA or could only CUBLAS initialized as
- Code: Select all
if( CUBLAS_STATUS_SUCCESS != cublasInit( ) ) { \
fprintf(stderr, "CUBLAS: Not initialized\n"); exit(-1); \
}
??
Thanks
