This revision was automatically updated to reflect the committed changes. Closed by commit rL336025: [CUDA] Make min/max shims host+device. (authored by jlebar, committed by ). Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D48036?vs=150790&id=153593#toc Repository: rL LLVM https://reviews.llvm.org/D48036 Files: cfe/trunk/lib/Headers/cuda_wrappers/algorithm Index: cfe/trunk/lib/Headers/cuda_wrappers/algorithm =================================================================== --- cfe/trunk/lib/Headers/cuda_wrappers/algorithm +++ cfe/trunk/lib/Headers/cuda_wrappers/algorithm @@ -69,28 +69,28 @@ template <class __T, class __Cmp> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & max(const __T &__a, const __T &__b, __Cmp __cmp) { return __cmp(__a, __b) ? __b : __a; } template <class __T> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & max(const __T &__a, const __T &__b) { return __a < __b ? __b : __a; } template <class __T, class __Cmp> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & min(const __T &__a, const __T &__b, __Cmp __cmp) { return __cmp(__b, __a) ? __b : __a; } template <class __T> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & min(const __T &__a, const __T &__b) { return __a < __b ? __a : __b; }
Index: cfe/trunk/lib/Headers/cuda_wrappers/algorithm =================================================================== --- cfe/trunk/lib/Headers/cuda_wrappers/algorithm +++ cfe/trunk/lib/Headers/cuda_wrappers/algorithm @@ -69,28 +69,28 @@ template <class __T, class __Cmp> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & max(const __T &__a, const __T &__b, __Cmp __cmp) { return __cmp(__a, __b) ? __b : __a; } template <class __T> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & max(const __T &__a, const __T &__b) { return __a < __b ? __b : __a; } template <class __T, class __Cmp> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & min(const __T &__a, const __T &__b, __Cmp __cmp) { return __cmp(__b, __a) ? __b : __a; } template <class __T> __attribute__((enable_if(true, ""))) -inline __device__ const __T & +inline __host__ __device__ const __T & min(const __T &__a, const __T &__b) { return __a < __b ? __a : __b; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits