有谁知道如何通过编译使用推力设备功能的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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...