[test-suite] r289687 - [test-suite, CUDA] disable [l]lrint(1.f) checks on CUDA 7.0, 7.5

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 10:55:41 PST 2016


Author: tra
Date: Wed Dec 14 12:55:41 2016
New Revision: 289687

URL: http://llvm.org/viewvc/llvm-project?rev=289687&view=rev
Log:
[test-suite,CUDA] disable [l]lrint(1.f) checks on CUDA 7.0,7.5

Apparently ptxas in CUDA 7.0 and 7.5 has a bug which miscompiles
cvt.rni.s64.f32 instruction so lrint(1.f) returns 0 instead of 1.
CUDA 8 and in-driver JIT which comes with it do not have this issue.

Differential Revision: https://reviews.llvm.org/D27741

Modified:
    test-suite/trunk/External/CUDA/cmath.cu
    test-suite/trunk/External/CUDA/math_h.cu

Modified: test-suite/trunk/External/CUDA/cmath.cu
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/CUDA/cmath.cu?rev=289687&r1=289686&r2=289687&view=diff
==============================================================================
--- test-suite/trunk/External/CUDA/cmath.cu (original)
+++ test-suite/trunk/External/CUDA/cmath.cu Wed Dec 14 12:55:41 2016
@@ -1220,7 +1220,9 @@ __device__ void test_llrint()
     static_assert((std::is_same<decltype(llrint(Ambiguous())), Ambiguous>::value), "");
     assert(std::llrint(1) == 1LL);
     assert(std::llrint(1.) == 1LL);
+#if CUDA_VERSION > 7050
     assert(std::llrint(1.f) == 1LL);
+#endif
 }
 
 __device__ void test_llround()
@@ -1319,7 +1321,9 @@ __device__ void test_lrint()
     static_assert((std::is_same<decltype(lrint(Ambiguous())), Ambiguous>::value), "");
     assert(std::lrint(1) == 1L);
     assert(std::lrint(1.) == 1L);
+#if CUDA_VERSION > 7050
     assert(std::lrint(1.f) == 1L);
+#endif
 }
 
 __device__ void test_lround()

Modified: test-suite/trunk/External/CUDA/math_h.cu
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/CUDA/math_h.cu?rev=289687&r1=289686&r2=289687&view=diff
==============================================================================
--- test-suite/trunk/External/CUDA/math_h.cu (original)
+++ test-suite/trunk/External/CUDA/math_h.cu Wed Dec 14 12:55:41 2016
@@ -1201,7 +1201,9 @@ __device__ void test_llrint()
     static_assert((std::is_same<decltype(llrint(Ambiguous())), Ambiguous>::value), "");
     assert(llrint(1) == 1LL);
     assert(llrint(1.) == 1LL);
+#if CUDA_VERSION > 7050
     assert(llrint(1.f) == 1LL);
+#endif
 }
 
 __device__ void test_llround()
@@ -1296,7 +1298,9 @@ __device__ void test_lrint()
     static_assert((std::is_same<decltype(lrint(Ambiguous())), Ambiguous>::value), "");
     assert(lrint(1) == 1L);
     assert(lrint(1.) == 1L);
+#if CUDA_VERSION > 7050
     assert(lrint(1.f) == 1L);
+#endif
 }
 
 __device__ void test_lround()




More information about the llvm-commits mailing list