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>
35 lines
676 B
C++
35 lines
676 B
C++
// RUN: %libomptarget-compilexx-generic
|
|
// RUN: %libomptarget-run-generic
|
|
// RUN: %libomptarget-compilexx-generic -DCTOR_KERNEL
|
|
// RUN: %not --crash %libomptarget-run-generic
|
|
// RUN: %libomptarget-compilexx-generic -DCTOR_API
|
|
// RUN: %not --crash %libomptarget-run-generic
|
|
// XFAIL: intelgpu
|
|
|
|
#include <cstdio>
|
|
#include <omp.h>
|
|
|
|
void foo_dev() { __builtin_trap(); }
|
|
|
|
#pragma omp declare variant(foo_dev) match(device = {kind(nohost)})
|
|
void foo() {}
|
|
|
|
struct S {
|
|
S() { foo(); }
|
|
};
|
|
|
|
S s;
|
|
#pragma omp declare target(s)
|
|
|
|
int main() {
|
|
int Dev = omp_get_default_device();
|
|
|
|
#ifdef CTOR_KERNEL
|
|
#pragma omp target
|
|
{}
|
|
#endif
|
|
#ifdef CTOR_API
|
|
omp_get_mapped_ptr(&s, Dev);
|
|
#endif
|
|
}
|