[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 24 10:52:07 PDT 2025


================
@@ -1,8 +1,16 @@
 set(LLVM_LINK_COMPONENTS Support)
 
-add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp AMDGPUArchByHIP.cpp)
+add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp
+               AMDGPUArchByHIP.cpp LevelZeroArch.cpp)
+
+find_path(OFFLOAD_ARCH_LEVEL_ZERO_INCLUDE_DIR NAMES level_zero/ze_api.h)
+if (OFFLOAD_ARCH_LEVEL_ZERO_INCLUDE_DIR)
+  target_include_directories(offload-arch PRIVATE ${OFFLOAD_ARCH_LEVEL_ZERO_INCLUDE_DIR})
+  target_compile_definitions(offload-arch PRIVATE HAVE_LEVEL_ZERO_HEADERS)
+endif()
----------------
jhuber6 wrote:

Only dynamic linking is allowed, write a stand-in header like the other targets.

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


More information about the cfe-commits mailing list