The oneAPI-samples repository contains samples for the Intel® oneAPI Toolkits.
The contents of the default branch in this repository are meant to be used with the most recent released version of the Intel® oneAPI Toolkits.
You can find samples by browsing the oneAPI Samples Catalog. Using the catalog you can search on the sample titles or descriptions.
You can refine your browsing or searching through filtering on the following:
- Expertise (Getting Started, Tutorial, etc.)
- Programming language (C++, Python, or Fortran)
- Target device (CPU GPU, and FPGA)
Clone the repository by entering the following command:
git clone https://github.com/oneapi-src/oneAPI-samples.git
Alternatively, you can download a zip file containing the primary branch in repository.
- Click the Code button.
- Select Download ZIP from the menu options.
- After downloading the file, unzip the repository contents.
If you need samples for an earlier version of any of the Intel® oneAPI Toolkits, then use a tagged version of the repository that corresponds with the toolkit version.
Clone an earlier version of the repository using Git by entering a command similar to the following:
git clone -b <tag> https://github.com/oneapi-src/oneAPI-samples.git
where <tag>
is the GitHub tag corresponding to the toolkit version number, like 2024.2.0.
Alternatively, you can download a zip file containing a specific tagged version of the repository.
- Select the appropriate tag.
- Click the Code button.
- Select Download ZIP from the menu options.
- After downloading the file, unzip the repository contents.
The best oneAPI sample to start with depends on what you are trying to learn or types of problems you are trying to solve.
If you want to learn about... | Start with... |
---|---|
the basics of writing, compiling, and building programs for CPUs, GPUs, or FPGAs | Simple Add or Vector Add samples (You can use these samples as starter projects by removing unwanted elements and adding your code and build requirements.) |
the basics of using artificial intelligence | Getting Started Samples for AI Tools |
the basics of image rendering workloads and ray tracing | Getting Started Samples for Intel® oneAPI Rendering Toolkit (Render Kit) |
how to modify or create build files for SYCL-compliant projects | Vector Add sample |
Note: The README.md included with each sample provides build instructions for all supported operating system. For samples run in Jupyter Notebooks, you might need to install or configure additional frameworks or package managers if you do not already have them on your system.
If you prefer to use an Integrated Development Environment (IDE) with these samples, you can download Visual Studio Code for use on Windows*, Linux*, and macOS*.
The oneAPI-sample repository is organized by high-level categories.
Intel(R) Xeon(R) Platinum 8468V
Intel(R) Data Center GPU Max 1100
OpenCL Driver: Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8468V OpenCL 3.0 (Build 0) [2024.18.7.0.11_160000]
Level Zero Driver: Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1100 1.3 [1.3.28202]
oneAPI package version:
‐ Intel oneAPI HPC Toolkit Build Version: 2025.0.0.825
11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Intel(R) Iris(R) Xe Graphics OpenCL 3.0 NEO
OpenCL Driver: Intel(R) OpenCL, 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz OpenCL 3.0 (Build 0) [2024.18.9.0.28_160000]
Level Zero Driver: Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Iris(R) Xe Graphics 12.0.0 [1.3.27193]
oneAPI package version:
‐ Intel oneAPI HPC Toolkit Build Version: 2025.0.0.822
- If you are using Microsoft Visual Studio* 2019, you must use Microsoft Visual Studio 2019 version 16.4.0 or newer.
- Windows support for the FPGA code samples is limited to the FPGA emulator and optimization reports. Only Linux supports FPGA hardware compilation. See any FPGA code sample README.md for more details.
- If you encounter
Error MSB6003 The specified task executable ... could not be run...
when building a sample program, it might be due to the length of the directory path. Move thebuild
directory to a location with a shorter path. Build the sample in the new location.
A curated list of samples from oneAPI based projects, libraries, and tools. In addition, the most exciting samples from other AI projects that are not necessarily based on oneAPI are also listed here to provide you with the latest and valuable resources for augmenting your productivity.
- OpenVINO™ notebooks: A collection of ready-to-run Jupyter notebooks for learning and experimenting with the OpenVINO™ Toolkit, an open-source AI toolkit that makes it easier to write once, deploy anywhere. The notebooks introduce OpenVINO basics and teach developers how to leverage the API for optimized deep learning inference.
- Intel® Gaudi® Tutorials: Tutorials with step-by-step instructions for running PyTorch and PyTorch Lightning models on the Intel Gaudi AI Processor for training and inferencing, from beginner level to advanced users.
- Powered-by-Intel Leaderboard: This leaderboard celebrates and increases the discoverability of models developed on Intel hardware by the AI developer community. We provide developers with sample code and resources (developer programs) to deploy (inference) AI PC, Intel® Xeon® Scalable processors, Intel® Gaudi® processors, Intel® Arc™ GPUs, and Intel® Data Center GPUs.
- Intel® AI Reference Models: This repository contains links to pre-trained models, sample scripts, best practices, and step-by-step tutorials for many popular open-source machine learning models optimized by Intel to run on Intel® Xeon® Scalable processors and Intel® Data Center GPUs.
- awesome-oneapi: A community sourced list of awesome oneAPI and SYCL projects for solutions across a wide range of industry segments.
- Generative AI Examples: A collection of GenAI examples such as ChatQnA, Copilot, which illustrate the pipeline capabilities of the Open Platform for Enterprise AI (OPEA) project. OPEA is an ecosystem orchestration framework to integrate performant GenAI technologies & workflows leading to quicker GenAI adoption and business value.
Code samples are licensed under the MIT license. See License.txt for details.
Third-party program licenses can be found here: third-party-programs.txt.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.