numba-dpex icon indicating copy to clipboard operation
numba-dpex copied to clipboard

Make python statements available in the kernel

Open 1e-to opened this issue 4 years ago • 2 comments

The kernel function currently silently ignores Python exceptions and assertions.

  • [ ] The raise statement
  • [ ] The assert statement

It is the correct behavior as a kernel cannot have exception and assertion errors raised during execution. Thus, a proper user experience will be to raise an exception during lowering of a kernel if the kernel has either a raise or an assert.

1e-to avatar Jan 19 '21 11:01 1e-to

To implement the feature the DpexCallConv used by the DpexKernelTarget should override we have to override return_user_exc to raise errors at compile-time.

diptorupd avatar Dec 12 '23 18:12 diptorupd

~Solved by #1244~

Looks like we need to silently ignore the assert and raise statements in kernel. Overloading return_user_exc will cause to fail different python expressions inside kernel, like range and %, because the numba lowering mechanism of these expressions throw exceptions in different places.

chudur-budur avatar Dec 19 '23 01:12 chudur-budur