Question

I want to use Zgemv in parallel.

__global__ void S_Cphir(cuDoubleComplex *S,cuDoubleComplex *A,cuDoubleComplex *B, int n,int l)
{
    ....
cublasZgemv(handle,CUBLAS_OP_N,n,n,&alpha,S+i*n*n,n,A+n*i,1,&beta,B+i*n,1);}

void S_Cphir_(cuDoubleComplex *S,cuDoubleComplex *A,cuDoubleComplex *B, int n,int l){
dim3 grid = dim3(1,1,1);
dim3 block = dim3(32,1,1);
S_Cphir<<<grid,block>>>(S,A,B,n,l);}

my compile command is

nvcc -c -arch=compute_30 -code=sm_35 time_propagation_cublas.cu --relocatable-device-code true
nvcc -o  ./main.v2 time_propagation_cublas.o -lcublas

The first line is work. But the second line is wrong!!

In function`__sti____cudaRegisterAll_58_tmpxft_000032b7_00000000_6_time_propagation_cublas_cpp1_ii_0d699356()';tmpxft_000032b7_00000000-3_time_propagation_cublas.cudafe1.cpp:(.text+0x17a4): 
undefined reference to `__cudaRegisterLinkedBinary_58_tmpxft_000032b7_00000000_6_time_propagation_cublas_cpp1_ii_0d699356'
collect2: ld returned 1 exit status

I search the "cudaRegisterLinkedBinary" but I have nothing!!

I know nvcc support to call cublas in kernel.

Was it helpful?

Solution

Use the CUBLAS Device Library sample code as your reference. On a standard CUDA 5.5 install, you'll find it at:

/usr/local/cuda/samples/7_CUDALibraries/simpleDevLibCUBLAS

Referring to the Makefile in that directory, your compile commands should be like this:

nvcc -arch=sm_35 -rdc=true -o main.v2 time_propagation_cublas.cu -lcublas -lcublas_device -lcudadevrt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top