Skip to content

Commit

Permalink
Fix warnings for nvcc
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Jun 13, 2024
1 parent a403dad commit 2f0e70c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ KOKKOS_FUNCTION constexpr std::size_t polynomialBasisSize()
static_assert(DIM > 0, "Polynomial basis with no dimension is invalid");

std::size_t result = 1;
for (std::size_t k = 0; k < Kokkos::min(DIM, Degree); ++k)
result = result * (DIM + Degree - k) / (k + 1);

constexpr auto D = Kokkos::min(DIM, Degree);
if constexpr (D > 0)
{
for (std::size_t k = 0; k < D; ++k)
result = result * (DIM + Degree - k) / (k + 1);
}
return result;
}

Expand Down
2 changes: 2 additions & 0 deletions test/tstCompileOnlyAccessTraits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ void test_access_traits_compile_only()
struct CustomIndex
{
char index;

KOKKOS_FUNCTION
CustomIndex(int i) { index = i; }
};
auto q_with_custom_indices =
Expand Down
2 changes: 1 addition & 1 deletion test/tstDendrogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(dendrogram_boruvka, DeviceType,

auto permute = sortObjects(space, weights);

Kokkos::View<unsigned *, MemorySpace> inv_permute(
Kokkos::View<int *, MemorySpace> inv_permute(
Kokkos::view_alloc(space, Kokkos::WithoutInitializing,
"Testing::inv_permute"),
n - 1);
Expand Down
6 changes: 6 additions & 0 deletions test/tstQueryTreeCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(callback_nearest_predicate, TreeTypeTraits,
Kokkos::RangePolicy<ExecutionSpace>(0, n), KOKKOS_LAMBDA(int i) {
points(i) = {{(float)i, (float)i, (float)i}};
});
#ifdef KOKKOS_COMPILER_NVCC
[[maybe_unused]]
#endif
ArborX::Point const origin = {{0., 0., 0.}};

auto values = initialize_values(points, /*delta*/ 0.f);
Expand Down Expand Up @@ -308,6 +311,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(callback_with_attachment_nearest_predicate,
points(i) = {{(float)i, (float)i, (float)i}};
});
float const delta = 5.f;
#ifdef KOKKOS_COMPILER_NVCC
[[maybe_unused]]
#endif
ArborX::Point const origin = {{0., 0., 0.}};

auto values = initialize_values(points, delta);
Expand Down

0 comments on commit 2f0e70c

Please sign in to comment.