Files
llvm-project/offload/test/offloading/ctor_dtor_api.cpp
fineg74 2890f9883c [OFFLOAD] Improve handling of synchronization errors in L0 plugin and reenable tests (#186927)
This change improves handling of errors during synchronization in Level
Zero plugin by ensuring cleanup of queues and events in case of an
synchronization error. As a result multiple tests stopped hanging.

---------

Co-authored-by: Duran, Alex <alejandro.duran@intel.com>
2026-03-18 05:50:06 +01:00

26 lines
546 B
C++

// RUN: %libomptarget-compilexx-run-and-check-generic
// RUN: %libomptarget-compileoptxx-run-and-check-generic
// XFAIL: intelgpu
#include <cstdio>
#include <omp.h>
struct S {
S() : i(7) {}
int i;
};
S s;
#pragma omp declare target(s)
int main() {
int r;
int Dev = omp_get_default_device();
void *s_dev = omp_get_mapped_ptr(&s, Dev);
printf("Host %p, Device: %p\n", &s, s_dev);
omp_target_memcpy(&r, s_dev, sizeof(int), 0, offsetof(S, i),
omp_get_initial_device(), Dev);
// CHECK: 7
printf("%i\n", r);
}