相关疑难解决方法(0)

如何创建一个可以从主机和设备调用的内核函数?

以下试验提出了我的意图,但未能编译:

__host__ __device__ void f(){}

int main()
{
    f<<<1,1>>>();
}
Run Code Online (Sandbox Code Playgroud)

编译器投诉:

a.cu(5): error: a __device__ function call cannot be configured

1 error detected in the compilation of "/tmp/tmpxft_00001537_00000000-6_a.cpp1.ii".
Run Code Online (Sandbox Code Playgroud)

希望我的陈述清楚,并感谢您的建议.

cuda

3
推荐指数
1
解决办法
8096
查看次数

标签 统计

cuda ×1