Skip to content

Commit 6fc77b7

Browse files
committed
Delete cuda_core fallback explanation copies, import from cuda.bindings (#1712)
Remove the vendored explanation dicts from cuda_core. cuda_utils.pyx now imports directly from cuda.bindings._utils with a ModuleNotFoundError fallback to an empty dict, so error messages gracefully degrade when paired with older cuda-bindings that don't ship the dicts. Made-with: Cursor
1 parent 89a2052 commit 6fc77b7

4 files changed

Lines changed: 13 additions & 966 deletions

File tree

cuda_core/cuda/core/_utils/cuda_utils.pyx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,19 @@ from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, Py_buffer, PyB
2727

2828
from cuda.bindings cimport cynvrtc, cynvvm, cynvjitlink
2929

30-
from cuda.core._utils.driver_cu_result_explanations import DRIVER_CU_RESULT_EXPLANATIONS
31-
from cuda.core._utils.runtime_cuda_error_explanations import RUNTIME_CUDA_ERROR_EXPLANATIONS
30+
try:
31+
from cuda.bindings._utils.driver_cu_result_explanations import (
32+
_EXPLANATIONS as DRIVER_CU_RESULT_EXPLANATIONS,
33+
)
34+
except ModuleNotFoundError:
35+
DRIVER_CU_RESULT_EXPLANATIONS = {}
36+
37+
try:
38+
from cuda.bindings._utils.runtime_cuda_error_explanations import (
39+
_EXPLANATIONS as RUNTIME_CUDA_ERROR_EXPLANATIONS,
40+
)
41+
except ModuleNotFoundError:
42+
RUNTIME_CUDA_ERROR_EXPLANATIONS = {}
3243

3344

3445
class CUDAError(Exception):

0 commit comments

Comments
 (0)