[llvm] [Offload][L0][NFC] Remove unused zexKernelGetArgumentSize dispatcher (PR #227589)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 00:33:36 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: tfzee (tfzee)

<details>
<summary>Changes</summary>

The KernelGetArgumentSize dispatcher is loaded during context init but never called.
#<!-- -->218367 converted it to a ZeDispatcher but also removed its only callers.
Argument sizes are now either not needed (zeCommandListAppendLaunchKernelWithArguments) or come from LaunchArgs.ArgSizes on the fallback path, so the driver query is no longer used(other than debug printing).

This removes the now dead optional API declaration, the dispatcher member, its loadExperimental call and the related debug output.
Not tested on actual GPU hardware however the plugin builds without error(which I think should be sufficient check).


AI was only used in a review on unrelated changes which noted this dead code.

---
Full diff: https://github.com/llvm/llvm-project/pull/227589.diff


3 Files Affected:

- (modified) offload/plugins-nextgen/level_zero/include/L0Compat.h (-4) 
- (modified) offload/plugins-nextgen/level_zero/include/L0Context.h (-1) 
- (modified) offload/plugins-nextgen/level_zero/src/L0Context.cpp (-8) 


``````````diff
diff --git a/offload/plugins-nextgen/level_zero/include/L0Compat.h b/offload/plugins-nextgen/level_zero/include/L0Compat.h
index c1580991bc5b4..21079d7f7cc84 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Compat.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Compat.h
@@ -25,10 +25,6 @@ API_HELPER_OPTIONAL(ze_result_t, zeCommandListAppendLaunchKernelWithArguments,
                     const void *pNext, ze_event_handle_t hSignalEvent,
                     uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents)
 
-API_HELPER_OPTIONAL(ze_result_t, zexKernelGetArgumentSize,
-                    ze_kernel_handle_t hKernel, uint32_t argIndex,
-                    uint32_t *pArgSize)
-
 API_HELPER_OPTIONAL(ze_result_t, zeCommandListAppendHostFunction,
                     ze_command_list_handle_t hCommandList,
                     void *pfnHostFunction, void *pUserData, void *pReserved,
diff --git a/offload/plugins-nextgen/level_zero/include/L0Context.h b/offload/plugins-nextgen/level_zero/include/L0Context.h
index 6f243cbdb4d13..a7b83d4821b7f 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Context.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Context.h
@@ -219,7 +219,6 @@ class L0ContextTy {
 
   ZeDispatcher<zeCommandListAppendLaunchKernelWithArguments>
       LaunchKernelWithArguments;
-  ZeDispatcher<zexKernelGetArgumentSize> KernelGetArgumentSize;
   ZeDispatcher<zeCommandListAppendHostFunction> CommandListAppendHostFunction;
   ZeDispatcher<zeDriverGetDefaultContext, nullptr> DriverGetDefaultContext;
   ZeDispatcher<zeIntelGetDriverVersionString> IntelGetDriverVersionString;
diff --git a/offload/plugins-nextgen/level_zero/src/L0Context.cpp b/offload/plugins-nextgen/level_zero/src/L0Context.cpp
index 5899611d6c7d5..dae20dd1ec14c 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Context.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Context.cpp
@@ -87,8 +87,6 @@ Error L0ContextTy::init() {
   ODBG(OLDT_Init) << "APIs supported by the context with dlopen: ";
   ODBG(OLDT_Init) << "  zeCommandListAppendLaunchKernelWithArguments: "
                   << (LaunchKernelWithArguments.available() ? "yes" : "no");
-  ODBG(OLDT_Init) << "  zexKernelGetArgumentSize: "
-                  << (KernelGetArgumentSize.available() ? "yes" : "no");
   ODBG(OLDT_Init) << "  zeCommandListAppendHostFunction: "
                   << (CommandListAppendHostFunction.available() ? "yes" : "no");
   ODBG(OLDT_Init) << "  zeDriverGetDefaultContext: "
@@ -98,10 +96,6 @@ Error L0ContextTy::init() {
     LaunchKernelWithArguments.loadExperimental(
         zeDriver, "zeCommandListAppendLaunchKernelWithArguments");
 
-  if (!KernelGetArgumentSize)
-    KernelGetArgumentSize.loadExperimental(zeDriver,
-                                           "zexKernelGetArgumentSize");
-
   if (!CommandListAppendHostFunction)
     CommandListAppendHostFunction.loadExperimental(
         zeDriver, "zeCommandListAppendHostFunction");
@@ -121,8 +115,6 @@ Error L0ContextTy::init() {
   ODBG(OLDT_Init) << "APIs supported by the context with added extensions: ";
   ODBG(OLDT_Init) << "  zeCommandListAppendLaunchKernelWithArguments: "
                   << (LaunchKernelWithArguments.available() ? "yes" : "no");
-  ODBG(OLDT_Init) << "  zexKernelGetArgumentSize: "
-                  << (KernelGetArgumentSize.available() ? "yes" : "no");
   ODBG(OLDT_Init) << "  zeCommandListAppendHostFunction: "
                   << (CommandListAppendHostFunction.available() ? "yes" : "no");
   ODBG(OLDT_Init) << "  zeDriverGetDefaultContext: "

``````````

</details>


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


More information about the llvm-commits mailing list