Skip to content

Commit 914ffd6

Browse files
committed
Revert to original dict names and drop _CTK_MAJOR_MINOR_PATCH (#1712)
Restore DRIVER_CU_RESULT_EXPLANATIONS / RUNTIME_CUDA_ERROR_EXPLANATIONS as the dict names in cuda_bindings and remove the _CTK_MAJOR_MINOR_PATCH / _EXPLANATIONS indirection that is no longer needed without the cuda_core fallback copies. Made-with: Cursor
1 parent 112fb41 commit 914ffd6

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

cuda_bindings/cuda/bindings/_utils/driver_cu_result_explanations.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
# Replace the dictionary below with the output.
77
# Also update the CUDA Toolkit version number below.
88

9-
_CTK_MAJOR_MINOR_PATCH = (13, 2, 0)
10-
11-
_EXPLANATIONS = {
9+
# CUDA Toolkit v13.2.0
10+
DRIVER_CU_RESULT_EXPLANATIONS = {
1211
0: (
1312
"The API call returned with no errors. In the case of query calls, this"
1413
" also means that the operation being queried is complete (see"

cuda_bindings/cuda/bindings/_utils/runtime_cuda_error_explanations.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
# Replace the dictionary below with the output.
77
# Also update the CUDA Toolkit version number below.
88

9-
_CTK_MAJOR_MINOR_PATCH = (13, 2, 0)
10-
11-
_EXPLANATIONS = {
9+
# CUDA Toolkit v13.2.0
10+
RUNTIME_CUDA_ERROR_EXPLANATIONS = {
1211
0: (
1312
"The API call returned with no errors. In the case of query calls, this"
1413
" also means that the operation being queried is complete (see"

cuda_bindings/tests/test_enum_explanations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from cuda.bindings import driver, runtime
1010

1111
_EXPLANATION_MODULES = [
12-
("driver_cu_result_explanations", driver.CUresult),
13-
("runtime_cuda_error_explanations", runtime.cudaError_t),
12+
("driver_cu_result_explanations", "DRIVER_CU_RESULT_EXPLANATIONS", driver.CUresult),
13+
("runtime_cuda_error_explanations", "RUNTIME_CUDA_ERROR_EXPLANATIONS", runtime.cudaError_t),
1414
]
1515

1616

@@ -22,10 +22,10 @@ def _get_binding_version():
2222
return tuple(int(v) for v in major_minor)
2323

2424

25-
@pytest.mark.parametrize("module_name,enum_type", _EXPLANATION_MODULES)
26-
def test_explanations_health(module_name, enum_type):
25+
@pytest.mark.parametrize("module_name,dict_name,enum_type", _EXPLANATION_MODULES)
26+
def test_explanations_health(module_name, dict_name, enum_type):
2727
mod = importlib.import_module(f"cuda.bindings._utils.{module_name}")
28-
expl_dict = mod._EXPLANATIONS
28+
expl_dict = getattr(mod, dict_name)
2929

3030
known_codes = set()
3131
for error in enum_type:

cuda_core/cuda/core/_utils/cuda_utils.pyx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,12 @@ from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, Py_buffer, PyB
2727
from cuda.bindings cimport cynvrtc, cynvvm, cynvjitlink
2828

2929
try:
30-
from cuda.bindings._utils.driver_cu_result_explanations import (
31-
_EXPLANATIONS as DRIVER_CU_RESULT_EXPLANATIONS,
32-
)
30+
from cuda.bindings._utils.driver_cu_result_explanations import DRIVER_CU_RESULT_EXPLANATIONS
3331
except ModuleNotFoundError:
3432
DRIVER_CU_RESULT_EXPLANATIONS = {}
3533

3634
try:
37-
from cuda.bindings._utils.runtime_cuda_error_explanations import (
38-
_EXPLANATIONS as RUNTIME_CUDA_ERROR_EXPLANATIONS,
39-
)
35+
from cuda.bindings._utils.runtime_cuda_error_explanations import RUNTIME_CUDA_ERROR_EXPLANATIONS
4036
except ModuleNotFoundError:
4137
RUNTIME_CUDA_ERROR_EXPLANATIONS = {}
4238

0 commit comments

Comments
 (0)