cuda::experimental::device_memory_resource
Defined in include/cuda/experimental/__memory_resource/device_memory_resource.cuh
-
class device_memory_resource : public cuda::experimental::__memory_resource_base
Stream ordered memory resource
device_memory_resource
uses cudaMallocFromPoolAsync / cudaFreeAsync for allocation/deallocation. Adevice_memory_resource
is a thin wrapper around a c cudaMemPool_t.Warning
device_memory_resource
does not own the pool and it is the responsibility of the user to ensure that the lifetime of the pool exceeds the lifetime of thedevice_memory_resource
.Public Functions
-
inline device_memory_resource()
Default constructs the device_memory_resource using the default
cudaMemPool_t
of the default device.- Throws
cuda_error – if retrieving the default
cudaMemPool_t
fails.
-
inline explicit device_memory_resource(::cuda::experimental::device_ref __device)
Constructs a device_memory_resource using the default
cudaMemPool_t
of a given device.- Throws
cuda_error – if retrieving the default
cudaMemPool_t
fails.
-
device_memory_resource(int) = delete
-
inline explicit device_memory_resource(::cudaMemPool_t __pool) noexcept
Constructs the device_memory_resource from a
cudaMemPool_t
.- Parameters
__pool – The
cudaMemPool_t
used to allocate memory.
-
inline explicit device_memory_resource(device_memory_pool &__pool) noexcept
Constructs the device_memory_resource from a
device_memory_pool
by calling get().- Parameters
__pool – The
device_memory_pool
used to allocate memory.
-
inline device_memory_resource()