Paged memory accessible in both device-side and host-side code by triggering transfers of pages between physical system memory and physical device memory.
More...
|
void | advise_expected_access_by (const_region_t region, device_t &device) |
| Advice the CUDA driver that device is expected to access region .
|
|
void | advise_no_access_expected_by (const_region_t region, device_t &device) |
| Advice the CUDA driver that device is not expected to access region .
|
|
template<typename Allocator = ::std::allocator<cuda::device_t>> |
typename ::std::vector< device_t, Allocator > | expected_accessors (const_region_t region, const Allocator &allocator=Allocator()) |
|
region_t | allocate (const context_t &context, size_t num_bytes, initial_visibility_t initial_visibility=initial_visibility_t::to_all_devices) |
| Allocate a a region of managed memory, accessible with the same address on the host and on CUDA devices. More...
|
|
region_t | allocate (const device_t &device, size_t num_bytes, initial_visibility_t initial_visibility=initial_visibility_t::to_all_devices) |
| Allocate a a region of managed memory, accessible with the same address on the host and on CUDA devices. More...
|
|
region_t | allocate (size_t num_bytes) |
| Allocate a a region of managed memory, accessible with the same address on the host and on all CUDA devices. More...
|
|
void | free (void *managed_ptr) |
| Free a managed memory region (host-side and device-side regions on all devices where it was allocated, all with the same address) which was allocated with allocate.
|
|
void | free (region_t region) |
| Free a managed memory region (host-side and device-side regions on all devices where it was allocated, all with the same address) which was allocated with allocate. More...
|
|
void | prefetch (const_region_t region, const cuda::device_t &destination, const stream_t &stream) |
| Prefetches a region of managed memory to a specific device, so it can later be used there without waiting for I/O from the host or other devices.
|
|
void | prefetch_to_host (const_region_t region, const stream_t &stream) |
| Prefetches a region of managed memory into host memory. More...
|
|
template<typename T > |
unique_span< T > | make_unique_span (const context_t &context, size_t size, initial_visibility_t initial_visibility=initial_visibility_t::to_all_devices) |
| Allocate memory for a consecutive sequence of typed elements in system (host-side) memory. More...
|
|
template<typename T > |
unique_span< T > | make_unique_span (const device_t &device, size_t size, initial_visibility_t initial_visibility=initial_visibility_t::to_all_devices) |
| See device::make_unique_span(const context_t& context, size_t size) More...
|
|
template<typename T > |
unique_span< T > | make_unique_span (size_t size, initial_visibility_t initial_visibility=initial_visibility_t::to_all_devices) |
| See device::make_unique_span(const context_t& context, size_t size) More...
|
|
template<typename Allocator > |
::std::vector< device_t, Allocator > | expected_accessors (const_region_t region, const Allocator &allocator) |
|
unique_region | make_unique_region (const context_t &context, size_t num_bytes, initial_visibility_t initial_visibility) |
| Allocate a region of managed memory, accessible both from CUDA devices and from the CPU. More...
|
|
unique_region | make_unique_region (const device_t &device, size_t num_bytes, initial_visibility_t initial_visibility) |
| Allocate a region of managed memory, accessible both from CUDA devices and from the CPU. More...
|
|
unique_region | make_unique_region (size_t num_bytes, initial_visibility_t initial_visibility) |
|
unique_region | make_unique_region (size_t num_bytes) |
| Allocate a region of managed memory, accessible both from CUDA devices and from the CPU. More...
|
|
Paged memory accessible in both device-side and host-side code by triggering transfers of pages between physical system memory and physical device memory.
This type of memory, also known as unified memory, appears within a unified, all-system address space - and is used with the same address range on the host and on all relevant CUDA devices on a system. It is paged, so that it may exceed the physical size of a CUDA device's global memory. The CUDA driver takes care of "swapping" pages "out" from a device to host memory or "swapping" them back "in", as well as of propagation of changes between devices and host-memory.
- Note
- For more details, see Unified Memory for CUDA Beginners on the Parallel4All blog.
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
- Parameters
-
context | A context of possible single-device-visibility |
- Returns
- An owning RAII/CADRe object for the allocated managed memory region
-
An owning RAII/CADRe object for the allocated managed memory region
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
Allocate a region in device-global memory within the primary context of the current CUDA device.
- Note
- The allocation will be made in the device's primary context - which will be created if it has not yet been.
- Template Parameters
-
T | an array type; not the type of individual elements |
- Parameters
-
num_elements | the number of elements to allocate |
- Returns
- an ::std::unique_ptr pointing to the constructed T array
- Parameters
-
device | The device in the global memory of which to make the allocation |
- Returns
- An owning RAII/CADRe object for the allocated memory region
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
- Returns
- An owning RAII/CADRe object for the allocated memory region
- Parameters
-
context | A context, to set when allocating the memory region, for whatever association effect that may have. |
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
- Parameters
-
context | A context of possible single-device-visibility |
- Returns
- An owning RAII/CADRe object for the allocated managed memory region
-
An owning RAII/CADRe object for the allocated managed memory region
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
Allocate a region in device-global memory within the primary context of the current CUDA device.
- Note
- The allocation will be made in the device's primary context - which will be created if it has not yet been.
- Template Parameters
-
T | an array type; not the type of individual elements |
- Parameters
-
num_elements | the number of elements to allocate |
- Returns
- an ::std::unique_ptr pointing to the constructed T array
- Parameters
-
device | The device in the global memory of which to make the allocation |
- Returns
- An owning RAII/CADRe object for the allocated memory region
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
- Returns
- An owning RAII/CADRe object for the allocated memory region
- Parameters
-
device | A context, whose primary context will be current when allocating the memory region, for whatever association effect that may have. |
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
- Returns
- An owning RAII/CADRe object for the allocated managed memory region
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
Allocate a region in device-global memory within the primary context of the current CUDA device.
- Note
- The allocation will be made in the device's primary context - which will be created if it has not yet been.
- Template Parameters
-
T | an array type; not the type of individual elements |
- Parameters
-
num_elements | the number of elements to allocate |
- Returns
- an ::std::unique_ptr pointing to the constructed T array
- Parameters
-
device | The device in the global memory of which to make the allocation |
- Returns
- An owning RAII/CADRe object for the allocated memory region
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU.
- Returns
- An owning RAII/CADRe object for the allocated memory region