Search code examples
intel-oneapidpc++intel-dpct

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


I am trying to migrate a simple vectorAdd.cu from NVDIA CUDA samples to DPCPP. I am getting the following error during migration when using DPCT.

fatal error: 'helper_cude.h' file not found

File not found error

Command used: dpct --in-root=./ vectorAdd.cu

And, When I tried to add include path of 'helper_cuda.h' using -I<path-of-helper_cuda.h>, I'm getting the error:

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

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

Any help here is much appreciated! Thanks


Solution

  • You cannot use -I flag with dpct directly. If you wanted to specify clang compiler options then you can use --extra-arg.
    e.g. dpct --extra-arg="-std=c++14" –extra-arg="-I…"

    So, your dpct command should be:
    dpct --in-root=./ --out-root=dpct_out1 --extra-arg="-I C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.2\common\inc" vectorAdd.cu

    For more information, you can refer to the below Intel® DPC++ Compatibility Tool Best Practices pdf. https://software.intel.com/content/www/us/en/develop/articles/intel-dpcpp-compatibility-tool-best-practices.html