[llvm] [Offload] Ensure all `llvm::Error`s are handled (PR #137339)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Thu May 1 07:06:43 PDT 2025
================
@@ -308,9 +308,11 @@ ol_impl_result_t olMemAlloc_impl(ol_device_handle_t Device,
void **AllocationOut) {
auto Alloc =
Device->Device->dataAlloc(Size, nullptr, convertOlToPluginAllocTy(Type));
- if (!Alloc)
+ if (!Alloc) {
+ llvm::consumeError(Alloc.takeError());
return {OL_ERRC_OUT_OF_RESOURCES,
formatv("Could not create allocation on device {0}", Device).str()};
+ }
----------------
jhuber6 wrote:
I think it would be much, much better to have a generic method that converts from an LLVM error to an `offload` error code. We should update all the plugin error values to return some generic error instead of an inconvertable error code. For now, if it's an incovertible error code, just return said generic error.
https://github.com/llvm/llvm-project/pull/137339
More information about the llvm-commits
mailing list