Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt a Windows build #90

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
# TODO: add windows builder
os: [ubuntu-20.04, macos-11]
os: [ubuntu-20.04, macos-11, windows-2019]

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
include:
- os: ubuntu-20.04
- os: macos-11
- os: windows-2019
steps:
- uses: actions/checkout@v3

Expand Down
15 changes: 12 additions & 3 deletions sphericart/include/templates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
*/

#include <cmath>
#include <vector>

#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif

#ifndef M_SQRT1_2
#define M_SQRT1_2 0.707106781186547524400844362104849039
#endif

#ifdef _OPENMP

Expand Down Expand Up @@ -303,7 +310,8 @@ void hardcoded_sph(
T *ddsph_i = nullptr;

#pragma omp for
for (size_t i_sample = 0; i_sample < n_samples; i_sample++) {
for (int64_t i_sample = 0; i_sample < static_cast<int64_t>(n_samples);
i_sample++) {
// gets pointers to the current sample input and output arrays
xyz_i = xyz + i_sample * 3;
sph_i = sph + i_sample * size_y;
Expand Down Expand Up @@ -1058,7 +1066,8 @@ void generic_sph(const T *xyz, T *sph, [[maybe_unused]] T *dsph,
T *ddsph_i = nullptr;

#pragma omp for
for (size_t i_sample = 0; i_sample < n_samples; i_sample++) {
for (int64_t i_sample = 0; i_sample < static_cast<int64_t>(n_samples);
i_sample++) {
auto xyz_i = xyz + i_sample * 3;
// pointer to the segment that should store the i_sample sph
sph_i = sph + i_sample * size_y;
Expand Down
9 changes: 5 additions & 4 deletions sphericart/src/sphericart_cuda_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ SphericalHarmonics<T>::SphericalHarmonics(size_t l_max, bool normalized) {}
template <typename T> SphericalHarmonics<T>::~SphericalHarmonics() {}

template <typename T>
void SphericalHarmonics<T>::compute(const T *xyz, const size_t nsamples,
bool compute_with_gradients,
bool compute_with_hessian, T *sph, T *dsph,
T *ddsph, void *cuda_stream) {
void SphericalHarmonics<T>::compute(const T * /*xyz*/, size_t /*nsamples*/,
bool /*compute_with_gradients*/,
bool /*compute_with_hessian*/, T * /*sph*/,
T * /*dsph*/, T * /*ddsph*/,
void * /*cuda_stream*/) {
throw std::runtime_error("sphericart was not compiled with CUDA support");
}

Expand Down
Loading