Get Started

  • 0.08
  • 07/28/2020
  • 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:
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.

For Visual Studio Code Users, Install the Sample Browser Extension

You can browse and download samples in Visual Studio Code using the Sample Browser extension:
  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 to browse available extensions.
  3. Click
  4. After the extension installs, close VS Code. The directions in the Build and Run a Sample section will show you how to launch VS Code so that the environment variable are set correctly.

Create a Project Using Visual Studio Code

  1. Navigate to the install directory and source
    source <install_dir>/
    The command above assumes you installed to the default folder. If you customized the installation folder,
    is in your custom folder. See here for more information on
  2. Launch VSCode:
  3. Click on the oneAPI button on the left navigation to view samples.
  4. A list of available samples will open in the left navigation.
  5. Select a sample. Instructions for how to build and run that sample will appear in a preview window.
  6. To build and run a sample, click the + to the right of the sample name.
  7. Create a new folder for the sample. The sample will load in a new window:
  8. Click to view instructions for the sample.
Not all oneAPI sample projects use CMake. The
file for each sample specifies how to build the sample. We recommend that you check out the CMake extension for VSCode that is maintained by Microsoft.
For more information on using VSCode with Intel oneAPI toolkits, see:

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804