Header file for type definitions.
More...
#include "config.h"
#include "error.h"
#include <inttypes.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>
#include <complex.h>
Go to the source code of this file.
|
#define | GHOST_ALLREDUCE -1 |
|
#define | MPI_COMM_NULL 0 |
|
#define | MPI_COMM_SELF 1 |
|
#define | MPI_OP_NULL 0 |
|
#define | MPI_DATATYPE_NULL 0 |
|
#define | MPI_COMM_WORLD 0 |
|
#define | SELECT_TMPL_2DATATYPES(dt1, dt2, complexclass, ret, func,...) |
|
#define | SELECT_TMPL_2DATATYPES_base_derived(dt1, dt2, complexclass, ret, func,...) |
|
#define | SELECT_TMPL_4DATATYPES(dt1, dt2, complexclass, ret, func,...) |
| Calls the function with template arguments <dt1_device,dt2_host,dt2_device,dt2_base>. More...
|
|
#define | SELECT_TMPL_1DATATYPE(dt, complexclass, ret, func,...) |
|
#define | GHOST_DT_ANY (ghost_datatype)-1 |
|
#define | GHOST_DT_NONE (ghost_datatype)0 |
|
#define | GHOST_HOST_IDX 0 |
|
#define | GHOST_DEVICE_IDX 1 |
|
#define | GHOST_DT_MAX_SIZE 16 |
| Size of the largest data type (complex double). More...
|
|
#define | GHOST_REGISTER_DT_D(name) |
| Macro to "register" a double data type in an application. More...
|
|
#define | GHOST_REGISTER_DT_S(name) |
|
#define | GHOST_REGISTER_DT_C(name) |
|
#define | GHOST_REGISTER_DT_Z(name) |
|
#define | ghost_mpi_dt_gidx MPI_INT |
|
#define | PRGIDX PRId32 |
| Macro to print matrix/vector row/column indices depending on index size. More...
|
|
#define | GHOST_GIDX_MAX INT32_MAX |
|
#define | ghost_mpi_dt_lidx MPI_INT |
|
#define | PRBLASIDX PRId32 |
|
#define | PRLIDX PRId32 |
|
#define | GHOST_LIDX_MAX INT32_MAX |
|
#define | GHOST_IDX_UNIFORM |
|
#define | PRIDX PRGIDX |
|
#define | ghost_mpi_dt_idx ghost_mpi_dt_gidx |
|
|
enum | ghost_datatype { GHOST_DT_FLOAT = 1,
GHOST_DT_DOUBLE = 2,
GHOST_DT_REAL = 4,
GHOST_DT_COMPLEX = 8
} |
| Available primitive data types. More...
|
|
enum | ghost_location { GHOST_LOCATION_DEFAULT = 0,
GHOST_LOCATION_HOST = 1,
GHOST_LOCATION_DEVICE = 2
} |
|
enum | ghost_alignment { GHOST_UNALIGNED = 0,
GHOST_ALIGNED = 1
} |
| Possible alignments of data access. More...
|
|
enum | ghost_implementation {
GHOST_IMPLEMENTATION_DEFAULT = -1,
GHOST_IMPLEMENTATION_PLAIN = 0,
GHOST_IMPLEMENTATION_SSE = 1,
GHOST_IMPLEMENTATION_AVX = 2,
GHOST_IMPLEMENTATION_AVX2 = 3,
GHOST_IMPLEMENTATION_MIC = 4,
GHOST_IMPLEMENTATION_CUDA = 5
} |
| Possible implementations of a CPU function. More...
|
|
enum | ghost_datatype_idx { GHOST_DT_S_IDX = 0,
GHOST_DT_D_IDX = 1,
GHOST_DT_C_IDX = 2,
GHOST_DT_Z_IDX = 3
} |
| Contiguous indices for data types. More...
|
|
Header file for type definitions.
- Author
- Moritz Kreutzer morit.nosp@m.z.kr.nosp@m.eutze.nosp@m.r@fa.nosp@m.u.de
#define GHOST_ALLREDUCE -1 |
#define GHOST_DEVICE_IDX 1 |
#define GHOST_DT_MAX_SIZE 16 |
Size of the largest data type (complex double).
#define GHOST_GIDX_MAX INT32_MAX |
#define GHOST_IDX_UNIFORM |
#define GHOST_LIDX_MAX INT32_MAX |
#define ghost_mpi_dt_gidx MPI_INT |
#define ghost_mpi_dt_lidx MPI_INT |
#define GHOST_REGISTER_DT_C |
( |
|
name | ) |
|
Value:typedef complex
float name ## _t;
\
Complex numbers.
Definition: types.h:264
Single precision.
Definition: types.h:252
ghost_datatype
Available primitive data types.
Definition: types.h:248
- See Also
- GHOST_REGISTER_DT_D with float complex instead of double.
#define GHOST_REGISTER_DT_D |
( |
|
name | ) |
|
Value:typedef double name ## _t;
\
Double precision.
Definition: types.h:256
Real numbers.
Definition: types.h:260
ghost_datatype
Available primitive data types.
Definition: types.h:248
Macro to "register" a double data type in an application.
- Parameters
-
This macro enables easy switching of data types in applications. After calling the macros with identifier "mydata" a typedef "typedef mydata_t double;" and a variable "ghost_datatype mydata = GHOST_DT_DOUBLE|GHOST_DT_REAL;" will be present.
#define GHOST_REGISTER_DT_S |
( |
|
name | ) |
|
Value:typedef float name ## _t;
\
Single precision.
Definition: types.h:252
Real numbers.
Definition: types.h:260
ghost_datatype
Available primitive data types.
Definition: types.h:248
- See Also
- GHOST_REGISTER_DT_D with float instead of double.
#define GHOST_REGISTER_DT_Z |
( |
|
name | ) |
|
Value:typedef complex
double name ## _t;
\
Complex numbers.
Definition: types.h:264
Double precision.
Definition: types.h:256
ghost_datatype
Available primitive data types.
Definition: types.h:248
- See Also
- GHOST_REGISTER_DT_D with double complex instead of double.
#define MPI_DATATYPE_NULL 0 |
Macro to print matrix/vector row/column indices depending on index size.
#define SELECT_TMPL_1DATATYPE |
( |
|
dt, |
|
|
|
complexclass, |
|
|
|
ret, |
|
|
|
func, |
|
|
|
... |
|
) |
| |
Value:
ret = func<complexclass<double> >(__VA_ARGS__);\
} else {\
ret = func<complexclass<float> >(__VA_ARGS__);\
}\
} else {\
ret = func<double>(__VA_ARGS__);\
} else {\
ret = func<float>(__VA_ARGS__);\
}\
}\
Complex numbers.
Definition: types.h:264
Double precision.
Definition: types.h:256
#define SELECT_TMPL_2DATATYPES |
( |
|
dt1, |
|
|
|
dt2, |
|
|
|
complexclass, |
|
|
|
ret, |
|
|
|
func, |
|
|
|
... |
|
) |
| |
#define SELECT_TMPL_2DATATYPES_base_derived |
( |
|
dt1, |
|
|
|
dt2, |
|
|
|
complexclass, |
|
|
|
ret, |
|
|
|
func, |
|
|
|
... |
|
) |
| |
#define SELECT_TMPL_4DATATYPES |
( |
|
dt1, |
|
|
|
dt2, |
|
|
|
complexclass, |
|
|
|
ret, |
|
|
|
func, |
|
|
|
... |
|
) |
| |
Calls the function with template arguments <dt1_device,dt2_host,dt2_device,dt2_base>.
Possible alignments of data access.
Enumerator |
---|
GHOST_UNALIGNED |
|
GHOST_ALIGNED |
|
Available primitive data types.
The validity of a data type can be checked with ghost_datatypeValid().
Enumerator |
---|
GHOST_DT_FLOAT |
Single precision.
|
GHOST_DT_DOUBLE |
Double precision.
|
GHOST_DT_REAL |
Real numbers.
|
GHOST_DT_COMPLEX |
Complex numbers.
|
Contiguous indices for data types.
This is used, e.g., when template instantiations for different data types are stored in an array.
Enumerator |
---|
GHOST_DT_S_IDX |
Real float.
|
GHOST_DT_D_IDX |
Real double.
|
GHOST_DT_C_IDX |
Complex float.
|
GHOST_DT_Z_IDX |
Complex double.
|
Possible implementations of a CPU function.
Enumerator |
---|
GHOST_IMPLEMENTATION_DEFAULT |
|
GHOST_IMPLEMENTATION_PLAIN |
|
GHOST_IMPLEMENTATION_SSE |
|
GHOST_IMPLEMENTATION_AVX |
|
GHOST_IMPLEMENTATION_AVX2 |
|
GHOST_IMPLEMENTATION_MIC |
|
GHOST_IMPLEMENTATION_CUDA |
|
Enumerator |
---|
GHOST_LOCATION_DEFAULT |
Default location. This is only a placeholder and the actual location has to be specified by GHOST.
|
GHOST_LOCATION_HOST |
Data is located on host.
|
GHOST_LOCATION_DEVICE |
Data is located on device (accelerator, GPU).
|
Check whether a given data type is valid.
- Parameters
-
- Returns
- 1 if the data type is valid and 0 if it isn't.
An data type is valid if exactly one of GHOST_DT_FLOAT and GHOST_DT_DOUBLE and exactly one of GHOST_DT_REAL and GHOST_DT_COMPLEX is set.