-
Notifications
You must be signed in to change notification settings - Fork 0
/
defs.h
33 lines (24 loc) · 821 Bytes
/
defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef DEFS_H
#define DEFS_H
#include <sundials/sundials_types.h>
#define ZERO RCONST(0)
#define ONE RCONST(1)
#define TWO RCONST(2)
#define FOUR RCONST(4)
#define EIGHTH RCONST(.125)
#define PI RCONST(3.141592653589793238463)
// Thread block size for n-body kernel
// Pick multiple of 32, less than or equal to 1024
#define K 32
// Number of simulations to compute in parallel for pulloff profile
#define SIM_COUNT 10
// Utilities
template<typename T, typename U>
inline T* as(U* u) { return dynamic_cast<T*>(u); }
template<typename T, typename U>
inline const T* as(const U* u) { return dynamic_cast<const T*>(u); }
template<typename T, typename U>
inline T& as(U& u) { return dynamic_cast<T&>(u); }
template<typename T, typename U>
inline const T& as(const U& u) { return dynamic_cast<const T&>(u); }
#endif