oneapi-src / oneAPI-samples

Samples for Intel® oneAPI Toolkits
https://oneapi-src.github.io/oneAPI-samples/
MIT License
899 stars 675 forks source link
ai cpu cuda fortran fpga gpu jupyter oneapi oneccl onedal onednn onedpl onemkl onetbb python pytorch rendering scikit-learn sycl tensorflow

oneAPI Samples

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.

Find oneAPI Samples

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:

Get the oneAPI Samples

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.

  1. Click the Code button.
  2. Select Download ZIP from the menu options.
  3. After downloading the file, unzip the repository contents.

Get Earlier Versions of the oneAPI Samples

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.

  1. Select the appropriate tag.
  2. Click the Code button.
  3. Select Download ZIP from the menu options.
  4. After downloading the file, unzip the repository contents.

Getting Started with oneAPI Samples

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.

Using Integrated Development Environments (IDE)

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*.

Repository Structure

The oneAPI-sample repository is organized by high-level categories.

Platform Validation

Samples in this release are validated on the following platforms.

Ubuntu 22.04

12th Gen Intel(R) Core(TM) i9-12900 \ Intel(R) UHD Graphics 770 3.0 ; (gen12, AlderLake-S GT1 [8086:4680]) \ Opencl driver: Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2024.17.3.0.08_160000] \ Level Zero driver: Intel(R) Level-Zero, Intel(R) UHD Graphics 770 1.3 [1.3.28202] \ oneAPI package version: \ ‐ Intel oneAPI Base Toolkit Build Version: 2024.2.0.634 \ ‐ Intel oneAPI HPC Toolkit Build Version: 2024.2.0.635 \

Windows 11

12th Gen Intel(R) Core(TM) i9-12900 Intel(R) UHD Graphics 770 3.0 ; (gen12, AlderLake-S GT1 [8086:4680]) \ Opencl driver: Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2024.17.3.0.08_160000] \ Level Zero driver: Intel(R) Level-Zero, Intel(R) UHD Graphics 770 1.3 [1.3.28597] \ oneAPI package version: \ ‐ Intel oneAPI Base Toolkit Build Version: 2024.2.0.635 \ ‐ Intel oneAPI HPC Toolkit Build Version: 2024.2.0.633 \

Known Issues and Limitations

Windows

Additional Resources for Code Samples

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.

Licenses

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.

Notices and Disclaimers

© 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.