Sometimes you want to write a kernel but have part of it be a To Do and not yet implemented, or have an out of bound error, etc.
@kernel
def test():
raise NotImplementedError("To Do")
@kernel
def if_else(x: int):
if x == 0:
...# Do one thing
elif x == 1:
...# Do another thing
else:
raise ValueError("Invalid input")
However, we do not allow lowering of Raise in kirin; the code here will raise an error similar to BuildError: Cannot lower Raise node: <ast.Raise object at 0x11a181f90>. Repeating #211.
Sometimes you want to write a kernel but have part of it be a To Do and not yet implemented, or have an out of bound error, etc.
However, we do not allow lowering of
Raisein kirin; the code here will raise an error similar toBuildError: Cannot lower Raise node: <ast.Raise object at 0x11a181f90>. Repeating #211.