Skip to content

Commit fb75182

Browse files
committed
Use device_buffer constructors w/memory resource
Update the C++ constructors to take `device_memory_resource` arguments. This means that this argument is now required (at least based on the constructors defined here) when calling `device_buffer` constructors.
1 parent c690822 commit fb75182

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

python/rmm/_lib/device_buffer.pxd

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ from libcpp.memory cimport unique_ptr
1717

1818
from rmm._cuda.stream cimport Stream
1919
from rmm._lib.cuda_stream_view cimport cuda_stream_view
20-
from rmm._lib.memory_resource cimport DeviceMemoryResource
20+
from rmm._lib.memory_resource cimport (
21+
DeviceMemoryResource,
22+
device_memory_resource,
23+
)
2124

2225

2326
cdef extern from "rmm/device_buffer.hpp" namespace "rmm" nogil:
2427
cdef cppclass device_buffer:
2528
device_buffer()
26-
device_buffer(size_t size, cuda_stream_view stream) except +
29+
device_buffer(size_t size, cuda_stream_view stream,
30+
device_memory_resource* mr) except +
2731
device_buffer(const void* source_data,
28-
size_t size, cuda_stream_view stream) except +
32+
size_t size, cuda_stream_view stream,
33+
device_memory_resource* mr) except +
2934
device_buffer(const device_buffer buf,
30-
cuda_stream_view stream) except +
35+
cuda_stream_view stream,
36+
device_memory_resource* mr) except +
3137
void reserve(size_t new_capacity, cuda_stream_view stream) except +
3238
void resize(size_t new_size, cuda_stream_view stream) except +
3339
void shrink_to_fit(cuda_stream_view stream) except +

0 commit comments

Comments
 (0)