Skip to content

Commit

Permalink
PyThread_set_key_value does not overwrite in python 2.7.x, so delete …
Browse files Browse the repository at this point in the history
…first
  • Loading branch information
sonots committed Oct 23, 2017
1 parent 1c1a34b commit 8163801
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cupy/cuda/stream.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ cpdef _set_current_stream(stream):
if stream is None:
stream = Stream.null
cdef size_t stream_ptr = stream.ptr
pythread.PyThread_delete_key_value(_current_stream_key)
pythread.PyThread_set_key_value(_current_stream_key, <void *>stream_ptr)
_thread_local.current_stream_ref = weakref.ref(stream)

Expand Down

0 comments on commit 8163801

Please sign in to comment.