File tree Expand file tree Collapse file tree
cuda_python_test_helpers/cuda_python_test_helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33
4+ import pathlib
5+ import sys
6+
7+ helpers_root = pathlib .Path (__file__ ).resolve ().parents [2 ] / "cuda_python_test_helpers"
8+ if helpers_root .is_dir () and str (helpers_root ) not in sys .path :
9+ # Prefer the in-repo helpers over any installed copy.
10+ sys .path .insert (0 , str (helpers_root ))
11+
412import cuda .bindings .driver as cuda
513import pytest
614
Original file line number Diff line number Diff line change 1010import numpy as np
1111import pytest
1212from cuda .bindings import driver
13- from cuda . bindings . _test_helpers .managed_memory import managed_memory_skip_reason
13+ from cuda_python_test_helpers .managed_memory import managed_memory_skip_reason
1414
1515
1616def driverVersionLessThan (target ):
Original file line number Diff line number Diff line change 66
77import helpers
88import pytest
9- from cuda . bindings . _test_helpers .managed_memory import managed_memory_skip_reason
9+ from cuda_python_test_helpers .managed_memory import managed_memory_skip_reason
1010
1111try :
1212 from cuda .bindings import driver
Original file line number Diff line number Diff line change 2222 CCCL_INCLUDE_PATHS = (path ,) + CCCL_INCLUDE_PATHS
2323
2424
25- try :
26- from cuda_python_test_helpers import * # noqa: F403
27- except ImportError :
28- # Import shared platform helpers for tests across repos
29- sys . path . insert ( 0 , str ( pathlib . Path ( __file__ ). resolve (). parents [ 3 ] / "cuda_python_test_helpers" ))
30- from cuda_python_test_helpers import * # noqa: F403
25+ helpers_root = pathlib . Path ( __file__ ). resolve (). parents [ 3 ] / "cuda_python_test_helpers"
26+ if helpers_root . is_dir () and str ( helpers_root ) not in sys . path :
27+ # Prefer the in-repo helpers over any installed copy.
28+ sys . path . insert ( 0 , str ( helpers_root ))
29+
30+ from cuda_python_test_helpers import * # noqa: E402, F403
3131
3232
3333@functools .cache
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2- # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
2+ # SPDX-License-Identifier: Apache-2.0
33
44from __future__ import annotations
55
88import pytest
99
1010try :
11- from cuda .bindings import driver
11+ from cuda .bindings import driver # type: ignore
1212except Exception :
13- from cuda import cuda as driver
13+ from cuda import cuda as driver # type: ignore
1414
1515
1616def _resolve_device_id (device ) -> int :
You can’t perform that action at this time.
0 commit comments