mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-29 09:23:12 +03:00
Make cuda streams non-blocking by default
This commit is contained in:
parent
ca0759b325
commit
b2e8f37965
|
@ -317,13 +317,13 @@ def is_in_jupyter():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def get_cuda_stream(require=False):
|
def get_cuda_stream(require=False, non_blocking=True):
|
||||||
if CudaStream is None:
|
if CudaStream is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(Model.ops, NumpyOps):
|
elif isinstance(Model.ops, NumpyOps):
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return CudaStream()
|
return CudaStream(non_blocking=non_blocking)
|
||||||
|
|
||||||
|
|
||||||
def get_async(stream, numpy_array):
|
def get_async(stream, numpy_array):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user