From 46add9e30a8df6d548bc2ca7659213afe25d362f Mon Sep 17 00:00:00 2001 From: ksimpson Date: Thu, 7 Nov 2024 12:15:59 -0800 Subject: [PATCH 1/3] rectify the supported types for ObjectCode and Program target type based on the nvrtc API --- cuda_core/cuda/core/experimental/_module.py | 4 ++-- cuda_core/cuda/core/experimental/_program.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_module.py b/cuda_core/cuda/core/experimental/_module.py index 8b0ff9a77c..ecbe96cc72 100644 --- a/cuda_core/cuda/core/experimental/_module.py +++ b/cuda_core/cuda/core/experimental/_module.py @@ -93,7 +93,7 @@ class ObjectCode: a file path string containing that module for loading. code_type : Any String of the compiled type. - Supported options are "ptx", "cubin" and "fatbin". + Supported options are "ptx", "cubin", "ltoir" "fatbin". jit_options : Optional Mapping of JIT options to use during module loading. (Default to no options) @@ -105,7 +105,7 @@ class ObjectCode: """ __slots__ = ("_handle", "_code_type", "_module", "_loader", "_sym_map") - _supported_code_type = ("cubin", "ptx", "fatbin") + _supported_code_type = ("cubin", "ptx", "ltoir", "fatbin") #This list must include, but is not limited to, all supported target types for Program def __init__(self, module, code_type, jit_options=None, *, symbol_mapping=None): diff --git a/cuda_core/cuda/core/experimental/_program.py b/cuda_core/cuda/core/experimental/_program.py index 5439c74a9e..3d000f12e3 100644 --- a/cuda_core/cuda/core/experimental/_program.py +++ b/cuda_core/cuda/core/experimental/_program.py @@ -26,7 +26,7 @@ class Program: __slots__ = ("_handle", "_backend", ) _supported_code_type = ("c++", ) - _supported_target_type = ("ptx", "cubin", "ltoir", ) + _supported_target_type = ("cubin", "ptx", "ltoir") #OptiXIR also supported by nvrtc def __init__(self, code, code_type): self._handle = None From 8e74cf3122551cda3567c14eda75365c2e54c818 Mon Sep 17 00:00:00 2001 From: ksimpson Date: Thu, 7 Nov 2024 12:22:47 -0800 Subject: [PATCH 2/3] remove the comment --- cuda_core/cuda/core/experimental/_module.py | 4 ++-- cuda_core/cuda/core/experimental/_program.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_module.py b/cuda_core/cuda/core/experimental/_module.py index ecbe96cc72..a227b4435d 100644 --- a/cuda_core/cuda/core/experimental/_module.py +++ b/cuda_core/cuda/core/experimental/_module.py @@ -93,7 +93,7 @@ class ObjectCode: a file path string containing that module for loading. code_type : Any String of the compiled type. - Supported options are "ptx", "cubin", "ltoir" "fatbin". + Supported options are "ptx", "cubin", "fatbin" and "ltoir". jit_options : Optional Mapping of JIT options to use during module loading. (Default to no options) @@ -105,7 +105,7 @@ class ObjectCode: """ __slots__ = ("_handle", "_code_type", "_module", "_loader", "_sym_map") - _supported_code_type = ("cubin", "ptx", "ltoir", "fatbin") #This list must include, but is not limited to, all supported target types for Program + _supported_code_type = ("cubin", "ptx", "ltoir", "fatbin") def __init__(self, module, code_type, jit_options=None, *, symbol_mapping=None): diff --git a/cuda_core/cuda/core/experimental/_program.py b/cuda_core/cuda/core/experimental/_program.py index 3d000f12e3..75b7313f43 100644 --- a/cuda_core/cuda/core/experimental/_program.py +++ b/cuda_core/cuda/core/experimental/_program.py @@ -26,7 +26,7 @@ class Program: __slots__ = ("_handle", "_backend", ) _supported_code_type = ("c++", ) - _supported_target_type = ("cubin", "ptx", "ltoir") #OptiXIR also supported by nvrtc + _supported_target_type = ("ptx", "cubin", "ltoir") def __init__(self, code, code_type): self._handle = None From 031a9b09d5084c9a08ca26df2c55f8844044b910 Mon Sep 17 00:00:00 2001 From: ksimpson Date: Thu, 7 Nov 2024 12:24:45 -0800 Subject: [PATCH 3/3] nit --- cuda_core/cuda/core/experimental/_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_module.py b/cuda_core/cuda/core/experimental/_module.py index a227b4435d..7621b9ee4e 100644 --- a/cuda_core/cuda/core/experimental/_module.py +++ b/cuda_core/cuda/core/experimental/_module.py @@ -93,7 +93,7 @@ class ObjectCode: a file path string containing that module for loading. code_type : Any String of the compiled type. - Supported options are "ptx", "cubin", "fatbin" and "ltoir". + Supported options are "ptx", "cubin", "ltoir" and "fatbin". jit_options : Optional Mapping of JIT options to use during module loading. (Default to no options)