[llvm] [OFFLOAD] Improve handling of synchronization errors in L0 plugin and reenable tests (PR #186927)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 17:51:22 PDT 2026


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 c,cpp,h -- offload/plugins-nextgen/level_zero/include/L0Device.h offload/plugins-nextgen/level_zero/src/L0Device.cpp offload/plugins-nextgen/level_zero/src/L0Memory.cpp offload/test/api/assert.c offload/test/api/omp_device_managed_memory_alloc.c offload/test/api/omp_host_call.c offload/test/api/omp_indirect_func_array.c offload/test/api/omp_indirect_func_basic.c offload/test/api/omp_indirect_func_struct.c offload/test/api/omp_virtual_func.cpp offload/test/api/omp_virtual_func_multiple_inheritance_01.cpp offload/test/api/omp_virtual_func_multiple_inheritance_02.cpp offload/test/api/omp_virtual_func_reference.cpp offload/test/libc/malloc_parallel.c offload/test/mapping/lambda_by_value.cpp offload/test/mapping/reduction_implicit_map.cpp offload/test/mapping/use_device_addr/target_use_device_addr.c offload/test/offloading/assert.cpp offload/test/offloading/back2back_distribute.c offload/test/offloading/bug49334.cpp offload/test/offloading/bug51982.c offload/test/offloading/bug74582.c offload/test/offloading/ctor_dtor_api.cpp offload/test/offloading/ctor_dtor_lazy.cpp offload/test/offloading/dyn_groupprivate.cpp offload/test/offloading/dynamic_module.c offload/test/offloading/high_trip_count_block_limit.cpp offload/test/offloading/malloc.c offload/test/offloading/multiple_reductions_simple.c offload/test/offloading/ompx_coords.c offload/test/offloading/ompx_saxpy_mixed.c offload/test/offloading/parallel_target_teams_reduction.cpp offload/test/offloading/parallel_target_teams_reduction_max.cpp offload/test/offloading/parallel_target_teams_reduction_min.cpp offload/test/offloading/spmdization.c offload/test/offloading/target_constexpr_mapping.cpp offload/test/offloading/wtime.c offload/test/sanitizer/double_free_racy.c offload/test/sanitizer/ptr_outside_alloc_1.c offload/test/sanitizer/ptr_outside_alloc_2.c --diff_from_common_commit
``````````

: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/offload/plugins-nextgen/level_zero/include/L0Device.h b/offload/plugins-nextgen/level_zero/include/L0Device.h
index 448e3b1f1..ab80cd505 100644
--- a/offload/plugins-nextgen/level_zero/include/L0Device.h
+++ b/offload/plugins-nextgen/level_zero/include/L0Device.h
@@ -651,16 +651,18 @@ public:
                                          interop_spec_t *Prefers) override;
 };
 
-struct L0DeviceQueueGuard{
-  L0DeviceQueueGuard(AsyncQueueTy *Queue, L0DeviceTy *Device) : queue(Queue), device(Device) {}
-  ~L0DeviceQueueGuard(){
+struct L0DeviceQueueGuard {
+  L0DeviceQueueGuard(AsyncQueueTy *Queue, L0DeviceTy *Device)
+      : queue(Queue), device(Device) {}
+  ~L0DeviceQueueGuard() {
     for (auto &Event : queue->WaitEvents)
       auto Err = device->releaseEvent(Event);
     queue->WaitEvents.clear();
   }
-  private:
-    AsyncQueueTy *queue;
-    L0DeviceTy *device;
+
+private:
+  AsyncQueueTy *queue;
+  L0DeviceTy *device;
 };
 
 } // namespace llvm::omp::target::plugin
diff --git a/offload/test/api/assert.c b/offload/test/api/assert.c
index 13ab70a86..9a9e770f1 100644
--- a/offload/test/api/assert.c
+++ b/offload/test/api/assert.c
@@ -1,7 +1,6 @@
 // RUN: %libomptarget-compile-run-and-check-generic
 // RUN: %libomptarget-compileopt-run-and-check-generic
 
-
 #include <assert.h>
 #include <stdio.h>
 
diff --git a/offload/test/offloading/bug74582.c b/offload/test/offloading/bug74582.c
index e0f81f49d..c6a283bb9 100644
--- a/offload/test/offloading/bug74582.c
+++ b/offload/test/offloading/bug74582.c
@@ -1,7 +1,6 @@
 // RUN: %libomptarget-compile-generic && %libomptarget-run-generic
 // RUN: %libomptarget-compileopt-generic && %libomptarget-run-generic
 
-
 // Verify we do not read bits in the image that are not there (nobits section).
 
 #pragma omp begin declare target
diff --git a/offload/test/sanitizer/double_free_racy.c b/offload/test/sanitizer/double_free_racy.c
index cd0af052f..76fdca9ed 100644
--- a/offload/test/sanitizer/double_free_racy.c
+++ b/offload/test/sanitizer/double_free_racy.c
@@ -9,7 +9,6 @@
 // UNSUPPORTED: x86_64-unknown-linux-gnu
 // UNSUPPORTED: s390x-ibm-linux-gnu
 
-
 #include <omp.h>
 
 int main(void) {

``````````

</details>


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


More information about the llvm-commits mailing list