8 #ifndef MULTI_WRAPPER_IMPLS_UNIQUE_REGION_HPP_ 9 #define MULTI_WRAPPER_IMPLS_UNIQUE_REGION_HPP_ 11 #include "../unique_region.hpp" 12 #include "../types.hpp" 13 #include "../device.hpp" 57 auto current_device_id = cuda::device::current::detail_::get_id();
58 auto pc = cuda::device::primary_context::detail_::leaky_get(current_device_id);
88 CAW_SET_SCOPE_CONTEXT(context.handle());
89 return unique_region { detail_::allocate_in_current_context(num_bytes, initial_visibility) };
113 auto current_device_id = cuda::device::current::detail_::get_id();
114 auto pc = cuda::device::primary_context::detail_::leaky_get(current_device_id);
124 #endif // MULTI_WRAPPER_IMPLS_UNIQUE_REGION_HPP_ Wrapper class for a CUDA context.
Definition: context.hpp:244
Definitions and functionality wrapping CUDA APIs.
Definition: array.hpp:22
region_t allocate(const context_t &context, size_t size_in_bytes)
Allocate device-side memory on a CUDA device context.
Definition: memory.hpp:106
unique_region make_unique_region(const context_t &context, cuda::size_t num_elements)
Allocate a region in device-global memory.
Definition: unique_region.hpp:21
A class for holding a region_t of memory owned "uniquely" by its creator - similar to how ::std::uniq...
Definition: unique_region.hpp:41
::std::size_t size_t
A size type for use throughout the wrappers library (except when specific API functions limit the siz...
Definition: types.hpp:81
device::primary_context_t primary_context(bool hold_pc_refcount_unit=false) const
Produce a proxy for the device's primary context - the one used by runtime API calls.
Definition: device.hpp:152
Wrapper class for a CUDA device.
Definition: device.hpp:135
initial_visibility_t
The choices of which categories CUDA devices must a managed memory region be visible to...
Definition: types.hpp:753
unique_region make_unique_region(size_t num_bytes)
Allocate a region of managed memory, accessible both from CUDA devices and from the CPU...
Definition: unique_region.hpp:55