Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
517 Discussions

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

TryerGit
New Contributor I
770 Views

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 Kudos
3 Replies
TryerGit
New Contributor I
756 Views

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 Kudos
TryerGit
New Contributor I
740 Views

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 Kudos
VarshaS_Intel
Moderator
717 Views

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 Kudos
Reply