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

switch from VS2022 toolset to intel dpc++ (CMAKE)

Daniel_D
Beginner
2,736 Views

Hi,

 

I have a project that uses the latest MSVC and cuda 11.5. I want to switch over to intel DPC++ compiler and compare performance. My project is a cmake project and the VS2022 cmake settings does not offer the intel compiler toolsets.

What is the recommended way to switch to intel DPC++ compiler in an  existing cmake project?

 

Daniel_D_0-1642168248463.png

 

As you can see the intel dpc++ is not listed here. How can I add the intel toolset into the cmake settings of VS2022?


Thanks,

Daniel

0 Kudos
1 Solution
PradeepP_Intel
Moderator
2,662 Views

Hi,

 

Thanks for providing the information.


>>I have a project that uses the latest MSVC and cuda 11.5.

Is your project is based on CUDA? if yes, have you migrated the CUDA code to DPC++ code?


You can follow the below link for migration?


https://www.intel.com/content/www/us/en/develop/documentation/intel-dpcpp-compatibility-tool-user-guide/top/migrate-a-project/migrate-a-project-on-windows.html


>>What is the recommended way to switch to intel DPC++ compiler in an existing cmake project?

You can follow the below link to switch to intel DPC++ compiler in an existing cmake project


https://www.intel.com/content/www/us/en/developer/articles/technical/using-oneapi-compilers-with-cmake-in-visual-studio.html



Regards,

Pradeep


View solution in original post

0 Kudos
5 Replies
PradeepP_Intel
Moderator
2,693 Views

Hi,

 

Thanks for reaching out to us.

 

Could you please confirm whether you have installed Intel oneAPI Basetoolkit and successfully integrated it with Visual Studio.

If you have already installed the Intel oneAPI toolkit, please let us know the version of the toolkit which you are using.

If not, please find the below link to install them.

 

Download Link:

https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html

 

Installation Guide:

https://www.intel.com/content/www/us/en/developer/articles/guide/installation-guide-for-oneapi-toolkits.html

 

Thanks & Regards

Pradeep

0 Kudos
Daniel_D
Beginner
2,686 Views

Hi,

 

yes,  I installed version 2022.1.1 of the oneAPI Base Toolkit and use some function from the IPP in my current cmake based project that compiles under windows & Linux. Now I want to give the intel compiler a try, but I do not see any way to switch the toolkit to the intel compiler.

 

Thanks.

0 Kudos
PradeepP_Intel
Moderator
2,663 Views

Hi,

 

Thanks for providing the information.


>>I have a project that uses the latest MSVC and cuda 11.5.

Is your project is based on CUDA? if yes, have you migrated the CUDA code to DPC++ code?


You can follow the below link for migration?


https://www.intel.com/content/www/us/en/develop/documentation/intel-dpcpp-compatibility-tool-user-guide/top/migrate-a-project/migrate-a-project-on-windows.html


>>What is the recommended way to switch to intel DPC++ compiler in an existing cmake project?

You can follow the below link to switch to intel DPC++ compiler in an existing cmake project


https://www.intel.com/content/www/us/en/developer/articles/technical/using-oneapi-compilers-with-cmake-in-visual-studio.html



Regards,

Pradeep


0 Kudos
PradeepP_Intel
Moderator
2,626 Views

Hi, 


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

Any further interaction in this thread will be considered community only.


Regards,

Pradeep


0 Kudos
Daniel_D
Beginner
2,493 Views

Hi, unfortunately I have a new issue with this. I created a new cmake commandline project in VS2022. This one compiles fine with the MS toolchain. I now want to switch to the intel DPC C++ compile. The project uses a "CMakePreset.json" file. I tried a lot of different settings, but I cannot get the intel compiler to work with this one: Here is my current preset file:

 

{
   "version":3,
   "configurePresets":[
   { 
      "name":"windows-base",
      "hidden":true,
      "generator":"Ninja",
      "binaryDir":"${sourceDir}/out/build/${presetName}",
      "installDir":"${sourceDir}/out/install/${presetName}",
      "cacheVariables":{
         "CMAKE_C_COMPILER":"icx",
         "CMAKE_CXX_COMPILER":"icx"
      },
   "condition":{
   "type":"equals",
   "lhs":"${hostSystemName}",
   "rhs":"Windows"
   } 
},
{
   "name":"x64-debug",
   "displayName":"x64 Debug",
   "inherits":"windows-base",
   "architecture":{
   "value":"x64",
   "strategy":"external"
},
   "cacheVariables":{
   "CMAKE_BUILD_TYPE":"Debug"
   } 
},
{
"name":"x64-release",
"displayName":"x64 Release",
"inherits":"x64-debug",
"cacheVariables":{
"CMAKE_BUILD_TYPE":"Release"
}
}
]
}

 

 

 

and this is my CMakeList.txt

 

# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.22.1)

#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "C:/Program Files (x86)/Intel/oneAPI/compiler/2022.0.3/windows/IntelDPCPP")
#find_package (IntelDPCPP REQUIRED)

project ("IntelTest")

# Include sub-projects.
add_subdirectory ("IntelTest")

 

How can I switch from the MS compiler to the Intel DPC C++??

 

 

Thanks a lot,

Daniel

 

0 Kudos
Reply