A convenience wrapper around a raw pointer "known" to the CUDA runtime and which thus has various kinds of associated information which this wrapper allows access to.
More...
#include <pointer.hpp>
template<typename T>
class cuda::memory::pointer_t< T >
A convenience wrapper around a raw pointer "known" to the CUDA runtime and which thus has various kinds of associated information which this wrapper allows access to.
◆ get()
- Returns
- Address of the pointed-to memory, regardless of which memory space it's in and whether or not it is accessible from the host
◆ get_for_device()
- Returns
- A pointer into device-accessible memory (not necessary on-device memory though). CUDA ensures that, for pointers to memory not accessible on the CUDA device,
nullptr
is returned.
- Note
- With unified memory, this will typically return the same value as the original pointer.
◆ get_for_host()
- Returns
- A pointer into device-accessible memory (not necessary on-device memory though). CUDA ensures that, for pointers to memory not accessible on the CUDA device,
nullptr
is returned.
- Note
- With unified memory, this will typically return the same value as the original pointer.
◆ other_side_of_region_pair()
- Returns
- For a mapped-memory pointer, returns the other side of the mapping, i.e. if this is the device pointer, returns the host pointer, otherwise returns the device pointer. For a managed-memory pointer, or in a unified setting, returns the single pointer usable on both device and host. In other cases returns
nullptr
.
- Note
- this relies on either the device and host pointers being
nullptr
in the case of a non-mapped pointer; and on the device and host pointers being identical to ptr_ for managed-memory pointers.
The documentation for this class was generated from the following file: