[llvm] [Offload] Add Error Codes to PluginInterface (PR #138258)

Callum Fare via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 05:47:27 PDT 2025


callumfare wrote:

> [RossBrunton at 2b4bcd3](https://github.com/RossBrunton/llvm-project/commit/2b4bcd35e442de2655627097b71337e2be6977bf) Example of how this new error reporting works in practice (figured It'd be best to split it into a new commit).

Overall LGTM to me but one thing I don't like about this proposed use is that the plugin-specific error categories make it hard for runtimes and other users to handle errors from the library in a generic way. Especially `OL_ERRC_CUDA_NATIVE_UNKNOWN_ERROR` and `OL_ERRC_HSA_NATIVE_UNKNOWN_ERROR` - why not just have the plugins return the generic UNKNOWN_ERROR code? In SYCL these codes can end up propagated up to a `sycl::exception`. Having to special case for CUDA, HSA specific errors defeats the point a bit. The detail strings still contain backend-specific information which I think is fine.

https://github.com/llvm/llvm-project/pull/138258


More information about the llvm-commits mailing list