[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 24 10:41:33 PDT 2025
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 -- clang/tools/offload-arch/LevelZeroArch.cpp clang/tools/offload-arch/OffloadArch.cpp
``````````
: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/clang/tools/offload-arch/LevelZeroArch.cpp b/clang/tools/offload-arch/LevelZeroArch.cpp
index 8b6b393f6..730796fa2 100644
--- a/clang/tools/offload-arch/LevelZeroArch.cpp
+++ b/clang/tools/offload-arch/LevelZeroArch.cpp
@@ -13,9 +13,7 @@
#ifndef HAVE_LEVEL_ZERO_HEADERS
-int printGPUsByLevelZero() {
- return 0;
-}
+int printGPUsByLevelZero() { return 0; }
#else
@@ -25,8 +23,8 @@ int printGPUsByLevelZero() {
#include "llvm/Support/Error.h"
#include <cstdint>
#include <cstdio>
-#include <memory>
#include <level_zero/ze_api.h>
+#include <memory>
using namespace llvm;
extern cl::opt<bool> Verbose;
@@ -73,8 +71,8 @@ static bool loadLevelZero() {
void *P = DynlibHandle->getAddressOfSymbol(entry.name);
if (P == nullptr) {
if (Verbose)
- llvm::errs() << "Unable to find '" << entry.name << "' in '" << L0Library
- << "'!\n";
+ llvm::errs() << "Unable to find '" << entry.name << "' in '"
+ << L0Library << "'!\n";
return false;
}
*(entry.fptr) = P;
``````````
</details>
https://github.com/llvm/llvm-project/pull/160570
More information about the cfe-commits
mailing list