Device variable with address space of shared or global. More...
#include <syclcompat/memory.hpp>
Public Types | |
using | accessor_t = typename detail::memory_traits< Memory, T >::template accessor_t< Dimension > |
using | value_t = typename detail::memory_traits< Memory, T >::value_t |
using | syclcompat_accessor_t = syclcompat::accessor< T, Memory, Dimension > |
Public Member Functions | |
device_memory (sycl::queue q=get_default_queue()) | |
device_memory (const sycl::range< Dimension > &in_range, std::initializer_list< value_t > &&init_list, sycl::queue q=get_default_queue()) | |
Constructor of 1-D array with initializer list. More... | |
template<size_t Dim = Dimension> | |
device_memory (const typename std::enable_if< Dim==2, sycl::range< 2 >>::type &in_range, std::initializer_list< std::initializer_list< value_t >> &&init_list, sycl::queue q=get_default_queue()) | |
Constructor of 2-D array with initializer list. More... | |
device_memory (const sycl::range< Dimension > &range_in, sycl::queue q=get_default_queue()) | |
Constructor with range. More... | |
template<class... Args, size_t Dim = Dimension, typename = std::enable_if_t<sizeof...(Args) == Dim>> | |
device_memory (Args... Arguments) | |
Constructor with range. More... | |
template<class... Args> | |
device_memory (Args... Arguments, sycl::queue q) | |
Constructor with range and queue. More... | |
~device_memory () | |
void | init () |
Allocate memory with the queue specified in the constuctor, and init memory if has initial value. More... | |
void | init (sycl::queue q) |
Allocate memory with specified queue, and init memory if has initial value. More... | |
void | assign (value_t *src, size_t size) |
The variable is assigned to a device pointer. More... | |
value_t * | get_ptr () |
value_t * | get_ptr (sycl::queue q) |
size_t | get_size () |
Get the device memory object size in bytes. More... | |
template<size_t Dim = Dimension> | |
std::enable_if< Dim==1, T >::type & | operator[] (size_t index) |
template<size_t Dim = Dimension> | |
std::enable_if< Dim !=1, syclcompat_accessor_t >::type | get_access (sycl::handler &cgh) |
Get compat_accessor with dimension info for the device memory object when usm is used and dimension is greater than 1. More... | |
Device variable with address space of shared or global.
Definition at line 990 of file memory.hpp.
using syclcompat::device_memory< T, Memory, Dimension >::accessor_t = typename detail::memory_traits<Memory, T>::template accessor_t<Dimension> |
Definition at line 992 of file memory.hpp.
using syclcompat::device_memory< T, Memory, Dimension >::syclcompat_accessor_t = syclcompat::accessor<T, Memory, Dimension> |
Definition at line 995 of file memory.hpp.
using syclcompat::device_memory< T, Memory, Dimension >::value_t = typename detail::memory_traits<Memory, T>::value_t |
Definition at line 994 of file memory.hpp.
|
inline |
Definition at line 997 of file memory.hpp.
|
inline |
Constructor of 1-D array with initializer list.
Definition at line 1001 of file memory.hpp.
References syclcompat::malloc(), and sycl::_V1::range< Dimensions >::size().
|
inline |
Constructor of 2-D array with initializer list.
Definition at line 1013 of file memory.hpp.
References syclcompat::malloc().
|
inline |
Constructor with range.
Definition at line 1030 of file memory.hpp.
|
inline |
Constructor with range.
Definition at line 1047 of file memory.hpp.
|
inline |
Constructor with range and queue.
Definition at line 1053 of file memory.hpp.
|
inline |
Definition at line 1056 of file memory.hpp.
References syclcompat::free().
|
inline |
The variable is assigned to a device pointer.
Definition at line 1079 of file memory.hpp.
|
inline |
Get compat_accessor with dimension info for the device memory object when usm is used and dimension is greater than 1.
Definition at line 1106 of file memory.hpp.
|
inline |
Definition at line 1085 of file memory.hpp.
References syclcompat::device_memory< T, Memory, Dimension >::get_ptr().
Referenced by syclcompat::device_memory< T, Memory, Dimension >::get_ptr().
|
inline |
Definition at line 1088 of file memory.hpp.
|
inline |
Get the device memory object size in bytes.
Definition at line 1094 of file memory.hpp.
|
inline |
Allocate memory with the queue specified in the constuctor, and init memory if has initial value.
Definition at line 1065 of file memory.hpp.
References syclcompat::device_memory< T, Memory, Dimension >::init().
Referenced by syclcompat::device_memory< T, Memory, Dimension >::init().
|
inline |
Allocate memory with specified queue, and init memory if has initial value.
Definition at line 1068 of file memory.hpp.
References syclcompat::memcpy().
|
inline |
Definition at line 1097 of file memory.hpp.