Skip to content

Files

Latest commit

fcf7c16 · Feb 2, 2024

History

History
This branch is 108 commits ahead of, 223 commits behind oneapi-src/oneAPI-samples:master.

GPU-Opt-Guide

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 19, 2024
Feb 2, 2024
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Aug 25, 2022
Apr 27, 2023
Jan 22, 2024
Jan 24, 2024
Apr 27, 2023
Jan 19, 2024
Apr 27, 2023
Jan 19, 2024
Apr 27, 2023
Jan 22, 2024
Jan 24, 2024
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Oct 23, 2023
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Apr 27, 2023
Sep 19, 2023
Apr 27, 2023
Sep 19, 2023
Apr 27, 2023
Apr 27, 2023
Sep 19, 2023
Apr 27, 2023
Apr 27, 2023
Oct 23, 2023
Aug 25, 2022

oneAPI GPU Optimization Guide Examples

This repository accompanies the oneAPI GPU Optimization Guide Developer Guide.

Get the Examples

You can get the examples in either of two methods:

  • Use Git to clone the oneAPI-samples GitHub repository on your system.
  • Download the files by selecting Code > Download ZIP from oneAPI-samples GitHub repository.

Purpose

This repository contains the example sources mentioned in the oneAPI GPU Optimization Guide Developer Guide along with the build scripts for building and running the examples.

In tandem with the information found in the guide, the examples in the repository allow programmers to experiment with the examples and understand the techniques presented in the oneAPI GPU Optimization Guide.

Prerequisites

To build and use these examples, you will need to one or more of the following toolkits:

Note: You will need the HPC Kit to build the Fortran examples in this repository. The Intel® Fortran Compiler is included in the HPC Kit.

Alternatively, you can build most of the toolchain from the sources in the Intel Project for LLVM* technology GitHub repository.

Minimum Requirement Description
OS Ubuntu* 20.04
Hardware Skylake with GEN9 or newer
Software Intel® oneAPI DPC++/C++ Compiler
Intel® Fortran Compiler

Set Environment Variables

When working with the command-line interface (CLI), you should configure the oneAPI toolkits using environment variables. Set up your CLI environment by sourcing the setvars script every time you open a new terminal window. This practice ensures that your compiler, libraries, and tools are ready for development.

Note: You can use Modulefiles scripts to set up your development environment. The modulefiles scripts work with all Linux shells.

Note: If you want to select specific components or the version of those components, use a setvars config file to set up your development environment.

Build the Examples

Note: If you have not already done so, set up your CLI environment by sourcing the setvars script in the root of your oneAPI installation.

Linux*:

  • For system wide installations: . /opt/intel/oneapi/setvars.sh
  • For private installations: . ~/intel/oneapi/setvars.sh
  • For non-POSIX shells, like csh, use the following command: bash -c 'source <install-dir>/setvars.sh ; exec csh'

For more information on configuring environment variables, see Use the setvars Script with Linux* or macOS*.

Include Files

After installing the toolkits, the include folder is at %ONEAPI_ROOT%/dev-utilities/latest/include on your development system. You might need to use some of the resources from this location to build the examples.

Alternatively, you can get the common resources from the oneAPI-samples GitHub repository.

On Linux*

  1. Change to the oneAPI-samples/Publications/GPU-Opt-Guide directory on your system.
  2. Build the example program.
    mkdir -p build
    cd build
    cmake ..
    make

Run the Examples

On Linux

  1. Ensure you are in the correct example build directory.
  2. Run the example.
    make test
  3. Clean the project files. (Optional)
    make clean
    

License

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.