Grid 0.7.0
Lebesgue.h
Go to the documentation of this file.
1/*************************************************************************************
2
3 Grid physics library, www.github.com/paboyle/Grid
4
5 Source file: ./lib/stencil/Lebesgue.h
6
7 Copyright (C) 2015
8
9Author: Peter Boyle <paboyle@ph.ed.ac.uk>
10Author: paboyle <paboyle@ph.ed.ac.uk>
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License along
23 with this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
26 See the full license in the file "LICENSE" in the top level distribution directory
27*************************************************************************************/
28/* END LEGAL */
29#ifndef GRID_LEBESGUE_H
30#define GRID_LEBESGUE_H
31
32#include<vector>
33
34// Lebesgue, Morton, Z-graph ordering assistance
36
38public:
39
40 typedef int32_t IndexInteger;
41 static int UseLebesgueOrder;
43
44public:
46
48 return _LebesgueReorder[ss] ;
49 };
50
52 // Space filling fractal for cache oblivious
54 void ZGraph(void);
56
58 // Cartesian stencil blocking strategy
60 static std::vector<int> Block;
61 void NoBlocking(void);
63 void IterateO(int ND,int dim,
64 Coordinate & xo,
65 Coordinate & xi,
66 Coordinate &dims);
67 void IterateI(int ND,int dim,
68 Coordinate & xo,
69 Coordinate & xi,
70 Coordinate &dims);
71
72 void ThreadInterleave(void);
73
74private:
76
77};
78
80
81#endif
std::vector< T, devAllocator< T > > deviceVector
AcceleratorVector< int, MaxDims > Coordinate
Definition Coordinate.h:95
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
void CartesianBlocking(void)
static int UseLebesgueOrder
Definition Lebesgue.h:41
void ZGraph(void)
LebesgueOrder(GridBase *_grid)
deviceVector< IndexInteger > _LebesgueReorder
Definition Lebesgue.h:75
void ThreadInterleave(void)
static std::vector< int > Block
Definition Lebesgue.h:60
int32_t IndexInteger
Definition Lebesgue.h:40
void IterateI(int ND, int dim, Coordinate &xo, Coordinate &xi, Coordinate &dims)
GridBase * grid
Definition Lebesgue.h:42
void NoBlocking(void)
void IterateO(int ND, int dim, Coordinate &xo, Coordinate &xi, Coordinate &dims)
IndexInteger Reorder(IndexInteger ss)
Definition Lebesgue.h:47
IndexInteger alignup(IndexInteger n)