14 #include <cuda_runtime_api.h>
61 for (i = 0; i < nthread; i++){
87 printf(
"The requested number of GPUs is not yet supported.\n\n");
88 printf(
"The number of GPUs set to one.\n\n");
95 context->
gpu_context = (CUcontext *)malloc(ngpu *
sizeof(CUcontext));
98 if( CUDA_SUCCESS != cuInit( 0 ) ) {
99 fprintf(stderr,
"CUDA: Not initialized\n" );
102 if( CUDA_SUCCESS != cuDeviceGet( &dev, 0 ) ) {
103 fprintf(stderr,
"CUDA: Cannot get the device\n");
106 if( CUDA_SUCCESS != cuCtxCreate( &context->
gpu_context[0], 0, dev ) ) {
107 fprintf(stderr,
"CUDA: Cannot create the context\n");
110 if( CUDA_SUCCESS != cublasInit( ) ) {
111 fprintf(stderr,
"CUBLAS: Not initialized\n");
118 for(i = 1; i<argc; i++)
119 if (strcmp(
"-b", argv[i])==0)
120 context->
nb = atoi(argv[++i]);