Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
866 토론

Unable to compile sample code in VS2019 using Intel C++ 2023 compiler

TryerGit
새로운 기여자 I
4,467 조회수

Hello,

I am attempting to compile and run the sample program provided at https://oneapi-src.github.io/DPCPP_Reference/model/sample-program.html 

 

I encounter multiple issues with this code.

Firstly, the line:

 

#include <CL/sycl.hpp>

 

gives a compile error that the header file is not known. It had to be changed to:

 

#include <sycl/sycl.hpp>

 

Subsequently, attempting to compile the code results in multiple errors. A common error seems to be in "accessor.hpp" file:

 

#include <CL/__spirv/spirv_types.hpp>

 

The reported error is:

 

Error 'CL/__spirv/spirv_types.hpp' file not found with <angled> include; use "quotes" instead windows C:\Program Files (x86)\Intel\oneAPI\compiler\2023.0.0\windows\include\sycl\accessor.hpp(11,10): 1

 

Is there a way to fix this compile/build error? Please let me know if any additional information is needed to get the code up and running.

 

Thank you.

0 포인트
3 응답
TryerGit
새로운 기여자 I
4,454 조회수

I added C:\Program Files (x86)\Intel\oneAPI\compiler\2023.0.0\windows\include\sycl to "Additional Include directories" and the above problems go away. However, now, the following error is obtained:

 

Error static assertion failed due to requirement '!std::is_same<sycl::detail::auto_name, sycl::detail::auto_name>::value': No kernel name provided without -fsycl-unnamed-lambda enabled! windows C:\Program Files (x86)\Intel\oneAPI\compiler\2023.0.0\windows\include\sycl\kernel.hpp(44,3): 1

 

Could you please point me to a reference where a sample compilation/build example is provided?

 

Thank you.

0 포인트
TryerGit
새로운 기여자 I
4,437 조회수

I was able to solve the problem. It was needed of me to set /fsycl in C/C++ -> DPC++ tab of Visual Studio project properties.

 

Thanks.

0 포인트
VarshaS_Intel
중재자
4,414 조회수

Hi,


Thanks for posting in Intel Communities.


Glad to know that your issue is resolved.

Thanks for sharing the solution with us. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Varsha


0 포인트
응답