Compilation

tests.compilation.clang_cuda_fix_cccl_include(*, compiler: CMakeToolchainCompiler, cuda_version: Version) tuple[Path, ...]View on GitHub

Return any missing include path for when clang is used to compile for CUDA 13 and above.

For instance, clang 22 omits <cuda_root>/include/cccl from its implicit search directories, yet CUDA 13 ships headers such as cuda/atomic there.

tests.compilation.get_compilation_output(*, source: Path, cwd: Path, arch: NVIDIAArch, cmake_file_api: FileAPI, object_file: bool = True, resource_usage: bool = False, ptx: bool = False, version: Version | None = None) tuple[Path, str]View on GitHub

Compile the source in cwd for arch.

Parameters:

object_file – Whether to compile into an object file.

tests.compilation.get_cubin_name(*, compiler: CMakeToolchainCompiler, file: Path, arch: NVIDIAArch, object_file: bool = False) strView on GitHub

When the compilation is not into an object file, the resulting file may contain:

  • more than one (usually 2) embedded CUDA binary files when using nvcc

  • only one when using clang

For nvcc, the first cubin is usually nearly empty.