Memory resource that uses cudaMalloc/Free for allocation/deallocation. More...
#include <cuda_memory_resource.hpp>
Public Member Functions | |
| cuda_memory_resource (cuda_memory_resource const &)=default | |
| Default copy constructor. | |
| cuda_memory_resource (cuda_memory_resource &&)=default | |
| Default move constructor. | |
| cuda_memory_resource & | operator= (cuda_memory_resource const &)=default |
| Default copy assignment operator. More... | |
| cuda_memory_resource & | operator= (cuda_memory_resource &&)=default |
| Default move assignment operator. More... | |
| void * | allocate ([[maybe_unused]] cuda::stream_ref stream, std::size_t bytes, [[maybe_unused]] std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
Allocates memory of size at least bytes. More... | |
| void | deallocate ([[maybe_unused]] cuda::stream_ref stream, void *ptr, [[maybe_unused]] std::size_t bytes, [[maybe_unused]] std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept |
Deallocate memory pointed to by ptr. More... | |
| void * | allocate_sync (std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
Allocates memory of size at least bytes synchronously. More... | |
| void | deallocate_sync (void *ptr, std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept |
Deallocate memory pointed to by ptr synchronously. More... | |
| bool | operator== (cuda_memory_resource const &) const noexcept |
| Compare this resource to another. More... | |
| bool | operator!= (cuda_memory_resource const &) const noexcept |
| Compare this resource to another. More... | |
Friends | |
| void | get_property (cuda_memory_resource const &, cuda::mr::device_accessible) noexcept |
Enables the cuda::mr::device_accessible property. More... | |
Memory resource that uses cudaMalloc/Free for allocation/deallocation.
|
inline |
Allocates memory of size at least bytes.
The returned pointer will have at minimum 256 byte alignment.
The stream argument is ignored.
| stream | This argument is ignored |
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
|
inline |
Allocates memory of size at least bytes synchronously.
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
|
inlinenoexcept |
Deallocate memory pointed to by ptr.
The stream argument is ignored.
| stream | This argument is ignored |
| ptr | Pointer to be deallocated |
| bytes | The size in bytes of the allocation. This must be equal to the value of bytes that was passed to the allocate call that returned ptr. |
| alignment | The alignment that was passed to the allocate call that returned ptr |
|
inlinenoexcept |
Deallocate memory pointed to by ptr synchronously.
| ptr | Pointer to be deallocated |
| bytes | The size in bytes of the allocation |
| alignment | The alignment that was passed to the allocate call that returned ptr |
|
inlinenoexcept |
Compare this resource to another.
All instances of cuda_memory_resource are equivalent.
|
default |
Default move assignment operator.
|
default |
Default copy assignment operator.
|
inlinenoexcept |
Compare this resource to another.
All instances of cuda_memory_resource are equivalent.
|
friend |
Enables the cuda::mr::device_accessible property.
This property declares that a cuda_memory_resource provides device accessible memory