diff options
| author | David Seifert <soap@gentoo.org> | 2025-07-12 11:00:46 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jussi.pakkanen@mailbox.org> | 2025-07-12 23:00:40 +0300 |
| commit | ee368943e8c6e4c93f7640248c693c1a89d1b374 (patch) | |
| tree | d9684ea3ef5120acbdee11073ab25f5151c5e826 | |
| parent | c674f5310549215069fc6be08a29702f646d04a9 (diff) | |
| download | meson-ee368943e8c6e4c93f7640248c693c1a89d1b374.tar.gz | |
cuda: enable support for `CCCL_ENABLE_ASSERTIONS`
CUDA 12.9.0 ships a cccl that supports the new debug macros.
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index fd747d112..94bace6c5 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -198,6 +198,7 @@ class CudaCompiler(Compiler): for level, flags in host_compiler.warn_args.items() } self.host_werror_args = ['-Xcompiler=' + x for x in self.host_compiler.get_werror_args()] + self.debug_macros_available = version_compare(self.version, '>=12.9') @classmethod def _shield_nvcc_list_arg(cls, arg: str, listmode: bool = True) -> str: @@ -808,7 +809,12 @@ class CudaCompiler(Compiler): return ['-Xcompiler=' + x for x in self.host_compiler.get_profile_use_args()] def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: - return self.host_compiler.get_assert_args(disable, env) + cccl_macros = [] + if not disable and self.debug_macros_available: + # https://github.com/NVIDIA/cccl/pull/2382 + cccl_macros = ['-DCCCL_ENABLE_ASSERTIONS=1'] + + return self.host_compiler.get_assert_args(disable, env) + cccl_macros def has_multi_arguments(self, args: T.List[str], env: Environment) -> T.Tuple[bool, bool]: args = self._to_host_flags(args) |
