Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL
47 Discussions

Migration from CUDA to SYCL with DPCT. Error: header missing __clang_cuda_texture_intrinsics.h

alvarovm
Beginner
1,611 Views

Hi.

I am trying to convert from CUDA to SYCL with the dpct conversion tool.

 

DPCT fails to migrate code sample in https://github.com/oneapi-src/oneAPI-samples/tree/master/Tools/Migration/vector-add-dpct 

 

When I run  dpct src/vector_add.cu

 

I get :

NOTE: Could not auto-detect compilation database for file 'vector_add.cu' in '/home/myuser/oneAPI-samples-master/Tools/Migration/vector-add-dpct/src' or any parent directory.
The directory "dpct_output" is used as "out-root"
Processing: /home/myuser/oneAPI-samples-master/Tools/Migration/vector-add-dpct/src/vector_add.cu
In file included from <built-in>:1:
/opt/intel/oneapi/dpcpp-ct/2022.2.1/lib/clang/15.0.0/include/__clang_cuda_runtime_wrapper.h:408:10: fatal error: '__clang_cuda_texture_intrinsics.h' file not found
#include <__clang_cuda_texture_intrinsics.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Processed 1 file(s) in -in-root folder "/home/myuser/oneAPI-samples-master/Tools/Migration/vector-add-dpct/src", 1 file(s) with error(s):
/home/myuser/oneAPI-samples-master/Tools/Migration/vector-add-dpct/src/vector_add.cu: 1 parsing error(s)

See Diagnostics Reference to resolve warnings and complete the migration:
https://software.intel.com/content/www/us/en/develop/documentation/intel-dpcpp-compatibility-tool-user-guide/top/diagnostics-reference.html

 

It seems that the header __clang_cuda_texture_intrinsics.h is missing.

 

Could you help?

 

Thanks

Alvaro

 

 

Product (installed with APT in Ubuntu 18.04):

intel-oneapi-dpcpp-ct-2022.2.1 2022.2.1-14994

intel-basekit 2022.3.1-17310

cudatoolkit 11.6

 

 

0 Kudos
2 Replies
alvarovm
Beginner
1,568 Views

I did a temporal fix downloading the header from here:

https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/__clang_cuda_texture_intrinsics.h

and copying the file to here: /opt/intel/oneapi/dpcpp-ct/2022.2.1/lib/clang/15.0.0/include/

 

I got another error:

In file included from

/opt/intel/oneapi/dpcpp-ct/2022.2.1/lib/clang/15.0.0/include/__clang_cuda_runtime_wrapper.h:520:
/opt/intel/oneapi/dpcpp-ct/2022.2.1/lib/clang/15.0.0/include/__clang_dpct_math.h:27:7: error: 'modf' is missing exception specification 'noexcept'
float modf(float a, float *pb);
^
/usr/lib/llvm-14/include/c++/v1/math.h:994:46: note: previous declaration is here
inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return ::modff(__lcpp_x, __lcpp_y);}
^

 

It seems that the function modf() is already in the cmath header in my clang++ installation.

 

Then, in the file __clang_dpct_math.h , I commented the line

float modf(float a, float *pb);

 

Now this is "working". Hope there is a permanent fix to this in the future.

 

 

 

 

0 Kudos
ShwethaS_Intel
Moderator
1,555 Views

Hi,

Thanks for reaching out to us. Glad to know that your issue is resolved. If you need any further assistance, please post a new question as this thread will no longer be monitored by Intel.


Regards,

Shwetha Selma



0 Kudos
Reply