[llvm] [offload] add translation of plugin-specific error codes to Offload API ECs (PR #207208)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 02:28:21 PDT 2026
Jan =?utf-8?q?Trusiłło?= <113amper at gmail.com>,
Jan =?utf-8?q?Trusiłło?= <113amper at gmail.com>,
Jan =?utf-8?q?Trusiłło?= <113amper at gmail.com>,
Jan =?utf-8?q?Trusiłło?= <113amper at gmail.com>,
Jan =?utf-8?q?Trusiłło?= <113amper at gmail.com>,
Jan =?utf-8?q?Trusiłło?= <jan.trusillo at intel.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/207208 at github.com>
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h,hpp -- offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h offload/plugins-nextgen/amdgpu/src/rtl.cpp offload/plugins-nextgen/common/src/PluginInterface.cpp offload/plugins-nextgen/cuda/dynamic_cuda/cuda.h offload/plugins-nextgen/cuda/src/rtl.cpp offload/plugins-nextgen/level_zero/include/L0Trace.h offload/plugins-nextgen/level_zero/src/L0Program.cpp offload/unittests/OffloadAPI/common/Environment.cpp offload/unittests/OffloadAPI/common/Environment.hpp offload/unittests/OffloadAPI/program/olCreateProgram.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/offload/plugins-nextgen/level_zero/src/L0Program.cpp b/offload/plugins-nextgen/level_zero/src/L0Program.cpp
index 8df8eb9f7..ea1c2792e 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Program.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Program.cpp
@@ -96,7 +96,7 @@ Error L0ProgramBuilderTy::addModule(size_t Size, const uint8_t *Image,
// means the image itself could not be loaded for this device (e.g. a
// truncated or malformed binary) rather than a generic JIT failure of an
// otherwise valid program. Report it as INVALID_BINARY in that case (as
- // opposed to the default mapping of ZE_RESULT_ERROR_MODULE_BUILD_FAILURE
+ // opposed to the default mapping of ZE_RESULT_ERROR_MODULE_BUILD_FAILURE
// to ErrorCode::COMPILE_FAILURE).
const auto ErrCode = RC == ZE_RESULT_ERROR_MODULE_BUILD_FAILURE
? ErrorCode::INVALID_BINARY
diff --git a/offload/unittests/OffloadAPI/program/olCreateProgram.cpp b/offload/unittests/OffloadAPI/program/olCreateProgram.cpp
index 5e81c9368..4f661cf4b 100644
--- a/offload/unittests/OffloadAPI/program/olCreateProgram.cpp
+++ b/offload/unittests/OffloadAPI/program/olCreateProgram.cpp
@@ -69,9 +69,9 @@ TEST_P(olCreateProgramTest, ZeroSizeBinary) {
ol_program_handle_t Program = nullptr;
- ASSERT_ERROR(OL_ERRC_INVALID_BINARY,
- olCreateProgram(Device, DeviceBin->getBufferStart(), 0,
- &Program));
+ ASSERT_ERROR(
+ OL_ERRC_INVALID_BINARY,
+ olCreateProgram(Device, DeviceBin->getBufferStart(), 0, &Program));
ASSERT_EQ(Program, nullptr);
}
@@ -80,8 +80,8 @@ TEST_P(olCreateProgramTest, InvalidBinary) {
ol_program_handle_t Program = nullptr;
ASSERT_ERROR(OL_ERRC_INVALID_BINARY,
- olCreateProgram(Device, InvalidBinary,
- sizeof(InvalidBinary) - 1, &Program));
+ olCreateProgram(Device, InvalidBinary, sizeof(InvalidBinary) - 1,
+ &Program));
ASSERT_EQ(Program, nullptr);
}
@@ -101,9 +101,9 @@ TEST_P(olCreateProgramTest, WrongArchitecture) {
// Pick a backend different from the device's own, so the loaded binary is
// valid but built for the wrong architecture.
ol_platform_backend_t Backend = getPlatformBackend();
- ol_platform_backend_t ForeignBackend =
- Backend == OL_PLATFORM_BACKEND_CUDA ? OL_PLATFORM_BACKEND_AMDGPU
- : OL_PLATFORM_BACKEND_CUDA;
+ ol_platform_backend_t ForeignBackend = Backend == OL_PLATFORM_BACKEND_CUDA
+ ? OL_PLATFORM_BACKEND_AMDGPU
+ : OL_PLATFORM_BACKEND_CUDA;
std::unique_ptr<llvm::MemoryBuffer> ForeignBin;
if (!TestEnvironment::loadDeviceBinary("foo", Device, ForeignBin,
``````````
</details>
https://github.com/llvm/llvm-project/pull/207208
More information about the llvm-commits
mailing list