SYCLomatic icon indicating copy to clipboard operation
SYCLomatic copied to clipboard

Request: "-I option" to add search include folders

Open oscarbg opened this issue 1 year ago • 1 comments

Hi, HIPIFY includes it.. and don't know how to handle it.. all/lots of samples from CUDA SDK make use of headers:

// helper functions and utilities to work with CUDA
#include <helper_cuda.h>
#include <helper_functions.h>

dpct graphMemoryFootprint.cu

and not being able to add a search path fail with:

NOTE: Could not auto-detect compilation database for file 'graphMemoryFootprint.cu' in 'C:\Users\oqui\Downloads\dpct_win_release\bin' or any parent directory.
The directory "dpct_output" is used as "out-root"
warning: CUDA version is newer than the latest supported version 12.3 [-Wunknown-cuda-version]
Parsing: C:\Users\oqui\Downloads\dpct_win_release\bin\graphMemoryFootprint.cu
C:\Users\oqui\Downloads\dpct_win_release\bin\graphMemoryFootprint.cu:33:10: fatal error: 'helper_cuda.h' file not found
   33 | #include <helper_cuda.h>

oscarbg avatar Apr 15 '24 06:04 oscarbg

@oscarbg you should specify the option -in-root correctly, here is an example:

git clone https://github.com/NVIDIA/cuda-samples.git
cd cuda-samples\Samples\0_Introduction\vectorAdd
dpct -in-root ../../ -out-root out dpct --vcxprojfile=vectorAdd_vs2019.vcxproj --cuda-include-path=/path/to/header file/include/

BTW, -in-root is used to specify the directory path for the root of the source tree that needs to be migrated.

tomflinda avatar Apr 16 '24 06:04 tomflinda

Since there is no further feedback on this issue, I will close it. @oscarbg, pls feel free to reopen it if you still encounter this issue after following the new advice.

tomflinda avatar Jun 05 '24 00:06 tomflinda