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:
authorSoumith Chintala <soumith@gmail.com>2016-10-17 18:54:11 +0300
committerGitHub <noreply@github.com>2016-10-17 18:54:11 +0300
commita86ced3600037db3e3b94c92e5091b0a36d67064 (patch)
tree73b9b22fc8e81291469019455b9889a5adf38336
parent9d35ccb9c3690f6b98acdaaec73b142da47f6665 (diff)
parentc848e7d07913c7f5981f7fceae85f3bb89b3141b (diff)
Merge pull request #555 from colesbury/streams
Fix cutorch.getStream()
-rw-r--r--lib/THC/THCGeneral.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/THC/THCGeneral.c b/lib/THC/THCGeneral.c
index 1d4622b..2d478de 100644
--- a/lib/THC/THCGeneral.c
+++ b/lib/THC/THCGeneral.c
@@ -559,7 +559,7 @@ int THCState_getCurrentStreamIndex(THCState *state)
int device;
THCudaCheck(cudaGetDevice(&device));
THCCudaResourcesPerDevice* res = THCState_getDeviceResourcePtr(state, device);
- for (int i = 0; i < state->numUserStreams; ++i) {
+ for (int i = 0; i <= state->numUserStreams; ++i) {
if (res->streams[i] == stream) {
return i;
}