@@ -12,7 +12,7 @@ from cuda.bindings cimport cydriver
1212from cuda.core.experimental._memory._buffer cimport Buffer, MemoryResource
1313from cuda.core.experimental._memory cimport _ipc
1414from cuda.core.experimental._memory._ipc cimport IPCAllocationHandle, IPCData
15- from cuda.core.experimental._stream cimport Stream_accept, Stream
15+ from cuda.core.experimental._stream cimport default_stream, Stream_accept, Stream
1616from cuda.core.experimental._utils.cuda_utils cimport (
1717 check_or_create_options,
1818 HANDLE_RETURN,
@@ -334,7 +334,7 @@ cdef class DeviceMemoryResource(MemoryResource):
334334 """
335335 if self.is_mapped:
336336 raise TypeError("Cannot allocate from a mapped IPC-enabled memory resource")
337- stream = Stream_accept(stream, allow_default = True )
337+ stream = Stream_accept(stream) if stream is not None else default_stream( )
338338 return DMR_allocate(self , size , <Stream> stream )
339339
340340 def deallocate(self , ptr: DevicePointerT , size_t size , stream: Stream | GraphBuilder | None = None ):
@@ -351,7 +351,7 @@ cdef class DeviceMemoryResource(MemoryResource):
351351 If the buffer is deallocated without an explicit stream, the allocation stream
352352 is used.
353353 """
354- stream = Stream_accept(stream, allow_default = True )
354+ stream = Stream_accept(stream) if stream is not None else default_stream( )
355355 DMR_deallocate(self , < uintptr_t> ptr, size, < Stream> stream)
356356
357357 @property
0 commit comments