openmp-target.cu 766 B

1234567891011121314151617181920
  1. // REQUIRES: x86-registered-target
  2. // REQUIRES: nvptx-registered-target
  3. // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm \
  4. // RUN: -fopenmp -fopenmp-version=50 -o - %s | FileCheck %s
  5. // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm \
  6. // RUN: -fopenmp -fopenmp-version=50 -o - -x c++ %s | FileCheck %s
  7. // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device \
  8. // RUN: -emit-llvm -o - %s | FileCheck -check-prefixes=DEV %s
  9. // CHECK: declare{{.*}}@_Z7nohost1v()
  10. // DEV-NOT: _Z7nohost1v
  11. void nohost1() {}
  12. #pragma omp declare target to(nohost1) device_type(nohost)
  13. // CHECK: declare{{.*}}@_Z7nohost2v()
  14. // DEV-NOT: _Z7nohost2v
  15. void nohost2() {nohost1();}
  16. #pragma omp declare target to(nohost2) device_type(nohost)