Specialization of memory_c for multi_array. More...
Specialization of memory_c for multi_array.
Specialization of memory_c for multi_array
It is mainly used by memory_conf to create the correct layout
T | is suppose to be a boost::mpl::vector specifing at position 0 the type and at position 1 to N the dimensions size of the multi_array |
D | object that allocate memory |
Definition at line 241 of file memory_c.hpp.
#include <memory_c.hpp>
Data Structures | |
struct | ascending |
In combination with generate_array is used to produce array at compile-time. More... | |
struct | ordering |
In combination with generate_array is used to produce array at compile-time. More... | |
Public Types | |
typedef boost::multi_array < base, size_p::value > | type |
Public Member Functions | |
void | setMemory (memory &mem) |
This function set the object that allocate memory. More... | |
memory & | getMemory () |
This function get the object that allocate memory. More... | |
bool | allocate (const size_t sz) |
This function allocate memory and associate the representation to mem_r. More... | |
memory_c () | |
constructor | |
~memory_c () | |
destructor | |
void | set_mem (memory &mem) |
set the device memory interface, the object that allocate memory | |
Data Fields | |
D * | mem |
Reference to an object to allocate memory. | |
boost::multi_array_ref< base, boost::mpl::size< T >::value > * | mem_r |
object that represent the memory as an multi-dimensional array of objects T | |
Private Types | |
template<int S> | |
using | int_ = boost::mpl::int_< S > |
define T More... | |
typedef boost::mpl::size< T > | size_p |
define the template vector size it give a number at compile time | |
template<typename S , unsigned int n> | |
using | at = boost::mpl::at< S, boost::mpl::int_< n > > |
Define "at" meta function without boost::mpl. | |
typedef at< T, 0 >::type | base |
typedef boost::multi_array_ref < base, size_p::value > ::size_type | size_type |
define size_type | |
|
private |
typedef boost::multi_array<base,size_p::value> memory_c< multi_array< T >, D >::type |
define the type of the multi_array vector minus one of the original size basically we remove the index 0 of the multi_array
Definition at line 356 of file memory_c.hpp.
|
inline |
This function allocate memory and associate the representation to mem_r.
This function allocate memory and associate the representation of that chunk of memory to mem_r
We create a chunk of memory
buffer to store the dimensions of the full multi_array buffer
we generate the ordering buffer ord::data = {0,N-1 ...... 1 }
we create the representation for the memory buffer
Definition at line 324 of file memory_c.hpp.
|
inline |
This function get the object that allocate memory.
Definition at line 313 of file memory_c.hpp.
|
inline |
This function set the object that allocate memory.
mem | the memory object |
Definition at line 294 of file memory_c.hpp.