Skip to content

Commit e27b25b

Browse files
committed
Format changes.
1 parent e903081 commit e27b25b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cuda_core/cuda/core/experimental/_memory.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,4 +872,3 @@ class _SynchronousMemoryResource(MemoryResource):
872872
@property
873873
def device_id(self) -> int:
874874
return self._dev_id
875-

cuda_core/tests/test_memory.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from cuda import cuda as driver
88

99
import ctypes
10-
1110
import platform
11+
1212
import pytest
1313

1414
from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, MemoryResource
@@ -17,6 +17,7 @@
1717

1818
POOL_SIZE = 2097152 # 2MB size
1919

20+
2021
@pytest.fixture(scope="function")
2122
def mempool_device():
2223
"""Obtains a device suitable for mempool tests, or skips."""
@@ -31,6 +32,7 @@ def mempool_device():
3132

3233
return device
3334

35+
3436
class DummyDeviceMemoryResource(MemoryResource):
3537
def __init__(self, device):
3638
self.device = device
@@ -380,7 +382,7 @@ def test_mempool_attributes(mempool_device, property_name, expected_type):
380382
device = mempool_device
381383
for ipc_enabled in [True, False]:
382384
if platform.system() == "Windows":
383-
continue # IPC not implemented for Windows
385+
continue # IPC not implemented for Windows
384386

385387
mr = DeviceMemoryResource(device, dict(max_size=POOL_SIZE, ipc_enabled=ipc_enabled))
386388
assert mr.is_ipc_enabled == ipc_enabled
@@ -421,6 +423,7 @@ def test_mempool_attributes(mempool_device, property_name, expected_type):
421423
flush_buffer = mr.allocate(64)
422424
flush_buffer.close()
423425

426+
424427
def test_mempool_attributes_ownership(mempool_device):
425428
"""Ensure the attributes bundle handles references correctly."""
426429
device = mempool_device
@@ -432,17 +435,16 @@ def test_mempool_attributes_ownership(mempool_device):
432435

433436
# After deleting the memory resource, the attributes suite is disconnected.
434437
with pytest.raises(RuntimeError, match="DeviceMemoryResource is expired"):
435-
attributes.used_mem_high
438+
_ = attributes.used_mem_high
436439

437440
# Even when a new object is created (we found a case where the same
438441
# mempool handle was really reused).
439442
mr = DeviceMemoryResource(device, dict(max_size=POOL_SIZE))
440443
with pytest.raises(RuntimeError, match="DeviceMemoryResource is expired"):
441-
attributes.used_mem_high
444+
_ = attributes.used_mem_high
442445

443446
# Even if we stuff the original handle into a new class.
444447
mr._mempool_handle, old_handle = old_handle, mr._mempool_handle
445448
with pytest.raises(RuntimeError, match="DeviceMemoryResource is expired"):
446-
attributes.used_mem_high
449+
_ = attributes.used_mem_high
447450
mr._mempool_handle = old_handle
448-

0 commit comments

Comments
 (0)