运行时
关于调用不同版本rocThrust时出现的问题
2022-06-15 23:47:25
71

在编译软件时调用了rocThrust库,发生错误,内容为:

In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/execution_policy.h:33:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/cpp/execution_policy.h:51:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/cpp/detail/merge.h:22:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/detail/sequential/merge.h:78:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/detail/sequential/merge.inl:19:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/detail/copy.h:90:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/detail/copy.inl:22:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/detail/adl/copy.h:44:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/hip/detail/copy.h:85:
In file included from /public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/hip/detail/internal/copy_cross_system.h:40:
/public/software/compiler/rocm/dtk-22.04.1/rocthrust/include/thrust/system/hip/detail/uninitialized_copy.h:65:13: error: no matching 'operator new' function for non-allocating placement new expression; include <new>
::new(static_cast<void*>(&out)) OutputType(in);

经初步检查后,推测是由于在不同版本的rocm中,rocthrust改变了<memory>的引用方法。在老版本,如3.9.1中,rocThrust在internal_functional.h中直接引用了<memory>。而在新版本中,如dtk,rocThrust在internal_functional.h中引用了<thrust/detail/memory_wrapper.h>并在wrapper中引用<memory>,导致了编译时出现new()未匹配。请问在编译时如何避免该问题

全部评论(1)
只看楼主
L
liujie6
1楼

module load dtk-22.04.1之前先 unset CPLUS_INCLUDE_PATH。确保加载dtk后,CPLUS_INCLUDE_PATH 没有/opt/rh/devtoolset-7/root/usr/include/c++/7,再编译看下有问题没有。

2022/6/17
没有更多内容了
--
楼主
Level.4
0 帖子
楼主热帖
暂无数据