From 746fa2c567c1889fd94db0c5e308c33e0d1a3fe3 Mon Sep 17 00:00:00 2001 From: abhilash1910 Date: Thu, 29 Oct 2026 21:21:37 +0000 Subject: [PATCH] fast compile program options --- cuda_core/cuda/core/_program.pyx | 24 ++++++++++++++++++++++++ cuda_core/tests/test_program.py | 12 ++++++++++++ 2 files changed, 36 insertions(+) diff --git a/cuda_core/cuda/core/_program.pyx b/cuda_core/cuda/core/_program.pyx index 94f5bf74f72..e24123348cc 100644 --- a/cuda_core/cuda/core/_program.pyx +++ b/cuda_core/cuda/core/_program.pyx @@ -1448,6 +1448,30 @@ cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): unsupported.append("fdevice_syntax_only") if opts.minimal is not None and opts.minimal: unsupported.append("minimal") + if opts.no_cache is not None and opts.no_cache: + unsupported.append("no_cache") + if opts.fdevice_time_trace is not None: + unsupported.append("fdevice_time_trace") + if opts.device_float128 is not None and opts.device_float128: + unsupported.append("device_float128") + if opts.frandom_seed is not None: + unsupported.append("frandom_seed") + if opts.ofast_compile is not None: + unsupported.append("ofast_compile") + if opts.pch is not None and opts.pch: + unsupported.append("pch") + if opts.create_pch is not None: + unsupported.append("create_pch") + if opts.use_pch is not None: + unsupported.append("use_pch") + if opts.pch_dir is not None: + unsupported.append("pch_dir") + if opts.pch_verbose is not None: + unsupported.append("pch_verbose") + if opts.pch_messages is not None: + unsupported.append("pch_messages") + if opts.instantiate_templates_in_pch is not None: + unsupported.append("instantiate_templates_in_pch") if unsupported: raise CUDAError(f"The following options are not supported by NVVM backend: {', '.join(unsupported)}") diff --git a/cuda_core/tests/test_program.py b/cuda_core/tests/test_program.py index b51554a1603..d0347401142 100644 --- a/cuda_core/tests/test_program.py +++ b/cuda_core/tests/test_program.py @@ -1367,6 +1367,18 @@ def test_program_options_bad_define_macro_nested_list_invalid_element(): {"split_compile": 2}, {"fdevice_syntax_only": True}, {"minimal": True}, + {"no_cache": True}, + {"fdevice_time_trace": "trace.json"}, + {"device_float128": True}, + {"frandom_seed": "1"}, + {"ofast_compile": "0"}, + {"pch": True}, + {"create_pch": "out.pch"}, + {"use_pch": "in.pch"}, + {"pch_dir": "pch-cache"}, + {"pch_verbose": False}, + {"pch_messages": False}, + {"instantiate_templates_in_pch": False}, ], ids=lambda kw: next(iter(kw)), )