Get Started

  • 2021.2
  • 03/27/2021
  • Public Content

Build and Run a Sample Project Using Visual Studio Code

Intel® oneAPI Base Toolkit
Intel® oneAPI
toolkits integrate with third-party IDEs to provide a seamless GUI experience for software development.
If you are using Visual Studio Code (VS Code) with FPGA, see the Intel® oneAPI DPC++ FPGA Workflows on Third-Party IDEs.
An internet connection is required to download the samples for oneAPI toolkits. If you are using an offline system, download the samples from a system that is internet connected and transfer the sample files to your offline system. If you are using an IDE for development, you will not be able to use the oneAPI CLI Samples Browser while you are offline. Instead, download the samples and extract them to a directory. Then open the sample with your IDE. The samples can be downloaded from here:
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.
This procedure requires the Sample Browser extension to be installed. The next section will describe how to install it. If you have already installed it, skip to Create a Project Using Visual Studio Code.

Extensions for Visual Studio Code Users

You can use VS Code extensions to set your environment, create launch configurations, and browse and download samples:
  1. From Visual Studio Code, click on the Extensions logo in the left navigation.
  2. Locate the extension titled
    Sample Browser for Intel oneAPI Toolkits
    , or visit https://marketplace.visualstudio.com/publishers/intel-corporation to browse available extensions.
  3. Click
    Install
    .
  4. Next, locate the extension titled
    Environment and Launch Configurator for Intel oneAPI Toolkits
    .
  5. Click
    Install
    .

Create a Project Using Visual Studio Code

  1. Press
    Ctrl+Shift+P
    (or
    View>Command Pallette...
    ) to open the Command Pallette.
  2. Type Intel oneAPI to view options of the installed extensions.
  3. Click on Intel oneAPI: Set oneAPI environment. All tasks, launches, and terminals created from VS Code will now contain the oneAPI environment.
  4. 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.
  5. A list of available samples will open in the left navigation.
  6. 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.
  7. To build and run a sample, click the
    +
    to the right of the sample name.
  8. Create a new folder for the sample. The sample will load in a new window:
  9. Click README.md to view instructions for the sample.
Not all oneAPI sample projects use CMake. The
README.md
file for each sample specifies how to build the sample. We recommend that you check out the CMake extension for VS Code that is maintained by Microsoft.
For more information on oneAPI extensions and remote development with VS Code, see Using Visual Studio Code with Intel® oneAPI Toolkits.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.