Skip to content

Commit

Permalink
Idx variants (#160)
Browse files Browse the repository at this point in the history
* first draft at calc_bonds_idx cpp implementation

* test for calcbondsidx

* loadinterleaved double case

need to load fewer int values to cast to longs, to then load as doubles

* fixes loadinterleaved idx double case

this is the right combo of loading ints and promoting to longlongs

* orthogonal and triclinic calcbondsidx and tests

* boilerplate for calcanglesidx

* calcanglesidx implementation and tests

* more generic int32 to int64 conversion

* calc dihedrals idx function stubs

* fix test fixture to initialise all coordinates

previously only populated 1/3 of the coordinate array with values...

* adds dihedrals idx implementation and tests

* function stubs for distance array idx

* change to int* not uint* for idx functions

loading ints takes int anyway, so don't confuse signed-ness of these

* push DAidx down scalar path for small problem sizes

* DAidx implementation

* embiggen the idx fixture to allow distance array results

nidx * nidx shouldn't be too large...

* DAidx tests

* function stubs for SDAidx

* SDAidx implementation and tests
  • Loading branch information
richardjgowers authored Aug 26, 2024
1 parent 3842510 commit d435868
Show file tree
Hide file tree
Showing 4 changed files with 1,094 additions and 1 deletion.
15 changes: 15 additions & 0 deletions libdistopia/include/distopia.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ namespace distopia {
template <typename T> void CalcSelfDistanceArrayNoBox(const T *a, int n, T *out);
template <typename T> void CalcSelfDistanceArrayOrtho(const T *a, int n, const T *box, T *out);
template <typename T> void CalcSelfDistanceArrayTriclinic(const T *a, int n, const T *box, T *out);
template <typename T> void CalcBondsNoBoxIdx(const T *coords, const int *a_idx, const int *b_idx, int n, T *out);
template <typename T> void CalcBondsOrthoIdx(const T *coords, const int *a_idx, const int *b_idx, int n, const T *box, T *out);
template <typename T> void CalcBondsTriclinicIdx(const T *coords, const int *a_idx, const int *b_idx, int n, const T *box, T *out);
template <typename T> void CalcAnglesNoBoxIdx(const T *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, T *out);
template <typename T> void CalcAnglesOrthoIdx(const T *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, const T *box, T *out);
template <typename T> void CalcAnglesTriclinicIdx(const T *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, const T *box, T *out);
template <typename T> void CalcDihedralsNoBoxIdx(const T *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, T *out);
template <typename T> void CalcDihedralsOrthoIdx(const T *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, const T *box, T *out);
template <typename T> void CalcDihedralsTriclinicIdx(const T *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, const T *box, T *out);
template <typename T> void CalcDistanceArrayNoBoxIdx(const T *coords, const int *a_idx, const int *b_idx, int na, int nb, T *out);
template <typename T> void CalcDistanceArrayOrthoIdx(const T *coords, const int *a_idx, const int *b_idx, int na, int nb, const T *box, T *out);
template <typename T> void CalcDistanceArrayTriclinicIdx(const T *coords, const int *a_idx, const int *b_idx, int na, int nb, const T *box, T *out);
template <typename T> void CalcSelfDistanceArrayNoBoxIdx(const T *coords, const int *idx, int n, T *out);
template <typename T> void CalcSelfDistanceArrayOrthoIdx(const T *coords, const int *idx, int n, const T *box, T *out);
template <typename T> void CalcSelfDistanceArrayTriclinicIdx(const T *coords, const int *idx, int n, const T *box, T *out);
int GetNFloatLanes();
int GetNDoubleLanes();
std::vector<std::string> DistopiaSupportedAndGeneratedTargets();
Expand Down
Loading

0 comments on commit d435868

Please sign in to comment.