Files
ROCm/python/test/unit/language/test_annotations.py
Wang Weihan a3c39d8fbe [TEST] Add device parameter for ut (#1817)
Triton has supported different codegen backends for different devices,
so enabling the unit test cases to support different devices also makes
sense. Otherwise, the third-party backend might have to intrusively
change the Triton test cases.
2023-06-25 15:38:59 +08:00

22 lines
399 B
Python

from __future__ import annotations
import torch
import triton
import triton.language as tl
def test_annotations(device):
@triton.jit
def _kernel(X: torch.Tensor, N: int, BLOCK_SIZE: tl.constexpr):
pass
x = torch.empty(1, device=device)
_kernel[(1,)](x, x.shape[0], 32)
try:
_kernel[(1,)](x.shape[0], x.shape[0], 32)
except AttributeError:
pass