Skip to content

Commit 90590ec

Browse files
[pre-commit.ci] auto code formatting
1 parent 5977cab commit 90590ec

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

cuda_core/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import multiprocessing
5-
import pathlib
6-
import sys
75

86
import helpers
97
import pytest
@@ -90,6 +88,7 @@ def ipc_device():
9088

9189
# Skip on WSL or if driver rejects IPC-enabled mempool creation on this platform/device
9290
from cuda_python_test_helpers import IS_WSL, supports_ipc_mempool
91+
9392
if IS_WSL or not supports_ipc_mempool(device):
9493
pytest.skip("Driver rejects IPC-enabled mempool creation on this platform")
9594

cuda_core/tests/memory_ipc/test_errors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
import re
77

88
from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, DeviceMemoryResourceOptions
9-
from cuda_python_test_helpers import supports_ipc_mempool
109
from cuda.core.experimental._utils.cuda_utils import CUDAError
1110

11+
from cuda_python_test_helpers import supports_ipc_mempool
12+
1213
CHILD_TIMEOUT_SEC = 20
1314
NBYTES = 64
1415
POOL_SIZE = 2097152
@@ -21,6 +22,7 @@ class ChildErrorHarness:
2122
def test_main(self, ipc_device, ipc_memory_resource):
2223
if not supports_ipc_mempool(ipc_device):
2324
import pytest
25+
2426
pytest.skip("Driver rejects IPC-enabled mempool creation on this platform")
2527
"""Parent process that checks child errors."""
2628
# Attach fixtures to this object for convenience. These can be accessed

cuda_core/tests/memory_ipc/test_memory_ipc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import multiprocessing as mp
55

66
from cuda.core.experimental import Buffer, DeviceMemoryResource
7-
from cuda_python_test_helpers import supports_ipc_mempool
87
from utility import IPCBufferTestHelper
98

9+
from cuda_python_test_helpers import supports_ipc_mempool
10+
1011
CHILD_TIMEOUT_SEC = 20
1112
NBYTES = 64
1213
NWORKERS = 2
@@ -17,6 +18,7 @@ class TestIpcMempool:
1718
def test_main(self, ipc_device, ipc_memory_resource):
1819
if not supports_ipc_mempool(ipc_device):
1920
import pytest
21+
2022
pytest.skip("Driver rejects IPC-enabled mempool creation on this platform")
2123
"""Test IPC with memory pools."""
2224
# Set up the IPC-enabled memory pool and share it.
@@ -55,6 +57,7 @@ class TestIPCMempoolMultiple:
5557
def test_main(self, ipc_device, ipc_memory_resource):
5658
if not supports_ipc_mempool(ipc_device):
5759
import pytest
60+
5861
pytest.skip("Driver rejects IPC-enabled mempool creation on this platform")
5962
"""Test IPC with memory pools using multiple processes."""
6063
# Construct an IPC-enabled memory resource and share it with two children.
@@ -102,6 +105,7 @@ class TestIPCSharedAllocationHandleAndBufferDescriptors:
102105
def test_main(self, ipc_device, ipc_memory_resource):
103106
if not supports_ipc_mempool(ipc_device):
104107
import pytest
108+
105109
pytest.skip("Driver rejects IPC-enabled mempool creation on this platform")
106110
"""
107111
Demonstrate that a memory pool allocation handle can be reused for IPC

cuda_core/tests/memory_ipc/test_send_buffers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pytest
88
from cuda.core.experimental import DeviceMemoryResource, DeviceMemoryResourceOptions
99
from utility import IPCBufferTestHelper
10+
1011
from cuda_python_test_helpers import supports_ipc_mempool
1112

1213
CHILD_TIMEOUT_SEC = 20

cuda_core/tests/memory_ipc/test_workerpool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99
from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, DeviceMemoryResourceOptions
1010
from utility import IPCBufferTestHelper
11+
1112
from cuda_python_test_helpers import supports_ipc_mempool
1213

1314
CHILD_TIMEOUT_SEC = 20

cuda_python_test_helpers/cuda_python_test_helpers/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
def _detect_wsl() -> bool:
1313
data = ""
14-
with suppress(Exception):
15-
with open("/proc/sys/kernel/osrelease") as f:
16-
data = f.read().lower()
14+
with suppress(Exception), open("/proc/sys/kernel/osrelease") as f:
15+
data = f.read().lower()
1716
if "microsoft" in data or "wsl" in data:
1817
return True
1918
return any(os.environ.get(k) for k in ("WSL_DISTRO_NAME", "WSL_INTEROP"))
@@ -61,5 +60,3 @@ def supports_ipc_mempool(device_id: Union[int, object]) -> bool:
6160
"IS_WSL",
6261
"supports_ipc_mempool",
6362
]
64-
65-

cuda_python_test_helpers/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ packages = ["cuda_python_test_helpers"]
2323

2424
[project.urls]
2525
repository = "https://github.com/NVIDIA/cuda-python"
26-

0 commit comments

Comments
 (0)