Installation of DPC++ Compiler - Step by Step procedure (C, CPP and DPCPP file compilation example)

Опубликовано: 19 Март 2026
на канале: Shriram Vasudevan
1,352
21

Hello friends, here you go, the complete procedure to understand the installation of the DPC++ compiler.
1. Download Visual studio 2022 Community Installer for windows from the below link:
https://visualstudio.microsoft.com/vs/
2. Install by going through the instructions on the GUI. Note to select the C++ for desktop under workloads while installation when prompted.
3. If Visual studio is already is installed, rerun the installer. Select modify and under workloads select the C++ for desktop option and proceed.
4. Download the oneapi base toolkit from the below site:
https://www.intel.com/content/www/us/...
5. Install oneAPI base toolkit by running the installer
6. Go to the following link to get the sample code to add vectors:
https://pastebin.com/sy4Mcxf3
7. Save the file as a addv.dp.cpp in your system
8. Go to start menu and open Intel oneAPI command prompt for Intel 64 for Visual Studio 2022
9. Verify if the compiler has been installed by typing the command icpx --version
10. Open the directory where you have saved the code by typing cd name of directory
11. Compile the code by typing the command icpx -fsycl addv.dp.cpp
12. The code will be compiled and an executable .exe file will be created in the same directory.
13. Run the .exe file by typing a.exe to get run the sample code
14. Similarly create a C program file in the same directory and compile it using the command
icx prime.c
15. You will find an executable called prime.exe, run it
16. Do the same for a C++ program as well