This repository accompanies the oneAPI GPU Optimization Guide Developer Guide.
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.
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.
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 |
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.
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*.
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.
- Change to the
oneAPI-samples/Publications/GPU-Opt-Guide
directory on your system. - Build the example program.
mkdir -p build cd build cmake .. make
- Ensure you are in the correct example build directory.
- Run the example.
make test
- Clean the project files. (Optional)
make clean
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.