[llvm] [offload] Align style of level zero plugin with llvm coding standard (PR #211762)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 24 03:07:34 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: blazej-smorawski
<details>
<summary>Changes</summary>
This patch does a small cleanup of level zero plugin. Mainly I changed names of variables to use `CamelCase` whenever they relate to our internal structures - not objects coming directly from level zero API etc., so I left some variables and arguments like `zeDevice`, but only if they are directly related to level zero APIs or structures.
Added a few `auto *` declarations, but again - only when they refer to our internal objects and not to structures from level zero which might be pointers underneath, but we use them as transparent objects.
Also did small cleanup of unused headers, making sure that we include directly what we need rather than use transitive dependencies.
@<!-- -->adurang Please let me know if this patch is okay with you, if you think this will cause more harm then it's worth I'll close it.
---
Patch is 33.44 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/211762.diff
21 Files Affected:
- (modified) offload/plugins-nextgen/level_zero/dynamic_l0/L0DynWrapper.cpp (+3-3)
- (modified) offload/plugins-nextgen/level_zero/include/L0Defs.h (+1-3)
- (modified) offload/plugins-nextgen/level_zero/include/L0Device.h (+16-18)
- (modified) offload/plugins-nextgen/level_zero/include/L0Event.h (+1)
- (modified) offload/plugins-nextgen/level_zero/include/L0Interop.h (+2)
- (modified) offload/plugins-nextgen/level_zero/include/L0Kernel.h (+2-2)
- (modified) offload/plugins-nextgen/level_zero/include/L0Memory.h (+2-2)
- (modified) offload/plugins-nextgen/level_zero/include/L0Options.h (+1)
- (modified) offload/plugins-nextgen/level_zero/include/L0Plugin.h (-1)
- (modified) offload/plugins-nextgen/level_zero/include/L0Program.h (+1-1)
- (modified) offload/plugins-nextgen/level_zero/include/L0Queue.h (-2)
- (modified) offload/plugins-nextgen/level_zero/include/L0Trace.h (+1-2)
- (modified) offload/plugins-nextgen/level_zero/src/L0Context.cpp (+3-3)
- (modified) offload/plugins-nextgen/level_zero/src/L0Device.cpp (+21-22)
- (modified) offload/plugins-nextgen/level_zero/src/L0Event.cpp (-1)
- (modified) offload/plugins-nextgen/level_zero/src/L0Kernel.cpp (+17-18)
- (modified) offload/plugins-nextgen/level_zero/src/L0Memory.cpp (-1)
- (modified) offload/plugins-nextgen/level_zero/src/L0Options.cpp (-2)
- (modified) offload/plugins-nextgen/level_zero/src/L0Plugin.cpp (+5-5)
- (modified) offload/plugins-nextgen/level_zero/src/L0Program.cpp (+16-17)
- (modified) offload/plugins-nextgen/level_zero/src/L0Queue.cpp (+4-5)
``````````diff
diff --git a/offload/plugins-nextgen/level_zero/dynamic_l0/L0DynWrapper.cpp b/offload/plugins-nextgen/level_zero/dynamic_l0/L0DynWrapper.cpp
index 0e19c6373340a..22ba1106f15c8 100644
--- a/offload/plugins-nextgen/level_zero/dynamic_l0/L0DynWrapper.cpp
+++ b/offload/plugins-nextgen/level_zero/dynamic_l0/L0DynWrapper.cpp
@@ -227,7 +227,7 @@ static bool loadLevelZero() {
// use a new Level Zero API routine.
// zeCommandListHostSynchronize was introduced in loader 1.10.0 (API 1.6.0).
constexpr uint32_t MinVersion{ZE_MAKE_VERSION(1, 10)};
- auto emitCheckVersion = [&]() {
+ auto EmitCheckVersion = [&]() {
ODBG(OLDT_Init) << "Level Zero Loader compatible with version "
<< ZE_MAJOR_VERSION(MinVersion) << "."
<< ZE_MINOR_VERSION(MinVersion) << " is required";
@@ -250,7 +250,7 @@ static bool loadLevelZero() {
ErrMsg = "unknown error";
ODBG(OLDT_Init) << "Unable to load library '" << L0Library
<< "': " << ErrMsg << "!";
- emitCheckVersion();
+ EmitCheckVersion();
return false;
}
@@ -264,7 +264,7 @@ static bool loadLevelZero() {
if (!Fallback) {
ODBG(OLDT_Init) << "Symbol '" << Sym << "' not found in '" << L0Library
<< "' and no fallback is available!";
- emitCheckVersion();
+ EmitCheckVersion();
return false;
}
ODBG(OLDT_Init) << "Symbol '" << Sym << "' not found in '" << L0Library
diff --git a/offload/plugins-nextgen/level_zero/include/L0Defs.h b/offload/plugins-nextgen/level_zero/include/L0Defs.h
index b8d7a924a666f..1c616b93b779f 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Defs.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Defs.h
@@ -13,9 +13,7 @@
#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0DEFS_H
#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0DEFS_H
-#include "PluginInterface.h"
-#include "Shared/Requirements.h"
-#include "omptarget.h"
+#include "OffloadError.h"
enum class AllocOptionTy : int32_t {
ALLOC_OPT_NONE = 0,
diff --git a/offload/plugins-nextgen/level_zero/include/L0Device.h b/offload/plugins-nextgen/level_zero/include/L0Device.h
index 4cface60e71a9..3e8129d057095 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Device.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Device.h
@@ -15,8 +15,6 @@
#include "llvm/ADT/SmallVector.h"
-#include "PerThreadTable.h"
-
#include "L0CmdListManager.h"
#include "L0Context.h"
#include "L0Program.h"
@@ -98,7 +96,7 @@ struct DeviceQueueConfigInfoTy {
class L0DeviceTy final : public GenericDeviceTy {
// Level Zero Context for this Device.
- L0ContextTy &l0Context;
+ L0ContextTy &L0Context;
// Level Zero handle for this Device.
ze_device_handle_t zeDevice;
@@ -164,7 +162,7 @@ class L0DeviceTy final : public GenericDeviceTy {
ze_device_handle_t zeDevice, L0ContextTy &DriverInfo,
const std::string_view zeId, int32_t ComputeIndex)
: GenericDeviceTy(Plugin, DeviceId, NumDevices, SPIRVGridValues),
- l0Context(DriverInfo), zeDevice(zeDevice), zeId(zeId),
+ L0Context(DriverInfo), zeDevice(zeDevice), zeId(zeId),
ComputeIndex(ComputeIndex), QueueCache(*this) {
DeviceProperties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES;
DeviceProperties.pNext = nullptr;
@@ -194,8 +192,8 @@ class L0DeviceTy final : public GenericDeviceTy {
return QueueConfig.SupportsCooperativeKernels;
}
- const L0ContextTy &getL0Context() const { return l0Context; }
- L0ContextTy &getL0Context() { return l0Context; }
+ const L0ContextTy &getL0Context() const { return L0Context; }
+ L0ContextTy &getL0Context() { return L0Context; }
const std::string_view getName() const { return DeviceName; }
const char *getNameCStr() const { return DeviceName.c_str(); }
@@ -388,7 +386,7 @@ class L0DeviceTy final : public GenericDeviceTy {
auto CmdListOrErr = createImmCmdList(InOrder);
if (!CmdListOrErr)
return CmdListOrErr.takeError();
- return new L0CmdListManagerTy(*CmdListOrErr, l0Context);
+ return new L0CmdListManagerTy(*CmdListOrErr, L0Context);
}
Error releaseCmdListManager(L0CmdListManagerTy *CmndListMngr) {
@@ -436,38 +434,38 @@ class L0DeviceTy final : public GenericDeviceTy {
/// Driver related functions.
/// Reurn the driver handle for this device.
- ze_driver_handle_t getZeDriver() const { return l0Context.getZeDriver(); }
+ ze_driver_handle_t getZeDriver() const { return L0Context.getZeDriver(); }
/// Return context for this device.
- ze_context_handle_t getZeContext() const { return l0Context.getZeContext(); }
+ ze_context_handle_t getZeContext() const { return L0Context.getZeContext(); }
/// Return driver API version for this device.
ze_api_version_t getDriverAPIVersion() const {
- return l0Context.getDriverAPIVersion();
+ return L0Context.getDriverAPIVersion();
}
/// Get a low-level L0 event from the driver associated to this device.
Expected<ze_event_handle_t> getEvent() {
- return l0Context.getEventPool().getEvent();
+ return L0Context.getEventPool().getEvent();
}
/// Get a high-level L0EventTy object from the driver associated to this
/// device.
Expected<L0EventTy *> getEventObject() {
- return l0Context.getEventPool().getEventObject();
+ return L0Context.getEventPool().getEventObject();
}
/// Release a L0 event to the pool associated to this device.
Error releaseEvent(ze_event_handle_t Event) {
- return l0Context.getEventPool().releaseEvent(Event);
+ return L0Context.getEventPool().releaseEvent(Event);
}
/// Release an L0EventTy object to the pool associated to this device.
Error releaseEventObject(L0EventTy *EventObj) {
- return l0Context.getEventPool().releaseEventObject(EventObj);
+ return L0Context.getEventPool().releaseEventObject(EventObj);
}
- StagingBufferTy &getStagingBuffer() { return l0Context.getStagingBuffer(); }
+ StagingBufferTy &getStagingBuffer() { return L0Context.getStagingBuffer(); }
- bool supportsLargeMem() const { return l0Context.supportsLargeMem(); }
+ bool supportsLargeMem() const { return L0Context.supportsLargeMem(); }
/// Returns the Queue from an async info object, or creates a new one if
/// the async info does not have a queue yet.
@@ -494,13 +492,13 @@ class L0DeviceTy final : public GenericDeviceTy {
MemAllocatorTy &getMemAllocator(int32_t Kind) {
if (Kind == TARGET_ALLOC_HOST)
- return l0Context.getHostMemAllocator();
+ return L0Context.getHostMemAllocator();
return getDeviceMemAllocator();
}
MemAllocatorTy &getMemAllocator(const void *Ptr) {
if (ZE_MEMORY_TYPE_HOST == getMemAllocType(Ptr))
- return l0Context.getHostMemAllocator();
+ return L0Context.getHostMemAllocator();
return getDeviceMemAllocator();
}
diff --git a/offload/plugins-nextgen/level_zero/include/L0Event.h b/offload/plugins-nextgen/level_zero/include/L0Event.h
index 7f4c74e504256..c5a193c6c0b88 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Event.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Event.h
@@ -19,6 +19,7 @@
#include "L0Defs.h"
#include "L0Trace.h"
+#include "PluginInterface.h"
namespace llvm::omp::target::plugin {
diff --git a/offload/plugins-nextgen/level_zero/include/L0Interop.h b/offload/plugins-nextgen/level_zero/include/L0Interop.h
index 20a7fa32ae8d4..52bd1379de51b 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Interop.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Interop.h
@@ -13,6 +13,8 @@
#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0INTEROP_H
#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0INTEROP_H
+#include <level_zero/ze_api.h>
+
namespace llvm::omp::target::plugin::L0Interop {
/// Level Zero interop property.
diff --git a/offload/plugins-nextgen/level_zero/include/L0Kernel.h b/offload/plugins-nextgen/level_zero/include/L0Kernel.h
index d70522a9ab7a9..34d14ceaf6f9f 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Kernel.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Kernel.h
@@ -62,10 +62,10 @@ class L0KernelTy : public GenericKernelTy {
Error buildKernel(L0ProgramTy &Program);
Error readKernelProperties(L0ProgramTy &Program);
- ze_group_size_t createKernelGroups(L0DeviceTy &l0Device, L0LaunchEnvTy &KEnv,
+ ze_group_size_t createKernelGroups(L0DeviceTy &L0Device, L0LaunchEnvTy &KEnv,
uint32_t NumThreads[3],
uint32_t NumBlocks[3]) const;
- Error setIndirectFlags(L0DeviceTy &l0Device, L0LaunchEnvTy &KEnv) const;
+ Error setIndirectFlags(L0DeviceTy &L0Device, L0LaunchEnvTy &KEnv) const;
public:
/// Create a L0 kernel with a name and an execution mode.
diff --git a/offload/plugins-nextgen/level_zero/include/L0Memory.h b/offload/plugins-nextgen/level_zero/include/L0Memory.h
index e666062d005eb..6b80d8b51be34 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Memory.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Memory.h
@@ -15,13 +15,13 @@
#include <cassert>
#include <level_zero/ze_api.h>
-#include <list>
#include <map>
#include <memory>
#include <mutex>
#include "L0Defs.h"
#include "L0Trace.h"
+#include "PluginInterface.h"
namespace llvm::omp::target::plugin {
@@ -457,7 +457,7 @@ class StagingBufferTy {
~StagingBufferTy() = default;
Error clear() {
- for (auto Ptr : Buffers)
+ for (auto* Ptr : Buffers)
CALL_ZE_RET_ERROR(zeMemFree, Context, Ptr);
Context = nullptr;
return Plugin::success();
diff --git a/offload/plugins-nextgen/level_zero/include/L0Options.h b/offload/plugins-nextgen/level_zero/include/L0Options.h
index 9f6bbbd3140f7..a2dd3c8968034 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Options.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Options.h
@@ -15,6 +15,7 @@
#include <level_zero/ze_api.h>
+#include "llvm/Support/Allocator.h"
#include "Shared/EnvironmentVar.h"
#include "L0Defs.h"
diff --git a/offload/plugins-nextgen/level_zero/include/L0Plugin.h b/offload/plugins-nextgen/level_zero/include/L0Plugin.h
index 665da5edb0e59..aeaa35e92c384 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Plugin.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Plugin.h
@@ -13,7 +13,6 @@
#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0PLUGIN_H
#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0PLUGIN_H
-#include "L0Defs.h"
#include "L0Device.h"
#include "L0Memory.h"
#include "L0Options.h"
diff --git a/offload/plugins-nextgen/level_zero/include/L0Program.h b/offload/plugins-nextgen/level_zero/include/L0Program.h
index 037464b31fc17..af2d0a05f7e3b 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Program.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Program.h
@@ -83,7 +83,7 @@ class L0ProgramTy : public DeviceImageTy {
Modules(std::move(Modules)), GlobalModule(GlobalModule) {}
~L0ProgramTy() = default;
- L0ProgramTy(const L0ProgramTy &other) = delete;
+ L0ProgramTy(const L0ProgramTy &Other) = delete;
L0ProgramTy(L0ProgramTy &&) = delete;
L0ProgramTy &operator=(const L0ProgramTy &) = delete;
L0ProgramTy &operator=(const L0ProgramTy &&) = delete;
diff --git a/offload/plugins-nextgen/level_zero/include/L0Queue.h b/offload/plugins-nextgen/level_zero/include/L0Queue.h
index 2957ef558c847..4ef2232c8da06 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Queue.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Queue.h
@@ -13,9 +13,7 @@
#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_ASYNCQUEUE_H
#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_ASYNCQUEUE_H
-#include "L0Defs.h"
#include "L0Event.h"
-#include "L0Trace.h"
#include "PluginInterface.h"
#include <mutex>
diff --git a/offload/plugins-nextgen/level_zero/include/L0Trace.h b/offload/plugins-nextgen/level_zero/include/L0Trace.h
index 6f97b72e4c636..3099100fe9b9d 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Trace.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Trace.h
@@ -15,8 +15,7 @@
#include "OffloadError.h"
#include "Shared/Debug.h"
-#include "omptarget.h"
-#include <string>
+
#include <level_zero/ze_api.h>
using namespace llvm::offload::debug;
diff --git a/offload/plugins-nextgen/level_zero/src/L0Context.cpp b/offload/plugins-nextgen/level_zero/src/L0Context.cpp
index c1556dc5b37f7..57cdc23b02ae7 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Context.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Context.cpp
@@ -16,7 +16,7 @@
namespace llvm::omp::target::plugin {
Error L0ContextTy::init() {
- auto cleanupOnError = [&]() {
+ auto CleanupOnError = [&]() {
if (zeContext) {
zeContextDestroy(zeContext);
zeContext = nullptr;
@@ -41,13 +41,13 @@ Error L0ContextTy::init() {
if (auto Err = EventPool.init(zeContext, UseCounterBasedEvents,
/* Flags */ 0)) {
- cleanupOnError();
+ CleanupOnError();
return Err;
}
if (auto Err = HostMemAllocator.initHostPool(*this, Plugin.getOptions())) {
if (auto DeinitErr = EventPool.deinit())
Err = joinErrors(std::move(Err), std::move(DeinitErr));
- cleanupOnError();
+ CleanupOnError();
return Err;
}
diff --git a/offload/plugins-nextgen/level_zero/src/L0Device.cpp b/offload/plugins-nextgen/level_zero/src/L0Device.cpp
index 5b728e5d1cc7e..076dfa080f86e 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Device.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Device.cpp
@@ -21,7 +21,6 @@
#include "GlobalHandler.h"
#include "OffloadAPI.h"
#include "llvm/ADT/ScopeExit.h"
-#include "llvm/Object/ELF.h"
#include "llvm/Support/Error.h"
namespace llvm::omp::target::plugin {
@@ -29,8 +28,8 @@ namespace llvm::omp::target::plugin {
// clang-format off
/// Mapping from device arch to GPU runtime's device identifiers.
static struct {
- DeviceArchTy arch;
- PCIIdTy ids[10];
+ DeviceArchTy Arch;
+ PCIIdTy Ids[10];
} DeviceArchMap[] = {{DeviceArchTy::DeviceArch_Gen,
{PCIIdTy::SKL,
PCIIdTy::KBL,
@@ -73,13 +72,13 @@ DeviceArchTy L0DeviceTy::computeArch() const {
}
for (int ArchIndex = 0; ArchIndex < DeviceArchMapSize; ArchIndex++) {
- for (int i = 0;; i++) {
- const auto Id = DeviceArchMap[ArchIndex].ids[i];
+ for (int IdIndex = 0;; IdIndex++) {
+ const auto Id = DeviceArchMap[ArchIndex].Ids[IdIndex];
if (Id == PCIIdTy::None)
break;
- auto maskedId = static_cast<PCIIdTy>(PCIDeviceId & 0xFF00);
- if (maskedId == Id)
- return DeviceArchMap[ArchIndex].arch; // Exact match or prefix match.
+ auto MaskedId = static_cast<PCIIdTy>(PCIDeviceId & 0xFF00);
+ if (MaskedId == Id)
+ return DeviceArchMap[ArchIndex].Arch; // Exact match or prefix match.
}
}
@@ -188,10 +187,10 @@ Error L0DeviceTy::initImpl(GenericPluginTy &Plugin) {
IndirectAccessFlags = Flags;
// Get the UUID.
- std::string uid;
- for (int n = 0; n < ZE_MAX_DEVICE_UUID_SIZE; n++)
- uid += std::to_string(DeviceProperties.uuid.id[n]);
- DeviceUuid = std::move(uid);
+ std::string Uid;
+ for (int UidByte = 0; UidByte < ZE_MAX_DEVICE_UUID_SIZE; UidByte++)
+ Uid += std::to_string(DeviceProperties.uuid.id[UidByte]);
+ DeviceUuid = std::move(Uid);
auto QueueGroupInfoOrErr = scanQueueGroups();
if (!QueueGroupInfoOrErr)
@@ -201,7 +200,7 @@ Error L0DeviceTy::initImpl(GenericPluginTy &Plugin) {
if (auto Err = MemAllocator.initDevicePools(*this, Options))
return Err;
- l0Context.getHostMemAllocator().updateMaxAllocSize(*this);
+ L0Context.getHostMemAllocator().updateMaxAllocSize(*this);
reportDeviceInfo();
return Plugin::success();
}
@@ -568,7 +567,7 @@ Expected<GenericKernelTy &> L0DeviceTy::constructKernel(const char *Name) {
}
uint32_t L0DeviceTy::getMemAllocType(const void *Ptr) const {
- ze_memory_allocation_properties_t properties = {
+ ze_memory_allocation_properties_t Properties = {
ZE_STRUCTURE_TYPE_MEMORY_ALLOCATION_PROPERTIES,
nullptr, // Extension.
ZE_MEMORY_TYPE_UNKNOWN, // Type.
@@ -576,14 +575,14 @@ uint32_t L0DeviceTy::getMemAllocType(const void *Ptr) const {
0, // Page size.
};
- ze_result_t rc;
- CALL_ZE(rc, zeMemGetAllocProperties, getZeContext(), Ptr, &properties,
+ ze_result_t Res;
+ CALL_ZE(Res, zeMemGetAllocProperties, getZeContext(), Ptr, &Properties,
nullptr);
- if (rc == ZE_RESULT_ERROR_INVALID_ARGUMENT)
+ if (Res == ZE_RESULT_ERROR_INVALID_ARGUMENT)
return ZE_MEMORY_TYPE_UNKNOWN;
- else
- return properties.type;
+
+ return Properties.type;
}
interop_spec_t L0DeviceTy::selectInteropPreference(int32_t InteropType,
@@ -599,7 +598,7 @@ interop_spec_t L0DeviceTy::selectInteropPreference(int32_t InteropType,
Expected<OmpInteropTy> L0DeviceTy::createInterop(int32_t InteropContext,
interop_spec_t &InteropSpec) {
- auto Ret = new omp_interop_val_t(
+ auto *Ret = new omp_interop_val_t(
DeviceId, static_cast<kmp_interop_type_t>(InteropContext));
Ret->fr_id = tgt_fr_level_zero;
Ret->vendor_id = omp_vendor_intel;
@@ -624,7 +623,7 @@ Expected<OmpInteropTy> L0DeviceTy::createInterop(int32_t InteropContext,
delete Ret;
});
- auto L0 = static_cast<L0Interop::Property *>(Ret->rtl_property);
+ auto *L0 = static_cast<L0Interop::Property *>(Ret->rtl_property);
bool InOrder = InteropSpec.attrs.inorder;
Ret->attrs.inorder = InOrder;
@@ -648,7 +647,7 @@ Error L0DeviceTy::releaseInterop(OmpInteropTy Interop) {
"Invalid/inconsistent OpenMP interop " DPxMOD "\n",
DPxPTR(Interop));
}
- auto L0 = static_cast<L0Interop::Property *>(Interop->rtl_property);
+ auto *L0 = static_cast<L0Interop::Property *>(Interop->rtl_property);
if (Interop->async_info && Interop->async_info->Queue) {
auto ImmCmdList = L0->ImmCmdList;
CALL_ZE_RET_ERROR(zeCommandListDestroy, ImmCmdList);
diff --git a/offload/plugins-nextgen/level_zero/src/L0Event.cpp b/offload/plugins-nextgen/level_zero/src/L0Event.cpp
index a541b852972d5..e6458f63ea9f8 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Event.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Event.cpp
@@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//
#include "L0Event.h"
-#include "L0Device.h"
#include "L0Trace.h"
namespace llvm::omp::target::plugin {
diff --git a/offload/plugins-nextgen/level_zero/src/L0Kernel.cpp b/offload/plugins-nextgen/level_zero/src/L0Kernel.cpp
index 53209c2269bda..2b5d63cc73fb3 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Kernel.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Kernel.cpp
@@ -12,13 +12,12 @@
#include "L0Kernel.h"
#include "L0Device.h"
-#include "L0Plugin.h"
#include "L0Program.h"
namespace llvm::omp::target::plugin {
Error L0KernelTy::readKernelProperties(L0ProgramTy &Program) {
- const auto &l0Device = L0DeviceTy::makeL0Device(Program.getDevice());
+ const auto &L0Device = L0DeviceTy::makeL0Device(Program.getDevice());
auto &KernelPR = getProperties();
ze_kernel_properties_t KP = {};
KP.stype = ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES;
@@ -26,7 +25,7 @@ Error L0KernelTy::readKernelProperties(L0ProgramTy &Program) {
ze_kernel_preferred_group_size_properties_t KPrefGRPSize = {};
KPrefGRPSize.stype = ZE_STRUCTURE_TYPE_KERNEL_PREFERRED_GROUP_SIZE_PROPERTIES;
KPrefGRPSize.pNext = nullptr;
- if (l0Device.getDriverAPIVersion() >= ZE_API_VERSION_1_2)
+ if (L0Device.getDriverAPIVersion() >= ZE_API_VERSION_1_2)
KP.pNext = &KPrefGRPSize;
CALL_ZE_RET_ERROR(zeKernelGetProperties, zeKernel, &KP);
@@ -37,13 +36,13 @@ Error L0KernelTy::readKernelProperties(L0ProgramTy &Program) {
if (KP.pNext)
KernelPR.Width = KPrefGRPSize.preferredMultiple;
- if (!l0Device.isDeviceArch(DeviceArchTy::DeviceArch_Gen)) {
+ if (!L0Device.isDeviceArch(DeviceArchTy::DeviceArch_Gen)) {
KernelPR.Width = (std::max)(KernelPR.Width, 2 * KernelPR.SIMDWidth);
}
KernelPR.MaxThreadGroupSize = KP.maxSubgroupSize * KP.maxNumSubgroups;
// Query and cache argument sizes if extension is available.
...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/211762
More information about the llvm-commits
mailing list