我正在尝试使用cublasSaxpy
cublas 的功能。
看代码:
#include <cublas_v2.h>
float *dev_B;
float *dev_tmp;
cublasStatus_t stat ;
cublasHandle_t handle ;
...
...
stat = cublasCreate(&handle);
if(stat != CUBLAS_STATUS_SUCCESS)
{
cout << "CUBLAS Initialization failed!" << endl;
exit(EXIT_FAILURE);
}
...
...
stat = cublasSetVector(N, sizeof(float), vB, N, dev_B, N);
if(stat != CUBLAS_STATUS_SUCCESS)
{
cout << "CUBLAS setting vector failed" << endl;
exit(EXIT_FAILURE);
}
stat = cublasSetVector(N, sizeof(float), nullvec, N, dev_tmp, N);
if(stat != CUBLAS_STATUS_SUCCESS)
{
cout << "CUBLAS setting vector failed" << endl;
exit(EXIT_FAILURE);
}
...
...
stat = cublasSaxpy(handle, N, 1.0f, dev_B, 1, dev_tmp, 1);
所以,我正在使用来自 CUDA 5.0 RC1 的 eclipse nsight。我没有构建项目,因为我没有完成它,但是 IDE 在 saxpy 操作中给了我一个读取下划线:
Invalid arguments '
Candidates are:
enum {cublas_api.h:3039} cublasSaxpy_v2(cublasContext *, int, const float *, const float *, int, float *, int)