1 #ifndef __ACCCESSORS_HPP__
2 #define __ACCCESSORS_HPP__
4 #include <cuv/tools/cuv_general.hpp>
13 template <
class value_type,
class size_type,
class memory_space_type>
15 void alloc( value_type** ptr, size_type memsize)
const;
16 void alloc2d( value_type** ptr, size_type& pitch, size_type height, size_type width)
const;
17 void dealloc( value_type** ptr)
const;
28 template<
class value_type2>
31 void copy2d(value_type* dst,
const value_type*src,size_type dpitch, size_type spitch, size_type h, size_type w,
host_memory_space);
32 void copy2d(value_type* dst,
const value_type*src,size_type dpitch, size_type spitch, size_type h, size_type w,
dev_memory_space);
34 void alloc(
const value_type** ptr, size_type memsize)
const;
35 void dealloc(
const value_type** ptr)
const;
46 template <
class value_type,
class size_type>
47 void entry_set(value_type* ptr, size_type idx, value_type val, host_memory_space);
51 template <
class value_type,
class size_type>
52 value_type entry_get(
const value_type* ptr, size_type idx, host_memory_space);
57 template <
class value_type,
class size_type>
58 void entry_set(value_type* ptr, size_type idx, value_type val, dev_memory_space);
62 template <
class value_type,
class size_type>
63 value_type entry_get(
const value_type* ptr, size_type idx, dev_memory_space);
74 template <
class value_type,
class size_type>
75 void entry_set(value_type* ptr, size_type idx, value_type val, host_memory_space) {
88 template <
class value_type,
class size_type>
89 value_type entry_get(
const value_type* ptr, size_type idx, host_memory_space) {
103 template<
class value_type,
class size_type>
113 void alloc( value_type** ptr, size_type size)
const;
122 void alloc2d( value_type** ptr, size_type& pitch, size_type height, size_type width)
const;
130 void dealloc( value_type** ptr)
const ;
139 void alloc(
const value_type** ptr, size_type size)
const{
154 std::memcpy(dst,src,size*
sizeof(value_type));
159 template<
class value_type2>
161 for(
unsigned int i=0;i<size;i++)
162 dst[i] = (value_type)src[i];
176 void copy2d(value_type* dst,
const value_type*src,size_type dpitch, size_type spitch, size_type h, size_type w,
host_memory_space);
177 void copy2d(value_type* dst,
const value_type*src,size_type dpitch, size_type spitch, size_type h, size_type w,
dev_memory_space);