Brick Library 0.1
Performance-portable stencil datalayout & codegen
Loading...
Searching...
No Matches
minimal_brick.h
Go to the documentation of this file.
1
5#ifndef BRICK_H
6#define BRICK_H
7
8#include <memory>
9
10template<unsigned base, unsigned exp>
11struct static_power {
12 static constexpr unsigned value = base * static_power<base, exp - 1>::value;
13};
14
15template<unsigned base>
16struct static_power<base, 0> {
17 static constexpr unsigned value = 1;
18};
19
20struct BrickStorage {
21 std::shared_ptr<bElem> dat;
22 long chunks;
23 long step;
24 void *mmap_info = nullptr;
25};
26
27template<unsigned dims>
28struct BrickInfo {
31 unsigned nbricks;
32};
33
34template<unsigned ... Ds>
35struct Dim {
36};
37
38template<typename...>
39struct Brick;
40
41template<
42 unsigned ... BDims,
43 unsigned ... Folds>
44struct Brick<Dim<BDims...>, Dim<Folds...> > {
45 typedef BrickInfo<sizeof...(BDims)> myBrickInfo;
46
47 myBrickInfo *bInfo;
48 unsigned step;
49 bElem *dat;
50 BrickStorage bStorage;
51};
52
53#endif //BRICK_H
Metadata related to bricks.
Definition: brick.h:97
unsigned(* adjlist)[static_power< 3, dims >::value]
Adjacency list type.
Definition: brick.h:99
unsigned nbricks
Number of bricks in this list.
Definition: brick.h:103
adjlist adj
Adjacency list.
Definition: brick.h:101
Initializing and holding the storage of bricks.
Definition: brick.h:53
std::shared_ptr< bElem > dat
Pointer holding brick data.
Definition: brick.h:55
long chunks
Number of chunks.
Definition: brick.h:61
long step
Definition: minimal_brick.h:23
void * mmap_info
MMAP data structure when using mmap as allocator.
Definition: brick.h:65
unsigned step
Definition: minimal_brick.h:48
Generic base template, see Brick< Dim< BDims... >, Dim< Folds... > >
Definition: brick.h:340
Empty template to specify an n-D list.
Definition: brick.h:131
Compute Statically compute exponentials.
Definition: brick.h:35
static constexpr unsigned value
Definition: brick.h:36
#define bElem
Basic datatype for all brick elements.
Definition: vecscatter.h:13