replace raise Exception with specific errors (#3874)

This commit is contained in:
chenyu
2024-03-22 12:32:21 -04:00
committed by GitHub
parent 8ef5490ec8
commit 1c51d586ea
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ class PythonProgram:
def c_map(lane, elem): return ((elem%2)+(lane%4)*2, (lane//4)+(elem//2)*8) # (i, j), C, D (4 elements on 32 threads)
ul[i] = wmma_helper(32, 16, 8, 4, 4, a_elem, b_elem, c_map)
else:
raise Exception(f"unimplemented tensor core {arg}")
raise NotImplementedError(f"unimplemented tensor core {arg}")
elif uop is UOps.ALU:
assert all_same([len(x) for x in inp]), f"{[len(x) for x in inp]} doesn't match on {arg}"
assert all_same([dtype] + dtp) or arg in {BinaryOps.CMPEQ, BinaryOps.CMPLT, TernaryOps.WHERE}, f"dtype mismatch on {arg}"