OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
memory_c< multi_array< T >, D > Class Template Reference

Specialization of memory_c for multi_array. More...

Detailed Description

template<typename T, typename D>
class memory_c< multi_array< T >, D >

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

See Also
memory_traits_inte memory_traits_lin
Template Parameters
Tis 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
Dobject that allocate memory

Definition at line 240 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...
 
memorygetMemory ()
 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
 
void swap (memory_c &mem_obj)
 swap the memory More...
 

Data Fields

Dmem
 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
 

Member Typedef Documentation

template<typename T , typename D >
template<int S>
using memory_c< multi_array< T >, D >::int_ = boost::mpl::int_<S>
private

define T

define boost::mpl::int_ without boost::mpl

Definition at line 246 of file memory_c.hpp.

template<typename T , typename D >
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 355 of file memory_c.hpp.

Member Function Documentation

template<typename T , typename D >
bool memory_c< multi_array< T >, D >::allocate ( const size_t  sz)
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 323 of file memory_c.hpp.

template<typename T , typename D >
memory& memory_c< multi_array< T >, D >::getMemory ( )
inline

This function get the object that allocate memory.

Returns
memory object to allocate memory

Definition at line 312 of file memory_c.hpp.

template<typename T , typename D >
void memory_c< multi_array< T >, D >::setMemory ( memory mem)
inline

This function set the object that allocate memory.

Parameters
memthe memory object

Definition at line 293 of file memory_c.hpp.

template<typename T , typename D >
void memory_c< multi_array< T >, D >::swap ( memory_c< multi_array< T >, D > &  mem_obj)
inline

swap the memory

swap the memory between objects

Definition at line 389 of file memory_c.hpp.


The documentation for this class was generated from the following file: