Skip to content

Compiler Settings

THOR uses SYCL for compilation to various hardware targets, such as CPUs and GPUs across vendors. SYCL is an open standard with different compiler implementations. There are two main SYCL compilers (that THOR supports): AdaptiveCpp and Intel oneAPI DPC++/C++ Compiler. This page summarizes the options for choosing and configuring a SYCL compiler for THOR.

Choosing a SYCL Compiler

Here we describe how to select a SYCL compiler for compilation with THOR and their interaction. We do not cover their installation. Please see AdaptiveCpp or Intel oneAPI for installation instructions. Development is done with AdaptiveCpp --- newer features might not be available with the Intel oneAPI compiler.

To choose a SYCL compiler, set the CXX and CC environment variables to the paths to the desired compiler executable before building THOR. For AdaptiveCpp:

export CXX=acpp
export CC=clang

For Intel oneAPI DPC++/C++ Compiler:

export CXX=icpx
export CC=icx

Ahead-of-Time (AOT) vs. Just-in-Time (JIT) Compilation

Both AdaptiveCpp and Intel oneAPI support Ahead-of-Time (AOT) and Just-in-Time (JIT) compilation for SYCL kernels. This indicates whether compute-intense kernels are compiled during the regular build process (AOT) or are compiled during the THOR exection itself (JIT).

THOR prefers JIT compilation for the following reason: * The multitude of kernel variants leads to very long AOT compilation times. * You do not need to know the hardware target on HPC systems in advance. This is particularly useful in mixed-vendor environments. * We adapt our kernels with run-time variables that can be optimized to constants during JIT compilation when using that flow.

JIT compilation is the default for both AdaptiveCpp and Intel oneAPI. For AdaptiveCpp, you can switch to AOT compilation by passing -DACPP_TARGETS="targets" to CMake, see here for details.