如何解决有谁知道如何通过编译使用推力设备功能的c ++代码来解决此错误?
我现在正在使用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 举报,一经查实,本站将立刻删除。