Previously an opt-in flag `-fopenmp-new-driver` was used to enable the new offloading driver. After passing tests for a few months it should be sufficiently mature to flip the switch and make it the default. The new offloading driver is now enabled if there is OpenMP and OpenMP offloading present and the new `-fno-openmp-new-driver` is not present. The new offloading driver has three main benefits over the old method: - Static library support - Device-side LTO - Unified clang driver stages Depends on D122683 Differential Revision: https://reviews.llvm.org/D122831
30 lines
552 B
C
30 lines
552 B
C
// RUN: %libomptarget-compile-generic -DLIBRARY -c -o %t.o
|
|
// RUN: llvm-ar rcs %t.a %t.o
|
|
// RUN: %libomptarget-compile-generic %t.a && %libomptarget-run-generic 2>&1 | %fcheck-generic
|
|
|
|
// REQUIRES: nvptx64-nvidia-cuda-oldDriver
|
|
// REQUIRES: amdgcn-amd-amdhsa-oldDriver
|
|
|
|
#ifdef LIBRARY
|
|
int x = 42;
|
|
#pragma omp declare target(x)
|
|
|
|
int foo() {
|
|
int value;
|
|
#pragma omp target map(from : value)
|
|
value = x;
|
|
return value;
|
|
}
|
|
#else
|
|
#include <stdio.h>
|
|
int foo();
|
|
|
|
int main() {
|
|
int x = foo();
|
|
|
|
// CHECK: PASS
|
|
if (x == 42)
|
|
printf("PASS\n");
|
|
}
|
|
#endif
|