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

one-API sample compiles with CMake but not Visual Studio

itl-dag
Novice
727 Views

Some oneAPI DPC++ sample code projects compile within Visual Studio and some do not - for example dpc-vector-add, though it compiles and runs using CMake. Is there some property that needs to be set within VS to avoid compilation errors such as those in attached screenshot?

0 Kudos
3 Replies
VaishnaviV_Intel
Moderator
692 Views

Hi,

 

Thanks for posting in Intel communities.

 

>>Some oneAPI DPC++ sample code projects compile within Visual Studio and some do not.

Could you please let us know the list of sample projects which are not compiling at your end?

 

From your screenshot, we can see that in your console application there are two mains(one from vector-add-buffers.cpp and another from vector-add-usm.cpp). So, please try to avoid giving more than one main or try using Cmake.

 

>>Is there some property that needs to be set within VS?

Please find the below link to set the properties for implementing DPC++ projects.

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-dpcpp-compiler/top/get-started-on-windows.html

 

You can also use the Intel oneAPI command prompt to run the code.

Please refer to the below screenshot for more details:

MicrosoftTeams-image (1).png

 

If your issue still persists, Please let us know the Visual studio version and sub-version(Help-->About Microsoft Visual Studio) you are using.

 

Thanks and Regards,

Vankudothu Vaishnavi.

 

0 Kudos
VaishnaviV_Intel
Moderator
611 Views

Hi,


Has the information provided above helped? If yes, could you please confirm whether we can close this thread from our end?


Thanks and Regards,

Vankudothu Vaishnavi.


0 Kudos
VaishnaviV_Intel
Moderator
544 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Vankudothu Vaishnavi.


0 Kudos
Reply