1 // REQUIRES: nvptx-registered-target
2 // RUN: %clang_cc1 -internal-isystem %S/Inputs/include -fopenmp -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
3 // RUN: %clang_cc1 -internal-isystem %S/../../lib/Headers/openmp_wrappers -include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include -fopenmp -triple nvptx64-nvidia-cuda -aux-triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
4 // RUN: %clang_cc1 -internal-isystem %S/../../lib/Headers/openmp_wrappers -DCMATH -include __clang_openmp_device_functions.h -internal-isystem %S/Inputs/include -fopenmp -triple nvptx64-nvidia-cuda -aux-triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
12 // 4 calls to sincos(f), all translated to __nv_sincos calls:
14 // CHECK-NOT: _Z.sincos
15 // CHECK: call void @__nv_sincos(double
16 // CHECK-NOT: _Z.sincos
17 // CHECK: call void @__nv_sincosf(float
18 // CHECK-NOT: _Z.sincos
19 // CHECK: call void @__nv_sincos(double
20 // CHECK-NOT: _Z.sincos
21 // CHECK: call void @__nv_sincosf(float
22 // CHECK-NOT: _Z.sincos
24 // single precision wrapper
25 inline void sincos(float x
, float* __restrict__ sin
, float* __restrict__ cos
)
35 #pragma omp target map(from: res_sin, res_cos)
37 sincos(x
, &res_sin
, &res_cos
);
42 int main(int argc
, char **argv
)
46 test_sincos
<double>(0.0);
47 test_sincos
<float>(0.0);