This change adds implementation for named barriers for SPIRV backend. Since there is no built in API/intrinsics for named barrier in SPIRV, the implementation loosely follows implementation for AMD
32 lines
676 B
C
32 lines
676 B
C
// RUN: %libomptarget-compile-run-and-check-generic
|
|
// RUN: %libomptarget-compileopt-run-and-check-generic
|
|
// https://github.com/llvm/llvm-project/issues/182119
|
|
// UNSUPPORTED: intelgpu
|
|
|
|
#include <omp.h>
|
|
#include <stdio.h>
|
|
|
|
__attribute__((optnone)) void optnone() {}
|
|
|
|
int main() {
|
|
int i = 0;
|
|
#pragma omp target teams num_teams(1) map(tofrom : i)
|
|
{
|
|
optnone();
|
|
#pragma omp parallel
|
|
if (omp_get_thread_num() == 0)
|
|
++i;
|
|
#pragma omp parallel
|
|
if (omp_get_thread_num() == 0)
|
|
++i;
|
|
#pragma omp parallel
|
|
if (omp_get_thread_num() == 0)
|
|
++i;
|
|
#pragma omp parallel
|
|
if (omp_get_thread_num() == 0)
|
|
++i;
|
|
}
|
|
// CHECK: 4
|
|
printf("%i\n", i);
|
|
}
|