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

Fix nvcc warnings #1108

Draft
wants to merge 2 commits into
base: master
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 .jenkins/continuous.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pipeline {
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER=$KOKKOS_DIR/bin/nvcc_wrapper \
-D CMAKE_CXX_EXTENSIONS=OFF \
-D CMAKE_CXX_FLAGS="-Wpedantic -Wall -Wextra" \
-D CMAKE_CXX_FLAGS="-Wpedantic -Wall -Wextra -Werror -Werror all-warnings" \
-D CMAKE_PREFIX_PATH="$KOKKOS_DIR;$BOOST_DIR;$BENCHMARK_DIR" \
-D ARBORX_ENABLE_MPI=ON \
-D MPIEXEC_PREFLAGS="--allow-run-as-root" \
Expand Down
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
Loading