有人知道如何通过编译c++;使用推力装置功能的代码? 我现在正在使用英伟达HPC SDK 20.9软件包。我目前正在尝试使用设备上的推力来加速分类。我甚至无法获得使用推力设备功能进行编译的最简单代码。使用nvc++ #include <thrust/device_vector.h> int main() { thrust::device_vector< double > v1(10); return 0; } #包括 int main(){ 推力:装置_矢量v1(10); 返回0; }

有人知道如何通过编译c++;使用推力装置功能的代码? 我现在正在使用英伟达HPC SDK 20.9软件包。我目前正在尝试使用设备上的推力来加速分类。我甚至无法获得使用推力设备功能进行编译的最简单代码。使用nvc++ #include <thrust/device_vector.h> int main() { thrust::device_vector< double > v1(10); return 0; } #包括 int main(){ 推力:装置_矢量v1(10); 返回0; },c++,thrust,nvcc,C++,Thrust,Nvcc,导致以下错误消息: "/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 durin

导致以下错误消息:

"/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".
“/home/khoidang/.local/nvhpc/Linux\u x86\u 64/20.9/cuda/includ
e/推力/系统/细节/通用/适用于每个h“,第66行:错误:
不允许使用不完整的类型
推力\静态\断言\消息(
^
在以下期间检测到:
.
.
.
实例化“推力::设备\向量::设备\向量(推力::设备\向量::大小\类型)[T=double,
Alloc=推力::设备分配程序]“位于
“test.cpp”
编译“test.cpp”时检测到1个错误。
我截短了一些错误消息,但检测到大约15个实例化错误。有没有人也遇到过这个问题,或者有没有人知道如何正确编译这个推力代码?我不确定是否有其他编译器可以尝试使用gpu加速推力API