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

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 16:39:58 PST 2016


tra created this revision.
tra added a reviewer: jlebar.
tra added a subscriber: llvm-commits.

Apparently ptxas in CUDA 7.0 and 7.5 has a bug which miscompiles
cvt.rni.s64.f32 instruction so lrint(1.f) and llrint(1.f) return 0 instead of 1.

CUDA 8 and in-driver JIT which comes with it do not have this issue.


https://reviews.llvm.org/D27741

Files:
  External/CUDA/cmath.cu
  External/CUDA/math_h.cu


Index: External/CUDA/math_h.cu
===================================================================
--- External/CUDA/math_h.cu
+++ External/CUDA/math_h.cu
@@ -1201,7 +1201,9 @@
     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 @@
     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()
Index: External/CUDA/cmath.cu
===================================================================
--- External/CUDA/cmath.cu
+++ External/CUDA/cmath.cu
@@ -1220,7 +1220,9 @@
     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 @@
     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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27741.81328.patch
Type: text/x-patch
Size: 1429 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161214/594a0f40/attachment.bin>


More information about the llvm-commits mailing list