Build and Run a Sample Project Using Visual Studio Code
Extensions for Visual Studio Code Users
- From Visual Studio Code, click on the Extensions logo in the left navigation.
- Locate the extension titledSample Browser for Intel oneAPI Toolkits, or visit https://marketplace.visualstudio.com/publishers/intel-corporation to browse available extensions.
- Next, locate the extension titledEnvironment Configurator for Intel oneAPI Toolkits.
Create a Project Using Visual Studio Code
- PressCtrl+Shift+P(orView>Command Pallette...) to open the Command Pallette.
- Type Intel oneAPI to view options of the installed extensions.
- Set the oneAPI environment:
- PressCtrl+Shift+P( orView -> Command Palette…) to open the Command Palette.
- TypeIntel oneAPIto view options of the installed extensions.
- Click onIntel oneAPI: Initialize environment variables.
- If prompted, locate the setvars file in<install_dir>/opt/intel/oneapi/
- In the case of multiple folders in workspace, select the appropriate one. All tasks, launches, and terminals created from VS Code will now contain the oneAPI environment.
- Click on the oneAPI button on the left navigation to view samples.To watch a video presentation of how to install the Sample Browser extension and create a project with Visual Studio Code, see Exploring oneAPI Samples with the Sample Browser in Visual Studio Code.
- A list of available samples will open in the left navigation.
- To view the readme for the sample, click the next to the sample. If you choose to build and run the sample, the readme will also be downloaded with the sample.
- To build and run a sample, click the+to the right of the sample name.
- Create a new folder for the sample. The sample will load in a new window:
- Click README.md to view instructions for the sample.