diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-10-17 18:54:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-17 18:54:11 +0300 |
commit | a86ced3600037db3e3b94c92e5091b0a36d67064 (patch) | |
tree | 73b9b22fc8e81291469019455b9889a5adf38336 | |
parent | 9d35ccb9c3690f6b98acdaaec73b142da47f6665 (diff) | |
parent | c848e7d07913c7f5981f7fceae85f3bb89b3141b (diff) |
Merge pull request #555 from colesbury/streams
Fix cutorch.getStream()
-rw-r--r-- | lib/THC/THCGeneral.c | 2 |
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; } |