diff options
author | ngimel <ngimelshein@nvidia.com> | 2017-07-03 07:35:39 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2017-07-03 07:35:39 +0300 |
commit | 0e5ccc371397156a88201b59bf079894f49853d6 (patch) | |
tree | 589533d093e202f7ed5201cc0ab30313d1c3e5c7 | |
parent | 35d484c6ff992c62ba5942d6ad0ca5d697dd727a (diff) |
Make reduction functors accept only constant arguments (#753)
(similar to MaxValuePair and MinValuePair above).
-rw-r--r-- | lib/THC/THCTensorMathReduce.cuh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/THC/THCTensorMathReduce.cuh b/lib/THC/THCTensorMathReduce.cuh index 5051fbe..50d02cd 100644 --- a/lib/THC/THCTensorMathReduce.cuh +++ b/lib/THC/THCTensorMathReduce.cuh @@ -680,14 +680,14 @@ struct MinValuePair { template <typename T> struct AddOp { - __device__ __forceinline__ T operator()(T &lhs, T &rhs) { + __device__ __forceinline__ T operator()(T const &lhs, T const &rhs) { return THCNumerics<T>::add(lhs, rhs); } }; template <typename T> struct MulOp { - __device__ __forceinline__ T operator()(T &lhs, T &rhs) { + __device__ __forceinline__ T operator()(T const &lhs, T const &rhs) { return THCNumerics<T>::mul(lhs, rhs); } }; |