From 91f6f07bb88fd39be8b5e0fd2fdf12903316c662 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Mon, 23 May 2016 20:19:56 +0000 Subject: [CUDA] Add -fcuda-approx-transcendentals flag. Summary: This lets us emit e.g. sin.approx.f32. See http://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sin Reviewers: rnk Subscribers: tra, cfe-commits Differential Revision: http://reviews.llvm.org/D20493 llvm-svn: 270484 --- clang/test/Preprocessor/cuda-approx-transcendentals.cu | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 clang/test/Preprocessor/cuda-approx-transcendentals.cu (limited to 'clang/test/Preprocessor') diff --git a/clang/test/Preprocessor/cuda-approx-transcendentals.cu b/clang/test/Preprocessor/cuda-approx-transcendentals.cu new file mode 100644 index 00000000000..8d106ea27a7 --- /dev/null +++ b/clang/test/Preprocessor/cuda-approx-transcendentals.cu @@ -0,0 +1,8 @@ +// RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix HOST %s +// RUN: %clang --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-NOFAST %s +// RUN: %clang -fcuda-approx-transcendentals --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s +// RUN: %clang -ffast-math --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s + +// HOST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__ +// DEVICE-NOFAST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__ +// DEVICE-FAST: __CLANG_CUDA_APPROX_TRANSCENDENTALS__ -- cgit v1.2.3