Files
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

29 lines
594 B
C

// RUN: %libomptarget-compileopt-and-run-generic
// UNSUPPORTED: amdgcn-amd-amdhsa
// XFAIL: intelgpu
#include <assert.h>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#define N (1024 * 1024 * 256)
int main(int argc, char *argv[]) {
int *data = (int *)malloc(N * sizeof(int));
double duration = 0.0;
#pragma omp target map(from : data[0 : N]) map(from : duration)
{
double start = omp_get_wtime();
for (int i = 0; i < N; ++i)
data[i] = i;
double end = omp_get_wtime();
duration = end - start;
}
assert(duration > 0.0);
free(data);
return 0;
}