CCCL configuration macros#

The CUDA Core Compute Libraries provide a set of macros to enable or disable specific features. These macros must be defined before any CCCL source file is included. The recommended way is to define them as the predefined compiler macros, for example:

nvcc -DCCCL_DISABLE_SOME_FEATURE src.cu

Important

These macros should be defined consistently in the whole project. Defining them only for some translation units may lead to unexpected compile time and runtime behaviour.

Assertion Control Macros#

CCCL_ENABLE_ASSERTIONS

Enables assertions in both host and device code. Implied by compiling in debug mode.

CCCL_ENABLE_DEVICE_ASSERTIONS

Enables assertions in device code, independent of debug mode. Implied by CCCL_ENABLE_ASSERTIONS.

CCCL_ENABLE_HOST_ASSERTIONS

Enables assertions in host code, independent of debug mode. Implied by CCCL_ENABLE_ASSERTIONS.

C++ Feature Control Macros#

CCCL_DISABLE_EXCEPTIONS

Disables throwing exceptions. Each throw is replaced by a call to cuda::std::terminate().

CCCL_DISABLE_RTTI

Disables use of runtime type information.

CCCL_IGNORE_MSVC_TRADITIONAL_PREPROCESSOR_WARNING

Disables diagnostics emitted when using MSVC’s traditional preprocessor.

CUDA Feature Control Macros#

CCCL_DISABLE_ARCH_DEPENDENT_NAMESPACE

Disables architecture dependent name mangling of kernels.

CCCL_DISABLE_CDP

Disables use of CUDA Dynamic Parallelism.

CCCL_DISABLE_CTK_COMPATIBILITY_CHECK

Disables the check whether NVCC’s version matches the CUDA Toolkit version.

CCCL_DISABLE_DEVICE_RUNTIME

Disables use of CUDA device runtime APIs (<cuda_device_runtime.h>), thus makes some APIs that are __host__ __device__ to be __host__ only.

CCCL_DISABLE_LAUNCH_BOUNDS

Disables use of __launch_bounds__ attribute.

CCCL_DISABLE_PDL

Disables use of Programmatic Dependent Launch.

Deprecation Diagnostics Suppression Macros#

CCCL_IGNORE_DEPRECATED_API

Disables deprecated API diagnostics.

CCCL_IGNORE_DEPRECATED_COMPILER

Disables deprecated compiler diagnostics.

CCCL_IGNORE_DEPRECATED_CPP_DIALECT

Disables deprecated C++ dialect diagnostics.

CCCL_IGNORE_DEPRECATED_CUDA_BELOW_12

Disables deprecated CUDA compiler diagnostics.

Third Party Libraries Interoperability#

CCCL_DISABLE_DLPACK

Disables inclusion of DLPack header and APIs.

Type Support#

CCCL_DISABLE_BF16_SUPPORT

Disables use and library support for the __nv_bfloat16 type. Also disables support for smaller NV floating point types.

CCCL_DISABLE_FLOAT128_SUPPORT

Disables use and library support for the __float128 type.

CCCL_DISABLE_FP16_SUPPORT

Disables use and library support for the __half type. Also disables support for smaller NV floating point types.

CCCL_DISABLE_INT128_SUPPORT

Disables use and library support for the __int128 type.

CCCL_DISABLE_LONG_DOUBLE_SUPPORT

Disables use and library support for the long double type.

CCCL_DISABLE_NVFP4_SUPPORT

Disables use and library support for the __nv_fp4_eNmM types. Also disables support for smaller NV floating point types.

CCCL_DISABLE_NVFP6_SUPPORT

Disables use and library support for the __nv_fp6_eNmM types. Also disables support for smaller NV floating point types.

CCCL_DISABLE_NVFP8_SUPPORT

Disables use and library support for the __nv_fp8_eNmM types. Also disables support for smaller NV floating point types.

CCCL_ENABLE_EXPERIMENTAL_HOST_ATOMICS_128B

Enables experimental support for 128b atomics in host code.

CCCL_GCC_HAS_EXTENDED_NUMERIC_LITERALS

Must be enabled in addition to passing -fext-numeric-literals with GCC to enable __float128 support.

Note

<cuda_fpN.h> headers contain dependencies on other <cuda_fpM.h> headers, thus for example defining CCCL_DISABLE_BF16_SUPPORT will disable support for NVIDIA 8-bit, 6-bit and 4-bit floating point types, too.