Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cutorch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorngimel <ngimelshein@nvidia.com>2017-07-03 07:35:39 +0300
committerSoumith Chintala <soumith@gmail.com>2017-07-03 07:35:39 +0300
commit0e5ccc371397156a88201b59bf079894f49853d6 (patch)
tree589533d093e202f7ed5201cc0ab30313d1c3e5c7
parent35d484c6ff992c62ba5942d6ad0ca5d697dd727a (diff)
Make reduction functors accept only constant arguments (#753)
(similar to MaxValuePair and MinValuePair above).
-rw-r--r--lib/THC/THCTensorMathReduce.cuh4
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);
}
};