From 12930afb23dd7a5b87c840502bf50228881b271c Mon Sep 17 00:00:00 2001 From: Hugo MacDermott-Opeskin Date: Wed, 16 Oct 2024 11:34:23 +1100 Subject: [PATCH] Install opts notest (#172) * allow no building of tests * change default * just use setup.py install * fix install * remove HWY_DLLEXPORT --- .github/workflows/make_and_test.yml | 32 +++++++ CMakeLists.txt | 1 + libdistopia/CMakeLists.txt | 66 ++++++++------- libdistopia/src/distopia.cpp | 124 ++++++++++++++-------------- 4 files changed, 130 insertions(+), 93 deletions(-) diff --git a/.github/workflows/make_and_test.yml b/.github/workflows/make_and_test.yml index f77cbf54..3a97c2dd 100644 --- a/.github/workflows/make_and_test.yml +++ b/.github/workflows/make_and_test.yml @@ -98,3 +98,35 @@ jobs: # run python API tests run: pytest distopia/tests + + external_hwy_no_test: + # A conda install, which relies purely on pyproject.toml contents + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python-version: ['3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/conda_envs/distopia_${{ matrix.os }}.yaml + environment-name: distopia + create-args: >- + python==${{ matrix.python-version }} + + - name: install libhwy + run: micromamba install -c conda-forge libhwy + + - name: check_env + run: | + which python + python -m pip list + + - name: build + run: python setup.py build -- -DDISTOPIA_BUILD_TESTS=OFF -DDISTOPIA_USE_EXTERNAL_HWY=ON diff --git a/CMakeLists.txt b/CMakeLists.txt index 941f6b82..a9d463ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ include_directories(${PROJECT_SOURCE_DIR}/libdistopia/include) # setup an option for using external HWY option(DISTOPIA_USE_EXTERNAL_HWY "Use external HWY" OFF) +option(DISTOPIA_BUILD_TESTS "Build tests" ON) # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) diff --git a/libdistopia/CMakeLists.txt b/libdistopia/CMakeLists.txt index d0cebb9a..45228278 100644 --- a/libdistopia/CMakeLists.txt +++ b/libdistopia/CMakeLists.txt @@ -2,8 +2,7 @@ set(HWY_ENABLE_TESTS OFF CACHE BOOL "Enable HWY tests" FORCE) -set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable googlebench tests" FORCE) -add_subdirectory("googlebench") + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -28,45 +27,50 @@ else() add_subdirectory("highway") target_link_libraries(libdistopia PRIVATE hwy) endif() - -add_executable(bench) -target_sources(bench PRIVATE "test/bench.cpp") -target_link_libraries(bench PUBLIC benchmark::benchmark) -target_link_libraries(bench PUBLIC libdistopia) -target_include_directories(bench PUBLIC ${CMAKE_CURRENT_LIST_DIR}) +if(DISTOPIA_BUILD_TESTS) + + set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable googlebench tests" FORCE) + add_subdirectory("googlebench") -Include(GoogleTest) -add_subdirectory("googletest") -enable_testing() -include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) -include_directories(${gmock_SOURCE_DIR}/include ${gmock_SOURCE_DIR}) + add_executable(bench) + target_sources(bench PRIVATE "test/bench.cpp") + target_link_libraries(bench PUBLIC benchmark::benchmark) + target_link_libraries(bench PUBLIC libdistopia) + target_include_directories(bench PUBLIC ${CMAKE_CURRENT_LIST_DIR}) -add_executable(test) -target_sources(test PRIVATE "test/test.cpp") -target_link_libraries(test PUBLIC gtest gtest_main) -target_link_libraries(test PUBLIC gmock gmock_main) + Include(GoogleTest) + add_subdirectory("googletest") + enable_testing() + include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) + include_directories(${gmock_SOURCE_DIR}/include ${gmock_SOURCE_DIR}) -target_link_libraries(test PUBLIC libdistopia) -target_include_directories(test PUBLIC ${CMAKE_SOURCE_DIR}) -gtest_discover_tests(test WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + add_executable(test) + target_sources(test PRIVATE "test/test.cpp") + target_link_libraries(test PUBLIC gtest gtest_main) + target_link_libraries(test PUBLIC gmock gmock_main) -add_executable(targets) -target_sources(targets PRIVATE "test/targets.cpp") -target_link_libraries(targets PUBLIC libdistopia) -target_include_directories(targets PUBLIC ${CMAKE_SOURCE_DIR}) + target_link_libraries(test PUBLIC libdistopia) + target_include_directories(test PUBLIC ${CMAKE_SOURCE_DIR}) + gtest_discover_tests(test WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -add_executable(test_mda_match) -target_sources(test_mda_match PRIVATE "test/test_mda_match.cpp") -target_link_libraries(test_mda_match PUBLIC gtest gtest_main) -target_link_libraries(test PUBLIC gmock gmock_main) -target_link_libraries(test_mda_match PUBLIC libdistopia) -target_include_directories(test_mda_match PUBLIC ${CMAKE_SOURCE_DIR}) -gtest_discover_tests(test_mda_match WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + add_executable(targets) + target_sources(targets PRIVATE "test/targets.cpp") + target_link_libraries(targets PUBLIC libdistopia) + target_include_directories(targets PUBLIC ${CMAKE_SOURCE_DIR}) + + add_executable(test_mda_match) + target_sources(test_mda_match PRIVATE "test/test_mda_match.cpp") + target_link_libraries(test_mda_match PUBLIC gtest gtest_main) + target_link_libraries(test PUBLIC gmock gmock_main) + target_link_libraries(test_mda_match PUBLIC libdistopia) + target_include_directories(test_mda_match PUBLIC ${CMAKE_SOURCE_DIR}) + gtest_discover_tests(test_mda_match WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +endif() # cmake will append the name lib already , avoid liblibdistopia set_target_properties(libdistopia PROPERTIES OUTPUT_NAME distopia) diff --git a/libdistopia/src/distopia.cpp b/libdistopia/src/distopia.cpp index 86862460..9ad61f95 100644 --- a/libdistopia/src/distopia.cpp +++ b/libdistopia/src/distopia.cpp @@ -1482,141 +1482,141 @@ namespace distopia { HWY_EXPORT(GetNFloatLanes); HWY_EXPORT(GetNDoubleLanes); - HWY_DLLEXPORT int GetNFloatLanes() { + int GetNFloatLanes() { return HWY_DYNAMIC_DISPATCH(GetNFloatLanes)(); } - HWY_DLLEXPORT int GetNDoubleLanes() { + int GetNDoubleLanes() { return HWY_DYNAMIC_DISPATCH(GetNDoubleLanes)(); } - HWY_DLLEXPORT template <> void CalcBondsNoBox(const float* a, const float* b, int n, float* out) { + template <> void CalcBondsNoBox(const float* a, const float* b, int n, float* out) { // TODO: Could instead put small problem handling here, if n<16 manually dispatch to non-vector route // Would benefit the codepath in all vector versions return HWY_DYNAMIC_DISPATCH(CalcBondsNoBoxSingle)(a, b, n, out); } - HWY_DLLEXPORT template <> void CalcBondsNoBox(const double* a, const double* b, int n, double* out) { + template <> void CalcBondsNoBox(const double* a, const double* b, int n, double* out) { return HWY_DYNAMIC_DISPATCH(CalcBondsNoBoxDouble)(a, b, n, out); } - HWY_DLLEXPORT template <> void CalcBondsOrtho(const float* a, const float* b, int n, const float *box, float* out) { + template <> void CalcBondsOrtho(const float* a, const float* b, int n, const float *box, float* out) { return HWY_DYNAMIC_DISPATCH(CalcBondsOrthoSingle)(a, b, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsOrtho(const double* a, const double* b, int n, const double *box, double* out) { + template <> void CalcBondsOrtho(const double* a, const double* b, int n, const double *box, double* out) { return HWY_DYNAMIC_DISPATCH(CalcBondsOrthoDouble)(a, b, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsTriclinic(const float* a, const float* b, int n, const float *box, float* out) { + template <> void CalcBondsTriclinic(const float* a, const float* b, int n, const float *box, float* out) { return HWY_DYNAMIC_DISPATCH(CalcBondsTriclinicSingle)(a, b, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsTriclinic(const double* a, const double* b, int n, const double *box, double* out) { + template <> void CalcBondsTriclinic(const double* a, const double* b, int n, const double *box, double* out) { return HWY_DYNAMIC_DISPATCH(CalcBondsTriclinicDouble)(a, b, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesNoBox(const float *a, const float *b, const float *c, int n, float *out) { + template <> void CalcAnglesNoBox(const float *a, const float *b, const float *c, int n, float *out) { return HWY_DYNAMIC_DISPATCH(CalcAnglesNoBoxSingle)(a, b, c, n, out); } - HWY_DLLEXPORT template <> void CalcAnglesNoBox(const double *a, const double *b, const double *c, int n, double *out) { + template <> void CalcAnglesNoBox(const double *a, const double *b, const double *c, int n, double *out) { return HWY_DYNAMIC_DISPATCH(CalcAnglesNoBoxDouble)(a, b, c, n, out); } - HWY_DLLEXPORT template <> void CalcAnglesOrtho(const float *a, const float *b, const float *c, int n, const float *box, float *out) { + template <> void CalcAnglesOrtho(const float *a, const float *b, const float *c, int n, const float *box, float *out) { return HWY_DYNAMIC_DISPATCH(CalcAnglesOrthoSingle)(a, b, c, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesOrtho(const double *a, const double *b, const double *c, int n, const double *box, double *out) { + template <> void CalcAnglesOrtho(const double *a, const double *b, const double *c, int n, const double *box, double *out) { return HWY_DYNAMIC_DISPATCH(CalcAnglesOrthoDouble)(a, b, c, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesTriclinic(const float *a, const float *b, const float *c, int n, const float *box, float *out) { + template <> void CalcAnglesTriclinic(const float *a, const float *b, const float *c, int n, const float *box, float *out) { return HWY_DYNAMIC_DISPATCH(CalcAnglesTriclinicSingle)(a, b, c, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesTriclinic(const double *a, const double *b, const double *c, int n, const double *box, double *out) { + template <> void CalcAnglesTriclinic(const double *a, const double *b, const double *c, int n, const double *box, double *out) { return HWY_DYNAMIC_DISPATCH(CalcAnglesTriclinicDouble)(a, b, c, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsNoBox(const float *a, const float *b, const float *c, const float *d, int n, float *out) { + template <> void CalcDihedralsNoBox(const float *a, const float *b, const float *c, const float *d, int n, float *out) { return HWY_DYNAMIC_DISPATCH(CalcDihedralsNoBoxSingle)(a, b, c, d, n, out); } - HWY_DLLEXPORT template <> void CalcDihedralsNoBox(const double *a, const double *b, const double *c, const double *d, int n, double *out) { + template <> void CalcDihedralsNoBox(const double *a, const double *b, const double *c, const double *d, int n, double *out) { return HWY_DYNAMIC_DISPATCH(CalcDihedralsNoBoxDouble)(a, b, c, d, n, out); } - HWY_DLLEXPORT template <> void CalcDihedralsOrtho(const float *a, const float *b, const float *c, const float *d, int n, const float *box, float *out) { + template <> void CalcDihedralsOrtho(const float *a, const float *b, const float *c, const float *d, int n, const float *box, float *out) { return HWY_DYNAMIC_DISPATCH(CalcDihedralsOrthoSingle)(a, b, c, d, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsOrtho(const double *a, const double *b, const double *c, const double *d, int n, const double *box, double *out) { + template <> void CalcDihedralsOrtho(const double *a, const double *b, const double *c, const double *d, int n, const double *box, double *out) { return HWY_DYNAMIC_DISPATCH(CalcDihedralsOrthoDouble)(a, b, c, d, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsTriclinic(const float *a, const float *b, const float *c, const float *d, int n, const float *box, float *out) { + template <> void CalcDihedralsTriclinic(const float *a, const float *b, const float *c, const float *d, int n, const float *box, float *out) { return HWY_DYNAMIC_DISPATCH(CalcDihedralsTriclinicSingle)(a, b, c, d, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsTriclinic(const double *a, const double *b, const double *c, const double *d, int n, const double *box, double *out) { + template <> void CalcDihedralsTriclinic(const double *a, const double *b, const double *c, const double *d, int n, const double *box, double *out) { return HWY_DYNAMIC_DISPATCH(CalcDihedralsTriclinicDouble)(a, b, c, d, n, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayNoBox(const double *a, const double *b, int na, int nb, double *out) { + template <> void CalcDistanceArrayNoBox(const double *a, const double *b, int na, int nb, double *out) { if (nb < GetNDoubleLanes() ) { return distopia::N_SCALAR::CalcDistanceArrayNoBoxDouble(a, b, na, nb, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayNoBoxDouble)(a, b, na, nb, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayNoBox(const float *a, const float* b, int na, int nb, float *out) { + template <> void CalcDistanceArrayNoBox(const float *a, const float* b, int na, int nb, float *out) { if (nb < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDistanceArrayNoBoxSingle(a, b, na, nb, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayNoBoxSingle)(a, b, na, nb, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayOrtho(const double *a, const double *b, int na, int nb, const double *box, double *out) { + template <> void CalcDistanceArrayOrtho(const double *a, const double *b, int na, int nb, const double *box, double *out) { if (nb < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDistanceArrayOrthoDouble(a, b, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayOrthoDouble)(a, b, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayOrtho(const float *a, const float* b, int na, int nb, const float *box, float *out) { + template <> void CalcDistanceArrayOrtho(const float *a, const float* b, int na, int nb, const float *box, float *out) { if (nb < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDistanceArrayOrthoSingle(a, b, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayOrthoSingle)(a, b, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayTriclinic(const double *a, const double *b, int na, int nb, const double *box, double *out) { + template <> void CalcDistanceArrayTriclinic(const double *a, const double *b, int na, int nb, const double *box, double *out) { if (nb < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDistanceArrayTriclinicDouble(a, b, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayTriclinicDouble)(a, b, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayTriclinic(const float *a, const float* b, int na, int nb, const float *box, float *out) { + template <> void CalcDistanceArrayTriclinic(const float *a, const float* b, int na, int nb, const float *box, float *out) { if (nb < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDistanceArrayTriclinicSingle(a, b, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayTriclinicSingle)(a, b, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayNoBox(const float *a, int n, float *out) { + template <> void CalcSelfDistanceArrayNoBox(const float *a, int n, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayNoBoxSingle(a, n, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayNoBoxSingle)(a, n, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayNoBox(const double *a, int n, double *out) { + template <> void CalcSelfDistanceArrayNoBox(const double *a, int n, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayNoBoxDouble(a, n, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayNoBoxDouble)(a, n, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayOrtho(const float *a, int n, const float *box, float *out) { + template <> void CalcSelfDistanceArrayOrtho(const float *a, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayOrthoSingle(a, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayOrthoSingle)(a, n, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayOrtho(const double *a, int n, const double *box, double *out) { + template <> void CalcSelfDistanceArrayOrtho(const double *a, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayOrthoDouble(a, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayOrthoDouble)(a, n, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayTriclinic(const float *a, int n, const float* box, float *out) { + template <> void CalcSelfDistanceArrayTriclinic(const float *a, int n, const float* box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayTriclinicSingle(a, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayTriclinicSingle)(a, n, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayTriclinic(const double *a, int n, const double *box, double *out) { + template <> void CalcSelfDistanceArrayTriclinic(const double *a, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayTriclinicDouble(a, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayTriclinicDouble)(a, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, + template <> void CalcBondsNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, int n, float *out) { if (n < GetNFloatLanes()) { @@ -1624,49 +1624,49 @@ namespace distopia { } return HWY_DYNAMIC_DISPATCH(CalcBondsNoBoxIdxSingle)(coords, a_idx, b_idx, n, out); } - HWY_DLLEXPORT template <> void CalcBondsNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, + template <> void CalcBondsNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, int n, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcBondsNoBoxIdxDouble(coords, a_idx, b_idx, n, out); } return HWY_DYNAMIC_DISPATCH(CalcBondsNoBoxIdxDouble)(coords, a_idx, b_idx, n, out); } - HWY_DLLEXPORT template <> void CalcBondsOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, + template <> void CalcBondsOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcBondsOrthoIdxSingle(coords, a_idx, b_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcBondsOrthoIdxSingle)(coords, a_idx, b_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, + template <> void CalcBondsOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcBondsOrthoIdxDouble(coords, a_idx, b_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcBondsOrthoIdxDouble)(coords, a_idx, b_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, + template <> void CalcBondsTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcBondsTriclinicIdxSingle(coords, a_idx, b_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcBondsTriclinicIdxSingle)(coords, a_idx, b_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcBondsTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, + template <> void CalcBondsTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcBondsTriclinicIdxDouble(coords, a_idx, b_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcBondsTriclinicIdxDouble)(coords, a_idx, b_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, + template <> void CalcAnglesNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcAnglesNoBoxIdxSingle(coords, a_idx, b_idx, c_idx, n, out); } return HWY_DYNAMIC_DISPATCH(CalcAnglesNoBoxIdxSingle)(coords, a_idx, b_idx, c_idx, n, out); } - HWY_DLLEXPORT template <> void CalcAnglesNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, + template <> void CalcAnglesNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcAnglesNoBoxIdxDouble(coords, a_idx, b_idx, c_idx, n, out); @@ -1676,143 +1676,143 @@ namespace distopia { } return HWY_DYNAMIC_DISPATCH(CalcAnglesNoBoxIdxDouble)(coords, a_idx, b_idx, c_idx, n, out); } - HWY_DLLEXPORT template <> void CalcAnglesOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, + template <> void CalcAnglesOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcAnglesOrthoIdxSingle(coords, a_idx, b_idx, c_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcAnglesOrthoIdxSingle)(coords, a_idx, b_idx, c_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, + template <> void CalcAnglesOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcAnglesOrthoIdxDouble(coords, a_idx, b_idx, c_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcAnglesOrthoIdxDouble)(coords, a_idx, b_idx, c_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, + template <> void CalcAnglesTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcAnglesTriclinicIdxSingle(coords, a_idx, b_idx, c_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcAnglesTriclinicIdxSingle)(coords, a_idx, b_idx, c_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcAnglesTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, + template <> void CalcAnglesTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcAnglesTriclinicIdxDouble(coords, a_idx, b_idx, c_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcAnglesTriclinicIdxDouble)(coords, a_idx, b_idx, c_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, + template <> void CalcDihedralsNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDihedralsNoBoxIdxSingle(coords, a_idx, b_idx, c_idx, d_idx, n, out); } return HWY_DYNAMIC_DISPATCH(CalcDihedralsNoBoxIdxSingle)(coords, a_idx, b_idx, c_idx, d_idx, n, out); } - HWY_DLLEXPORT template <> void CalcDihedralsNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, + template <> void CalcDihedralsNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDihedralsNoBoxIdxDouble(coords, a_idx, b_idx, c_idx, d_idx, n, out); } return HWY_DYNAMIC_DISPATCH(CalcDihedralsNoBoxIdxDouble)(coords, a_idx, b_idx, c_idx, d_idx, n, out); } - HWY_DLLEXPORT template <> void CalcDihedralsOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, + template <> void CalcDihedralsOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDihedralsOrthoIdxSingle(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDihedralsOrthoIdxSingle)(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, + template <> void CalcDihedralsOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDihedralsOrthoIdxDouble(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDihedralsOrthoIdxDouble)(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, + template <> void CalcDihedralsTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDihedralsTriclinicIdxSingle(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDihedralsTriclinicIdxSingle)(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcDihedralsTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, + template <> void CalcDihedralsTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, const int *c_idx, const int *d_idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDihedralsTriclinicIdxDouble(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDihedralsTriclinicIdxDouble)(coords, a_idx, b_idx, c_idx, d_idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, int na, int nb, float *out) { + template <> void CalcDistanceArrayNoBoxIdx(const float *coords, const int *a_idx, const int *b_idx, int na, int nb, float *out) { if (nb < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDistanceArrayNoBoxIdxSingle(coords, a_idx, b_idx, na, nb, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayNoBoxIdxSingle)(coords, a_idx, b_idx, na, nb, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, int na, int nb, double *out) { + template <> void CalcDistanceArrayNoBoxIdx(const double *coords, const int *a_idx, const int *b_idx, int na, int nb, double *out) { if (nb < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDistanceArrayNoBoxIdxDouble(coords, a_idx, b_idx, na, nb, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayNoBoxIdxDouble)(coords, a_idx, b_idx, na, nb, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, int na, int nb, const float *box, float *out) { + template <> void CalcDistanceArrayOrthoIdx(const float *coords, const int *a_idx, const int *b_idx, int na, int nb, const float *box, float *out) { if (nb < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDistanceArrayOrthoIdxSingle(coords, a_idx, b_idx, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayOrthoIdxSingle)(coords, a_idx, b_idx, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, int na, int nb, const double *box, double *out) { + template <> void CalcDistanceArrayOrthoIdx(const double *coords, const int *a_idx, const int *b_idx, int na, int nb, const double *box, double *out) { if (nb < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDistanceArrayOrthoIdxDouble(coords, a_idx, b_idx, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayOrthoIdxDouble)(coords, a_idx, b_idx, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, int na, int nb, const float *box, float *out) { + template <> void CalcDistanceArrayTriclinicIdx(const float *coords, const int *a_idx, const int *b_idx, int na, int nb, const float *box, float *out) { if (nb < GetNFloatLanes()) { return distopia::N_SCALAR::CalcDistanceArrayTriclinicIdxSingle(coords, a_idx, b_idx, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayTriclinicIdxSingle)(coords, a_idx, b_idx, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcDistanceArrayTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, int na, int nb, const double *box, double *out) { + template <> void CalcDistanceArrayTriclinicIdx(const double *coords, const int *a_idx, const int *b_idx, int na, int nb, const double *box, double *out) { if (nb < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcDistanceArrayTriclinicIdxDouble(coords, a_idx, b_idx, na, nb, box, out); } return HWY_DYNAMIC_DISPATCH(CalcDistanceArrayTriclinicIdxDouble)(coords, a_idx, b_idx, na, nb, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayNoBoxIdx(const float *coords, const int *idx, int n, float *out) { + template <> void CalcSelfDistanceArrayNoBoxIdx(const float *coords, const int *idx, int n, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayNoBoxIdxSingle(coords, idx, n, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayNoBoxIdxSingle)(coords, idx, n, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayNoBoxIdx(const double *coords, const int *idx, int n, double *out) { + template <> void CalcSelfDistanceArrayNoBoxIdx(const double *coords, const int *idx, int n, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayNoBoxIdxDouble(coords, idx, n, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayNoBoxIdxDouble)(coords, idx, n, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayOrthoIdx(const float *coords, const int *idx, int n, const float *box, float *out) { + template <> void CalcSelfDistanceArrayOrthoIdx(const float *coords, const int *idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayOrthoIdxSingle(coords, idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayOrthoIdxSingle)(coords, idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayOrthoIdx(const double *coords, const int *idx, int n, const double *box, double *out) { + template <> void CalcSelfDistanceArrayOrthoIdx(const double *coords, const int *idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayOrthoIdxDouble(coords, idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayOrthoIdxDouble)(coords, idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayTriclinicIdx(const float *coords, const int *idx, int n, const float *box, float *out) { + template <> void CalcSelfDistanceArrayTriclinicIdx(const float *coords, const int *idx, int n, const float *box, float *out) { if (n < GetNFloatLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayTriclinicIdxSingle(coords, idx, n, box, out); } return HWY_DYNAMIC_DISPATCH(CalcSelfDistanceArrayTriclinicIdxSingle)(coords, idx, n, box, out); } - HWY_DLLEXPORT template <> void CalcSelfDistanceArrayTriclinicIdx(const double *coords, const int *idx, int n, const double *box, double *out) { + template <> void CalcSelfDistanceArrayTriclinicIdx(const double *coords, const int *idx, int n, const double *box, double *out) { if (n < GetNDoubleLanes()) { return distopia::N_SCALAR::CalcSelfDistanceArrayTriclinicIdxDouble(coords, idx, n, box, out); }