问题描述
我现在正在使用Nvidia HPC SDK 20.9软件包。我目前正在尝试使用设备上的推力来加速排序。我什至无法获得使用推力装置功能进行编译的最简单的代码。使用nvc++
#include <thrust/device_vector.h>
int main() {
thrust::device_vector< double > v1(10);
return 0;
}
导致以下错误消息:
"/home/khoidang/.local/nvhpc/Linux_x86_64/20.9/cuda/includ
e/thrust/system/detail/generic/for_each.h",line 66: error:
incomplete type is not allowed
THRUST_STATIC_ASSERT_MSG(
^
detected during:
.
.
.
instantiation of "thrust::device_vector<T,Alloc>::device_vector(thrust::device_vector<T,Alloc>::size_type) [with T=double,Alloc=thrust::device_allocator<double>]" at line 4 of
"test.cpp"
1 error detected in the compilation of "test.cpp".
我截断了一些错误消息,但是检测到大约15个实例化错误。有没有人也遇到过这个问题或有任何想法如何使这个推力代码正确编译?我不确定是否可以尝试使用其他具有gpu加速推力API的编译器。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)