-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix compile errors with MSVC(alternative to #904) #908
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: github-windows | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{github.event_name == 'pull_request'}} | ||
|
||
jobs: | ||
windows-threads: | ||
name: Windows Threads | ||
runs-on: windows-2022 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies via vcpkg | ||
uses: johnwason/vcpkg-action@v5 | ||
id: vcpkg | ||
with: | ||
pkgs: boost-test boost-program-options boost-geometry benchmark | ||
triplet: x64-windows-release | ||
token: ${{ github.token }} | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: kokkos/kokkos | ||
ref: 4.0.00 | ||
path: ${GITHUB_WORKSPACE}/../kokkos | ||
- name: Install Kokkos | ||
shell: bash | ||
working-directory: ${GITHUB_WORKSPACE}/../kokkos | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -D CMAKE_INSTALL_PREFIX=C:\kokkos-install \ | ||
-D Kokkos_ENABLE_THREADS=ON \ | ||
.. | ||
cmake --build . --target install -- -m | ||
- name: Configure ArborX | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="/EHsc /bigobj" -DKokkos_ROOT="C:\kokkos-install" ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} -DARBORX_ENABLE_MPI=OFF -DARBORX_ENABLE_TESTS=ON -DARBORX_ENABLE_EXAMPLES=ON -DARBORX_ENABLE_BENCHMARKS=ON .. | ||
- name: Build ArborX | ||
shell: bash | ||
run: | | ||
cmake --build build --target install -- -m | ||
cd build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,16 @@ find_package(benchmark 1.5.4 REQUIRED) | |
message(STATUS "Found benchmark: ${benchmark_DIR} (version \"${benchmark_VERSION}\")") | ||
|
||
add_subdirectory(brute_force_vs_bvh) | ||
add_subdirectory(bvh_driver) | ||
add_subdirectory(dbscan) | ||
add_subdirectory(develop) | ||
add_subdirectory(execution_space_instances) | ||
add_subdirectory(union_find) | ||
if(NOT WIN32) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a |
||
# FIXME: for now, skip the benchmarks using Google benchmark | ||
# when building for Windows, as we have trouble linking it | ||
# with the installed version of the Google benchmark | ||
add_subdirectory(bvh_driver) | ||
add_subdirectory(develop) | ||
add_subdirectory(union_find) | ||
endif() | ||
|
||
if (ARBORX_ENABLE_MPI) | ||
add_subdirectory(distributed_tree_driver) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
#include <algorithm> | ||
#include <iostream> | ||
#include <numeric> | ||
#include <random> | ||
#include <tuple> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,7 +172,6 @@ BOOST_AUTO_TEST_CASE(intersects_box) | |
{ \ | ||
float t0; \ | ||
float t1; \ | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; \ | ||
BOOST_TEST(!ArborX::Experimental::intersection(ray, box, t0, t1)); \ | ||
BOOST_TEST((t0 == inf || t1 == -inf)); \ | ||
} while (false) | ||
|
@@ -182,6 +181,12 @@ BOOST_AUTO_TEST_CASE(ray_box_intersection, *boost::unit_test::tolerance(1e-6f)) | |
using ArborX::Box; | ||
using ArborX::Experimental::Ray; | ||
|
||
#ifdef _MSC_VER | ||
auto const inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#else | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#endif | ||
|
||
constexpr Box unit_box{{0, 0, 0}, {1, 1, 1}}; | ||
|
||
auto const sqrtf_5 = std::sqrt(5.f); | ||
|
@@ -250,9 +255,15 @@ BOOST_AUTO_TEST_CASE(ray_box_distance) | |
{ | ||
using ArborX::Box; | ||
using ArborX::Experimental::Ray; | ||
|
||
// use const instead of constexpr because MSVC shows error(error:expression | ||
// must have a constant value) | ||
constexpr Box unit_box{{0, 0, 0}, {1, 1, 1}}; | ||
|
||
#ifdef _MSC_VER | ||
auto const inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should still be |
||
#else | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#endif | ||
|
||
// clang-format off | ||
// origin is within the box | ||
|
@@ -347,7 +358,6 @@ BOOST_AUTO_TEST_CASE(overlap_distance_sphere, | |
{ \ | ||
float t0; \ | ||
float t1; \ | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; \ | ||
BOOST_TEST(!ArborX::Experimental::intersection(ray, sphere, t0, t1)); \ | ||
BOOST_TEST((t0 == inf && t1 == -inf)); \ | ||
} while (false) | ||
|
@@ -359,10 +369,15 @@ BOOST_AUTO_TEST_CASE(ray_sphere_intersection, | |
using ArborX::Experimental::Ray; | ||
|
||
constexpr Sphere unit_sphere{{0, 0, 0}, 1}; | ||
|
||
auto const sqrtf_3 = std::sqrt(3.f); | ||
auto const sqrtf_2 = std::sqrt(2.f); | ||
|
||
#ifdef _MSC_VER | ||
auto const inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#else | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#endif | ||
|
||
// clang-format off | ||
// hit center of the sphere | ||
ARBORX_TEST_RAY_SPHERE_INTERSECTION((Ray{{-2, 0, 0}, {1, 0, 0}}), unit_sphere, 1.f, 3.f); | ||
|
@@ -471,7 +486,6 @@ BOOST_AUTO_TEST_CASE(intersects_triangle) | |
{ \ | ||
float t0; \ | ||
float t1; \ | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; \ | ||
BOOST_TEST(!ArborX::Experimental::intersection(ray, triangle, t0, t1)); \ | ||
BOOST_TEST((t0 == inf && t1 == -inf)); \ | ||
} while (false) | ||
|
@@ -483,6 +497,12 @@ BOOST_AUTO_TEST_CASE(ray_triangle_intersection, | |
using ArborX::ExperimentalHyperGeometry::Point; | ||
using ArborX::ExperimentalHyperGeometry::Triangle; | ||
|
||
#ifdef _MSC_VER | ||
auto const inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#else | ||
constexpr auto inf = KokkosExt::ArithmeticTraits::infinity<float>::value; | ||
#endif | ||
|
||
constexpr Triangle unit_triangle{Point{0, 0, 0}, Point{1, 0, 0}, | ||
Point{0, 1, 0}}; | ||
constexpr Triangle narrow_triangle{Point{0.5f, 0.5f, 0}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We build but we don't actually run anything. Is that an oversight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we have problems with boost at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just Boost.Test or also Boost.Program_options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had issue with both. They both need to be compiled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that #902 successfully ran tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand that comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#902 had
and ran the tests (without enabling benchmarks).