diff options
| author | Ross Brunton <ross@codeplay.com> | 2025-06-24 16:27:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-24 16:27:12 +0100 |
| commit | 4359e55838cd29d4aa344f15543f725da25e940f (patch) | |
| tree | 050011070426347d3c0b53f21e97fbff0a505b28 /offload/plugins-nextgen | |
| parent | b0ef9125347cbaea031273feb72ac0d6bc74ddee (diff) | |
[Offload] Properly report errors when jit compiling (#145498)
Previously, if a binary failed to load due to failures when jit
compiling, the function would return success with nullptr. Now it
returns a new plugin error, `COMPILE_FAILURE`.
Diffstat (limited to 'offload/plugins-nextgen')
| -rw-r--r-- | offload/plugins-nextgen/common/src/PluginInterface.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp index 6fd3405d03af..3e9a62f57095 100644 --- a/offload/plugins-nextgen/common/src/PluginInterface.cpp +++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp @@ -909,8 +909,9 @@ GenericDeviceTy::loadBinary(GenericPluginTy &Plugin, if (!PostJITImageOrErr) { auto Err = PostJITImageOrErr.takeError(); REPORT("Failure to jit IR image %p on device %d: %s\n", InputTgtImage, - DeviceId, toString(std::move(Err)).data()); - return nullptr; + DeviceId, toStringWithoutConsuming(Err).data()); + return Plugin::error(ErrorCode::COMPILE_FAILURE, std::move(Err), + "failure to jit IR image"); } // Load the binary and allocate the image object. Use the next available id |
