【问题标题】:Error: External calls are not supported (found non-inlined call to cublasGetVersion_v2)错误:不支持外部调用(发现对 cublasGetVersion_v2 的非内联调用)
【发布时间】:2013-10-26 01:03:48
【问题描述】:

我正在尝试使用调用 cublasIdamax() 但我遇到了类似标题的错误。所以我写了一个简单的代码来验证cublas的版本,以避免函数签名中的版本错误。但即使是这个简单的代码也会导致编译错误。

这是我的代码:

__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;
}

我在第 3 行出现以下错误:不支持外部调用(发现对 cublasGetVersion_v2 的非内联调用)

我做错了什么?

PS.:我看过这个话题 https://devtalk.nvidia.com/default/topic/500814/external-calls-are-not-supported-found-non-inlined-call-to-meminit-/ 但我仍然有问题。

【问题讨论】:

  • cublasGetVersion() 是一个host 函数。您不能从 __global__ 函数中调用它。

标签: cuda cublas kepler


【解决方案1】:

cublasGetVersion() 是一个host 函数。您不能从 __global__ 函数中调用它。

【讨论】:

    猜你喜欢
    • 2011-08-25
    • 2014-01-19
    • 2017-03-30
    • 1970-01-01
    • 1970-01-01
    • 2018-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多