diff options
author | Justin Lebar <jlebar@google.com> | 2016-05-23 20:19:56 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-05-23 20:19:56 +0000 |
commit | 91f6f07bb88fd39be8b5e0fd2fdf12903316c662 (patch) | |
tree | 4b5dec7b7f5da854be2c0db872c00adb954bfa3a /clang/test/Preprocessor | |
parent | 66a891962b3dd66cff48aa27a613e17a3ecae389 (diff) | |
download | bcm5719-llvm-91f6f07bb88fd39be8b5e0fd2fdf12903316c662.tar.gz bcm5719-llvm-91f6f07bb88fd39be8b5e0fd2fdf12903316c662.zip |
[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
Diffstat (limited to 'clang/test/Preprocessor')
-rw-r--r-- | clang/test/Preprocessor/cuda-approx-transcendentals.cu | 8 |
1 files changed, 8 insertions, 0 deletions
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__ |