Skip to content

Commit 062434a

Browse files
committed
Keep the TensorMap multi-GPU tests on the view-based API.
Replace the last stale `TensorMapDescriptor.from_tiled()` call sites with `StridedMemoryView.as_tensor_map()` so the multi-device CI coverage exercises the constructor path that actually exists on this branch. Made-with: Cursor
1 parent 5c8e9e9 commit 062434a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

cuda_core/tests/test_tensor_map.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,7 @@ def test_replace_address_rejects_tensor_from_other_device(self, dev, skip_if_no_
376376

377377
dev0.set_current()
378378
buf0 = dev0.allocate(1024 * 4)
379-
desc = TensorMapDescriptor.from_tiled(
380-
buf0,
379+
desc = _as_view(buf0).as_tensor_map(
381380
box_dim=(64,),
382381
data_type=TensorMapDataType.FLOAT32,
383382
)
@@ -399,8 +398,7 @@ def test_replace_address_accepts_managed_buffer_on_nonzero_device(self, init_cud
399398
skip_if_managed_memory_unsupported(dev1)
400399

401400
dev1.set_current()
402-
desc = TensorMapDescriptor.from_tiled(
403-
dev1.allocate(1024 * 4),
401+
desc = _as_view(dev1.allocate(1024 * 4)).as_tensor_map(
404402
box_dim=(64,),
405403
data_type=TensorMapDataType.FLOAT32,
406404
)
@@ -427,10 +425,9 @@ def test_from_tiled_rejects_tensor_from_other_device(self, init_cuda):
427425

428426
with pytest.raises(
429427
ValueError,
430-
match=r"TensorMapDescriptor\.from_tiled expects tensor on device 0, got 1",
428+
match=r"TensorMapDescriptor\._from_tiled expects tensor on device 0, got 1",
431429
):
432-
TensorMapDescriptor.from_tiled(
433-
buf1,
430+
_as_view(buf1).as_tensor_map(
434431
box_dim=(64,),
435432
data_type=TensorMapDataType.FLOAT32,
436433
)
@@ -448,8 +445,7 @@ def test_from_tiled_accepts_managed_buffer_on_nonzero_device(self, init_cuda):
448445
mr = create_managed_memory_resource_or_skip(ManagedMemoryResourceOptions(preferred_location=dev1.device_id))
449446
managed_buf = mr.allocate(1024 * 4)
450447

451-
desc = TensorMapDescriptor.from_tiled(
452-
managed_buf,
448+
desc = _as_view(managed_buf).as_tensor_map(
453449
box_dim=(64,),
454450
data_type=TensorMapDataType.FLOAT32,
455451
)

0 commit comments

Comments
 (0)