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

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 25 10:01:11 PDT 2025


================
@@ -0,0 +1,180 @@
+//===- LevelZeroArch.cpp - list installed Level Zero devices ---*- C++ -*--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements a tool for detecting Level Zero devices installed in the
+// system
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/DynamicLibrary.h"
+#include "llvm/Support/Error.h"
+#include <cstdio>
+
+#define ZE_MAX_DEVICE_NAME 256
+#define ZE_MAX_DEVICE_UUID_SIZE 16
+
+typedef void *ze_driver_handle_t;
----------------
sarnex wrote:

nit: can we use `using ze_driver_handle_t =` in modern c++ style instead of typedef?

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


More information about the cfe-commits mailing list