8 #ifndef MEMORY_ARRAY_HPP_ 9 #define MEMORY_ARRAY_HPP_ 11 #include "memory/memory.hpp" 13 #include "util/cuda_util.hpp" 29 #if defined(__GNUG__) || defined(__clang__) 32 T __attribute__((aligned(16))) *
ptr;
73 this->ptr = static_cast<T *>(
ptr);
97 ptr = static_cast<T *>(ptr_);
164 for (
size_t i = 0 ; i <
sz ; i++)
void bind_ref(const memory_array< Tbind > &ref)
Set from another memory array.
__host__ __device__ const T & operator[](mem_id i) const
Access element an element of the array.
size_t sz
number of elements
memory_array()
Default constructor.
void swap(memory_array< T > &obj)
swap the two objects memory
void set_pointer(void *ptr_)
Set the internal pointer to the indicated chunk of memory.
__device__ __host__ void * get_pointer() const
Return the pointer.
T get(mem_id i)
Get the i element.
memory_array(void *ptr, size_t sz, bool init)
Memory array constructor.
size_t size()
return the size of the array
void deinit()
Deinitialize the memory.
void initialize(void *ptr, size_t sz, bool init)
Initialize the memory array.
T value_type
type returned by this structure
This class give a representation to a chunk or memory.
OutputIteratorT OffsetT ReductionOpT OuputT init
< [in] The initial value of the reduction
~memory_array()
Destructor.
__host__ __device__ T & operator[](mem_id i)
Access element an element of the array.