c++ - Can you use cublasDdot() to use blas operations in non-GPU memory? -
so have code performs matrix multiplicaiton, problem returns zeroes when use library -lcublas , compiler nvcc; however, code runs great few tweaks function names when use compiler, g++ library -lblas.
can use -lcublas library perform matrix multiplication memory not on gpu?
here's code returns 0's:
extern "c" //external reference function code compiles { double cublasddot(int *n, double *a, int *inca, double *b, int *incb); } //stuff happens cout << "calculating/printing contents of matrix c ddot...\n"; c[i][t]=cublasddot(&n, parta, &inca, partb, &incb); //this thing isn't working reason (although compiles fine)
i compile using command: nvcc program -lcublas
this work however:
extern "c" //external reference function code compiles { double ddot_(int *n, double *a, int *inca, double *b, int *incb); } //stuff happens c[i][t]=ddot_(&n, parta, &inca, partb, &incb);
compiled g++ program -lblas
cublas requires functioning cuda gpu.
probably doing no error checking. read on how error checking in cublas manual. , @ error checking sample code.
the ordinary usage of cublas requires data transferred gpu , results transferred back.
Comments
Post a Comment