Unable to migrate a simple CUDA vectorAdd sample using dpct tool. Fatal Error: 'helper_cuda.h' file not found

Unable to migrate a simple CUDA vectorAdd sample using dpct tool. Fatal Error: 'helper_cuda.h' file not found

我正在尝试将一个简单的 vectorAdd.cu 从 NVDIA CUDA 示例迁移到 DPCPP。使用 DPCT 进行迁移时出现以下错误。

fatal error: 'helper_cude.h' file not found

File not found error

使用的命令:dpct --in-root=./ vectorAdd.cu

而且,当我尝试使用 -I 添加 'helper_cuda.h' 的包含路径时,出现错误:

"Unknown Command line argument '-I'. Did you mean '-h'?"

使用的命令:dpct --in-root=./ --out-root=dpct_out1 -I "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.2\common\inc" vectorAdd.cu
Unknown Command line argument

非常感谢这里的任何帮助!谢谢

您不能直接将 -I 标志与 dpct 一起使用。如果你想指定 clang 编译器选项,那么你可以使用 --extra-arg.
例如dpct --extra-arg="-std=c++14" –extra-arg="-I…"

所以,你的 dpct 命令应该是:
dpct --in-root=./ --out-root=dpct_out1 --extra-arg="-I C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.2\common\inc" vectorAdd.cu

更多信息,您可以参考下面的英特尔® DPC++ 兼容性工具最佳实践 pdf。 https://software.intel.com/content/www/us/en/develop/articles/intel-dpcpp-compatibility-tool-best-practices.html