We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75658c1 commit aa84a03Copy full SHA for aa84a03
python/test/unit/language/test_core.py
@@ -6577,7 +6577,7 @@ def _simple_add(
6577
6578
a, b, c = x.shape
6579
grid = (a, b, c)
6580
- with torch.cuda.device(x.device.index):
+ with device == 'cuda' and torch.cuda.device(x.device.index) or torch.xpu.device(x.device.index):
6581
_simple_add[grid](x, x.stride(0), x.stride(1))
6582
6583
assert torch.allclose(x, torch.ones_like(x) * c_dim)
0 commit comments