Skip to content

Compiler Settings

THOR builds with a SYCL compiler that targets CPUs and GPUs across vendors. THOR supports two SYCL implementations: AdaptiveCpp (primary development target) and Intel oneAPI DPC++/C++ Compiler.

Choosing a SYCL Compiler

For installation see AdaptiveCpp or Intel oneAPI. Development is done against AdaptiveCpp; newer features may lag in oneAPI.

Select the compiler by setting CXX and CC before building.

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

SYCL kernels can be compiled at build time (AOT) or at runtime (JIT). THOR prefers JIT because:

  • THOR has many kernel variants — AOT compilation of all of them is slow.
  • The hardware target need not be known at build time, which suits mixed-vendor HPC environments.
  • Runtime constants can be folded during JIT, enabling further optimization.

JIT is the default for both AdaptiveCpp and Intel oneAPI. To force AOT under AdaptiveCpp, pass -DACPP_TARGETS="<targets>" to CMake (see the AdaptiveCpp compilation docs).

AdaptiveCpp target selection

The supported configuration is the generic SSCP target (AdaptiveCpp's default): one build serves CPU and GPU, with the backend chosen at runtime via the YAML device: key and ACPP_VISIBILITY_MASK. Two caveats:

  • Do not combine generic;omp unless you know what you are doing. There usually is no reason to combine those — generic alone already covers CPU and GPU. The combination has been observed to produce builds that compile cleanly but fail on GPU at kernel launch with Unresolved extern function ....
  • -DACPP_TARGETS="omp" alone is a valid CPU-only AOT build (used for regression testing), but it has no GPU support.

Avoid hardware-specific AOT targets such as cuda:sm_XX or cuda.explicit-multipassgeneric is the convention.