General Settings

The macros on this page describe how Kokkos was configured. Each one is defined when the corresponding CMake option is enabled (see Relationship with CMake configuration options).

Debugging

Macro

Description

KOKKOS_ENABLE_DEBUG

Extra debug features are activated.

KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK

Extra bounds checks are enabled.

Kokkos applies these checks itself, so they are mostly informational. See Debugging in the Configuration Guide for the corresponding options.

Deprecated code

Macro

Description

KOKKOS_ENABLE_DEPRECATED_CODE_<N>

Features deprecated in major release <N> are still available.

KOKKOS_ENABLE_DEPRECATION_WARNINGS

Deprecated features generate deprecation warnings.

KOKKOS_ENABLE_DEPRECATED_CODE_<N> is useful for code that must build with several Kokkos versions:

#include <Kokkos_Core.hpp>

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
// Kokkos 4.x deprecated features are still available
#endif

Tuning and performance

Macro

Description

KOKKOS_ENABLE_TUNING

Bindings for tuning tools are available (see #2422).

KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION

Certain dependency assumptions are ignored for aggressive vectorization of internal Kokkos loops.

KOKKOS_ENABLE_COMPLEX_ALIGN

Complex types are aligned. This macro has no documented CMake option.

C++ Standard

Exactly one macro is defined, matching the C++ standard Kokkos was compiled with. Applications should compile with the same standard (and the same compiler) as Kokkos, so most code has no need to test these macros.

Macro

Description

Note

KOKKOS_ENABLE_CXX17

Kokkos was compiled with the C++17 language standard.

Removed in Kokkos 5.0

KOKKOS_ENABLE_CXX20

Kokkos was compiled with the C++20 language standard.

KOKKOS_ENABLE_CXX23

Kokkos was compiled with the C++23 language standard.

KOKKOS_ENABLE_CXX26

Kokkos was compiled with the C++26 language standard.

Third-Party Libraries

These macros give information about what third-party libraries Kokkos was compiled with. They correspond to the Kokkos_ENABLE_<TPL> options listed under Third-Party Libraries (TPLs) in the Configuration Guide.

Macro

Description

KOKKOS_ENABLE_HWLOC

libhwloc is enabled for NUMA and architecture information.

KOKKOS_ENABLE_LIBDL

Kokkos links to the dynamic linker (libdl).

KOKKOS_ENABLE_LIBQUADMATH

Kokkos links to the GCC Quad-Precision Math Library API.

KOKKOS_ENABLE_ONEDPL

Kokkos links to the oneDPL library when using the SYCL backend. Enabling this TPL might affect performance for Kokkos algorithms that use it, e.g., sort.

KOKKOS_ENABLE_ROCTHRUST

Kokkos links to the rocThrust library when using the HIP backend. Enabling this TPL might affect performance for Kokkos algorithms that use it, e.g., sort.