Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/test_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def run_kernel_and_capture_output(self, kernel_fn, args):
code, result = code_and_output(kernel_fn, args)

# Wait for any device prints to reach the host
if hasattr(result, "device") and result.device.type == "cuda":
torch.cuda.synchronize()
if hasattr(result, "device") and result.device.type == DEVICE.type:
torch.accelerator.synchronize()

# Grab what pytest captured: stdout + stderr
out, err = self._capfd.readouterr()
Expand Down Expand Up @@ -69,8 +69,8 @@ def run_kernel_and_capture_output(self, kernel_fn, args):
code, result = code_and_output(kernel_fn, args)

# Force GPU synchronization to ensure all device prints complete
if hasattr(result, "device") and result.device.type == "cuda":
torch.cuda.synchronize()
if hasattr(result, "device") and result.device.type == DEVICE.type:
torch.accelerator.synchronize()

# Ensure all output is flushed
sys.stdout.flush()
Expand Down
2 changes: 1 addition & 1 deletion test/test_tensor_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def matmul(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
y = torch.randn((64, 64), device=DEVICE, dtype=torch.float16)

code, result = code_and_output(matmul, (x, y))
torch.cuda.synchronize()
torch.accelerator.synchronize()
expected = torch.matmul(x, y)
torch.testing.assert_close(result, expected, atol=1e-2, rtol=1e-2)

Expand Down
Loading