#include <cuda/pi_cuda.hpp>
Public Types | |
enum | alloc_mode { alloc_mode::classic, alloc_mode::use_host_ptr, alloc_mode::copy_in, alloc_mode::alloc_host_ptr, alloc_mode::classic, alloc_mode::use_host_ptr, alloc_mode::copy_in, alloc_mode::alloc_host_ptr } |
alloc_mode classic: Just a normal buffer allocated on the device via cuda malloc use_host_ptr: Use an address on the host for the device copy_in: The data for the device comes from the host but the host pointer is not available later for re-use alloc_host_ptr: Uses pinned-memory allocation More... | |
enum | alloc_mode { alloc_mode::classic, alloc_mode::use_host_ptr, alloc_mode::copy_in, alloc_mode::alloc_host_ptr, alloc_mode::classic, alloc_mode::use_host_ptr, alloc_mode::copy_in, alloc_mode::alloc_host_ptr } |
alloc_mode classic: Just a normal buffer allocated on the device via hip malloc use_host_ptr: Use an address on the host for the device copy_in: The data for the device comes from the host but the host pointer is not available later for re-use alloc_host_ptr: Uses pinned-memory allocation More... | |
using | native_type = CUdeviceptr |
using | native_type = hipDeviceptr_t |
Public Member Functions | |
native_type | get () const noexcept |
size_t | get_size () const noexcept |
void * | get_map_ptr () const noexcept |
size_t | get_map_offset (void *) const noexcept |
void * | map_to_ptr (size_t offset, pi_map_flags flags) noexcept |
Returns a pointer to data visible on the host that contains the data on the device associated with this allocation. More... | |
void | unmap (void *) noexcept |
Detach the allocation from the host memory. More... | |
pi_map_flags | get_map_flags () const noexcept |
native_type | get () const noexcept |
native_type | get_with_offset (size_t offset) const noexcept |
void * | get_void () const noexcept |
size_t | get_size () const noexcept |
void * | get_map_ptr () const noexcept |
size_t | get_map_offset (void *ptr) const noexcept |
void * | map_to_ptr (size_t offset, pi_map_flags flags) noexcept |
Returns a pointer to data visible on the host that contains the data on the device associated with this allocation. More... | |
void | unmap (void *ptr) noexcept |
Detach the allocation from the host memory. More... | |
pi_map_flags | get_map_flags () const noexcept |
Public Attributes | |
pi_mem | parent_ |
native_type | ptr_ |
void * | hostPtr_ |
Pointer associated with this device on the host. More... | |
size_t | size_ |
Size of the allocation in bytes. More... | |
size_t | mapOffset_ |
Offset of the active mapped region. More... | |
void * | mapPtr_ |
Pointer to the active mapped region, if any. More... | |
pi_map_flags | mapFlags_ |
Original flags for the mapped region. More... | |
enum _pi_mem::mem_::buffer_mem_::alloc_mode | allocMode_ |
Definition at line 240 of file pi_cuda.hpp.
using _pi_mem::mem_::buffer_mem_::native_type = hipDeviceptr_t |
Definition at line 211 of file pi_hip.hpp.
Definition at line 241 of file pi_cuda.hpp.
|
strong |
alloc_mode classic: Just a normal buffer allocated on the device via hip malloc use_host_ptr: Use an address on the host for the device copy_in: The data for the device comes from the host but the host pointer is not available later for re-use alloc_host_ptr: Uses pinned-memory allocation
Enumerator | |
---|---|
classic | |
use_host_ptr | |
copy_in | |
alloc_host_ptr | |
classic | |
use_host_ptr | |
copy_in | |
alloc_host_ptr |
Definition at line 237 of file pi_hip.hpp.
|
strong |
alloc_mode classic: Just a normal buffer allocated on the device via cuda malloc use_host_ptr: Use an address on the host for the device copy_in: The data for the device comes from the host but the host pointer is not available later for re-use alloc_host_ptr: Uses pinned-memory allocation
Enumerator | |
---|---|
classic | |
use_host_ptr | |
copy_in | |
alloc_host_ptr | |
classic | |
use_host_ptr | |
copy_in | |
alloc_host_ptr |
Definition at line 267 of file pi_cuda.hpp.
|
inlinenoexcept |
Definition at line 244 of file pi_hip.hpp.
References ptr_.
|
inlinenoexcept |
Definition at line 274 of file pi_cuda.hpp.
References ptr_.
Referenced by cuda_piEnqueueMemBufferCopy(), cuda_piEnqueueMemBufferCopyRect(), cuda_piEnqueueMemBufferFill(), cuda_piEnqueueMemBufferRead(), cuda_piEnqueueMemBufferReadRect(), cuda_piEnqueueMemBufferWrite(), cuda_piEnqueueMemBufferWriteRect(), cuda_piextKernelSetArgMemObj(), cuda_piextMemGetNativeHandle(), and hip_piextMemGetNativeHandle().
|
inlinenoexcept |
Definition at line 291 of file pi_hip.hpp.
|
inlinenoexcept |
Definition at line 310 of file pi_cuda.hpp.
References mapFlags_, and mapPtr_.
Referenced by cuda_piEnqueueMemUnmap(), and hip_piEnqueueMemUnmap().
|
inlinenoexcept |
Definition at line 280 of file pi_cuda.hpp.
References mapOffset_.
Referenced by cuda_piEnqueueMemUnmap(), and hip_piEnqueueMemUnmap().
|
inlinenoexcept |
Definition at line 257 of file pi_hip.hpp.
References mapOffset_.
|
inlinenoexcept |
Definition at line 255 of file pi_hip.hpp.
References mapPtr_.
|
inlinenoexcept |
Definition at line 278 of file pi_cuda.hpp.
References mapPtr_.
Referenced by cuda_piEnqueueMemBufferMap(), cuda_piEnqueueMemUnmap(), hip_piEnqueueMemBufferMap(), and hip_piEnqueueMemUnmap().
|
inlinenoexcept |
Definition at line 253 of file pi_hip.hpp.
References size_.
|
inlinenoexcept |
Definition at line 276 of file pi_cuda.hpp.
References size_.
Referenced by cuda_piEnqueueMemUnmap(), cuda_piMemBufferPartition(), hip_piEnqueueMemUnmap(), hip_piMemBufferPartition(), and map_to_ptr().
|
inlinenoexcept |
Definition at line 251 of file pi_hip.hpp.
References ptr_.
Referenced by hip_piEnqueueMemBufferCopyRect(), hip_piEnqueueMemBufferReadRect(), hip_piEnqueueMemBufferWriteRect(), and hip_piextKernelSetArgMemObj().
|
inlinenoexcept |
Definition at line 246 of file pi_hip.hpp.
References ptr_.
Referenced by hip_piEnqueueMemBufferCopy(), hip_piEnqueueMemBufferFill(), hip_piEnqueueMemBufferRead(), hip_piEnqueueMemBufferWrite(), and hip_piMemBufferPartition().
|
inlinenoexcept |
Returns a pointer to data visible on the host that contains the data on the device associated with this allocation.
The offset is used to index into the HIP allocation.
Definition at line 266 of file pi_hip.hpp.
References get_size(), hostPtr_, cl::sycl::malloc(), mapFlags_, mapOffset_, and mapPtr_.
|
inlinenoexcept |
Returns a pointer to data visible on the host that contains the data on the device associated with this allocation.
The offset is used to index into the CUDA allocation.
Definition at line 286 of file pi_cuda.hpp.
References get_size(), hostPtr_, cl::sycl::malloc(), mapFlags_, mapOffset_, and mapPtr_.
Referenced by cuda_piEnqueueMemBufferMap(), and hip_piEnqueueMemBufferMap().
|
inlinenoexcept |
Detach the allocation from the host memory.
Definition at line 300 of file pi_cuda.hpp.
References cl::sycl::detail::usm::free(), hostPtr_, mapOffset_, and mapPtr_.
Referenced by cuda_piEnqueueMemUnmap(), and hip_piEnqueueMemUnmap().
|
inlinenoexcept |
Detach the allocation from the host memory.
Definition at line 280 of file pi_hip.hpp.
References cl::sycl::detail::usm::free(), hostPtr_, mapOffset_, and mapPtr_.
enum _pi_mem::mem_::buffer_mem_::alloc_mode _pi_mem::mem_::buffer_mem_::allocMode_ |
void * _pi_mem::mem_::buffer_mem_::hostPtr_ |
Pointer associated with this device on the host.
Definition at line 250 of file pi_cuda.hpp.
Referenced by cuda_piMemBufferPartition(), hip_piMemBufferPartition(), map_to_ptr(), and unmap().
pi_map_flags _pi_mem::mem_::buffer_mem_::mapFlags_ |
Original flags for the mapped region.
Definition at line 258 of file pi_cuda.hpp.
Referenced by get_map_flags(), and map_to_ptr().
size_t _pi_mem::mem_::buffer_mem_::mapOffset_ |
Offset of the active mapped region.
Definition at line 254 of file pi_cuda.hpp.
Referenced by get_map_offset(), map_to_ptr(), and unmap().
void * _pi_mem::mem_::buffer_mem_::mapPtr_ |
Pointer to the active mapped region, if any.
Definition at line 256 of file pi_cuda.hpp.
Referenced by get_map_flags(), get_map_ptr(), map_to_ptr(), and unmap().
pi_mem _pi_mem::mem_::buffer_mem_::parent_ |
Definition at line 245 of file pi_cuda.hpp.
Referenced by _pi_mem::is_sub_buffer(), and _pi_mem::~_pi_mem().
native_type _pi_mem::mem_::buffer_mem_::ptr_ |
Definition at line 247 of file pi_cuda.hpp.
Referenced by cuda_piMemBufferPartition(), get(), get_void(), get_with_offset(), and hip_piMemBufferPartition().
size_t _pi_mem::mem_::buffer_mem_::size_ |
Size of the allocation in bytes.
Definition at line 252 of file pi_cuda.hpp.
Referenced by get_size().