]> granicus.if.org Git - clang/commitdiff
[CUDA] Fix std::min on device side to return the min, not the max.
authorJustin Lebar <jlebar@google.com>
Sat, 11 Nov 2017 01:25:44 +0000 (01:25 +0000)
committerJustin Lebar <jlebar@google.com>
Sat, 11 Nov 2017 01:25:44 +0000 (01:25 +0000)
Summary:
How embarrassing.

This is tested in the test-suite -- fix to come there in a separate
patch.

Reviewers: tra

Subscribers: sanjoy, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317961 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/cuda_wrappers/algorithm

index 95d9beb73c682ddef5a3fcbc29ed55410f50ee25..cedd70762c486c61d6ce5506f4e3b90cab8e5dbf 100644 (file)
@@ -80,7 +80,7 @@ min(const __T &__a, const __T &__b, __Cmp __cmp) {
 template <class __T>
 inline __device__ const __T &
 min(const __T &__a, const __T &__b) {
-  return __a < __b ? __b : __a;
+  return __a < __b ? __a : __b;
 }
 
 #ifdef _LIBCPP_END_NAMESPACE_STD