Replace inline calls by macros
Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com>
This commit is contained in:
parent
3f7edb5dbf
commit
cb0ae2b0bb
@ -37,21 +37,26 @@ extern void createAtom(Atom*, Parameter*);
|
|||||||
extern void growAtom(Atom*);
|
extern void growAtom(Atom*);
|
||||||
|
|
||||||
#ifdef AOS
|
#ifdef AOS
|
||||||
inline const char *posDataLayout() { return "AoS"; }
|
#define POS_DATA_LAYOUT "AoS"
|
||||||
|
/* FIXME: these macros are resulting in segfault
|
||||||
|
#define set_atom_x(atom, i, v) (atom->x[i * 3 + 0] = v)
|
||||||
|
#define set_atom_y(atom, i, v) (atom->x[i * 3 + 1] = v)
|
||||||
|
#define set_atom_z(atom, i, v) (atom->x[i * 3 + 2] = v)
|
||||||
|
*/
|
||||||
inline void set_atom_x(Atom *atom, int i, MD_FLOAT x) { atom->x[i * 3 + 0] = x; }
|
inline void set_atom_x(Atom *atom, int i, MD_FLOAT x) { atom->x[i * 3 + 0] = x; }
|
||||||
inline void set_atom_y(Atom *atom, int i, MD_FLOAT y) { atom->x[i * 3 + 1] = y; }
|
inline void set_atom_y(Atom *atom, int i, MD_FLOAT y) { atom->x[i * 3 + 1] = y; }
|
||||||
inline void set_atom_z(Atom *atom, int i, MD_FLOAT z) { atom->x[i * 3 + 2] = z; }
|
inline void set_atom_z(Atom *atom, int i, MD_FLOAT z) { atom->x[i * 3 + 2] = z; }
|
||||||
inline MD_FLOAT get_atom_x(Atom *atom, int i) { return atom->x[i * 3 + 0]; }
|
#define get_atom_x(atom, i) (atom->x[i * 3 + 0])
|
||||||
inline MD_FLOAT get_atom_y(Atom *atom, int i) { return atom->x[i * 3 + 1]; }
|
#define get_atom_y(atom, i) (atom->x[i * 3 + 1])
|
||||||
inline MD_FLOAT get_atom_z(Atom *atom, int i) { return atom->x[i * 3 + 2]; }
|
#define get_atom_z(atom, i) (atom->x[i * 3 + 2])
|
||||||
#else
|
#else
|
||||||
inline const char *posDataLayout() { return "SoA"; }
|
#define POS_DATA_LAYOUT "SoA"
|
||||||
inline void set_atom_x(Atom *atom, int i, MD_FLOAT x) { atom->x[i] = x; }
|
#define set_atom_x(atom, i, v) (atom->x[i] = v)
|
||||||
inline void set_atom_y(Atom *atom, int i, MD_FLOAT y) { atom->y[i] = y; }
|
#define set_atom_y(atom, i, v) (atom->y[i] = v)
|
||||||
inline void set_atom_z(Atom *atom, int i, MD_FLOAT z) { atom->z[i] = z; }
|
#define set_atom_z(atom, i, v) (atom->z[i] = v)
|
||||||
inline MD_FLOAT get_atom_x(Atom *atom, int i) { return atom->x[i]; }
|
#define get_atom_x(atom, i) (atom->x[i])
|
||||||
inline MD_FLOAT get_atom_y(Atom *atom, int i) { return atom->y[i]; }
|
#define get_atom_y(atom, i) (atom->y[i])
|
||||||
inline MD_FLOAT get_atom_z(Atom *atom, int i) { return atom->z[i]; }
|
#define get_atom_z(atom, i) (atom->z[i])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,7 +291,7 @@ int main (int argc, char** argv)
|
|||||||
computeThermo(-1, ¶m, &atom);
|
computeThermo(-1, ¶m, &atom);
|
||||||
|
|
||||||
printf(HLINE);
|
printf(HLINE);
|
||||||
printf("Data layout for positions: %s\n", posDataLayout());
|
printf("Data layout for positions: %s\n", POS_DATA_LAYOUT);
|
||||||
#if PRECISION == 1
|
#if PRECISION == 1
|
||||||
printf("Using single precision floating point.\n");
|
printf("Using single precision floating point.\n");
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user