cuda::experimental::device_memory_resource#
-
class device_memory_resource : public cuda::experimental::__memory_resource_base#
Stream ordered memory resource#
device_memory_resourceallocates device memory using cudaMallocFromPoolAsync / cudaFreeAsync for allocation/deallocation. Adevice_memory_resourceis a thin wrapper around a c cudaMemPool_t with the location type set to c cudaMemLocationTypeDevice.Warning
device_memory_resourcedoes 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.Subclassed by cuda::experimental::device_memory_pool
Public Types
-
using default_queries = ::cuda::mr::properties_list<::cuda::mr::device_accessible>#
Public Functions
-
inline explicit device_memory_resource(::cuda::device_ref __device)#
Constructs a device_memory_resource using the default
cudaMemPool_tof a given device.- Throws:
cuda_error – if retrieving the default
cudaMemPool_tfails.
-
device_memory_resource(int) = delete#
-
device_memory_resource(::cuda::std::nullptr_t) = delete#
- inline explicit device_memory_resource(
- ::cudaMemPool_t __pool,
Constructs the device_memory_resource from a
cudaMemPool_t.- Parameters:
__pool – The
cudaMemPool_tused to allocate memory.
- inline friend constexpr void get_property(
- device_memory_resource const&,
- ::cuda::mr::device_accessible,
Enables the
device_accessibleproperty fordevice_memory_resource.
-
using default_queries = ::cuda::mr::properties_list<::cuda::mr::device_accessible>#