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
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
// clang-format off
|
|
// RUN: %libomptarget-compileopt-generic
|
|
// RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=TRACE
|
|
// RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
|
|
// RUN: %libomptarget-compileopt-generic -g
|
|
// RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=TRACE
|
|
// RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
|
|
// clang-format on
|
|
|
|
// UNSUPPORTED: nvptx64-nvidia-cuda
|
|
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
|
|
// UNSUPPORTED: aarch64-unknown-linux-gnu
|
|
// UNSUPPORTED: x86_64-unknown-linux-gnu
|
|
// UNSUPPORTED: s390x-ibm-linux-gnu
|
|
// https://github.com/llvm/llvm-project/issues/182119
|
|
// UNSUPPORTED: intelgpu
|
|
|
|
#include <omp.h>
|
|
|
|
int main(void) {
|
|
int *A = 0;
|
|
#pragma omp target nowait
|
|
{
|
|
}
|
|
#pragma omp target nowait
|
|
{
|
|
}
|
|
#pragma omp target nowait
|
|
{
|
|
*A = 42;
|
|
}
|
|
#pragma omp taskwait
|
|
}
|
|
|
|
// TRACE: Kernel {{.*}} (__omp_offloading_{{.*}}_main_l[[@LINE-7]])
|
|
// TRACE: launchKernel
|
|
//
|
|
// CHECK: Kernel {{.*}} (__omp_offloading_{{.*}}_main_l[[@LINE-13]])
|