I'm trying to use the call cublasIdamax() but I got a similar error like the title. So I write a simple code to verify the version of cublas, to avoid a version mistake in signature of function. But even this simple code result in a compilation error.
Here's my code:
__global__ void getVersion(cublasHandle_t handle, int *version){
cublasGetVersion(handle,version);
}
int main( int argc, const char* argv[] )
{
int *d_version;
int *h_version;
cublasHandle_t handle;
dim3 dimBlock( 2, 2 );
dim3 dimGrid( 1, 1 );
cublasCreate(&handle);
h_version = (int *)malloc(sizeof(int*));
cudaMalloc((void**)&d_version, sizeof(int*));
getVersion<<<dimGrid, dimBlock>>>(handle, d_version);
cudaMemcpy(h_version,d_version,sizeof(int),cudaMemcpyDeviceToHost);//gpu->cpu
cout << *h_version << endl;
}
I have the following error on line 3: External calls are not supported (found non-inlined call to cublasGetVersion_v2)
What I'm doing wrong?
PS.: I looked this topic https://devtalk.nvidia.com/default/topic/500814/external-calls-are-not-supported-found-non-inlined-call-to-meminit-/ but i'm still with the problem.
cublasGetVersion()
is a host
function. You cannot call it from a __global__
function.