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:
authorRudy Bunel <bunel.rudy@gmail.com>2017-05-12 03:39:56 +0300
committerSoumith Chintala <soumith@gmail.com>2017-05-15 20:18:20 +0300
commit92e9c08ca008bd5c2246ac028d6174f42429874d (patch)
tree0ddf80bc31585da8dea6a32526eb0a051f446261
parent951070d355b2c1d3f285973dc27d8c0ec53c167a (diff)
Cuda reduce in a consistent direction
-rw-r--r--lib/THC/THCTensorMathReduce.cuh6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/THC/THCTensorMathReduce.cuh b/lib/THC/THCTensorMathReduce.cuh
index 026e2c6..5051fbe 100644
--- a/lib/THC/THCTensorMathReduce.cuh
+++ b/lib/THC/THCTensorMathReduce.cuh
@@ -469,8 +469,8 @@ kernelTransformReduceOuterDimIndex(K *tgt1,
for (unsigned col = 0; col < row_size; ++col) {
// +1 for Lua index
- acc = binary_op(thrust::make_pair<K, Index>(*src, col + TH_INDEX_BASE),
- acc);
+ acc = binary_op(acc,
+ thrust::make_pair<K, Index>(*src, col + TH_INDEX_BASE));
src += num_irows;
}
@@ -550,7 +550,7 @@ kernelTransformReduceInnermostDimIndex(K *tgt1,
K *src = src_ + row * row_size;
// Sequential reduction within a thread.
for (unsigned col = threadIdx.x; col < row_size; col += blockDim.x) {
- acc = binary_op(thrust::make_pair<K, Index>(src[col], col + TH_INDEX_BASE), acc);
+ acc = binary_op(acc, thrust::make_pair<K, Index>(src[col], col + TH_INDEX_BASE));
}
}