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

Make Kokkos code compatible with C++20 #649

Merged
merged 1 commit into from
Jul 23, 2024
Merged
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
10 changes: 7 additions & 3 deletions device/kokkos/src/seeding/spacepoint_binning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ spacepoint_binning::output_type spacepoint_binning::operator()(
const unsigned int num_threads = 32 * 8;
const unsigned int num_blocks = (sp_size + num_threads - 1) / num_threads;

// Hack to avoid warnings thrown by C++20
seedfinder_config config = m_config;
auto axes = m_axes;

Kokkos::parallel_for(
"count_grid_capacities", team_policy(num_blocks, Kokkos::AUTO),
KOKKOS_LAMBDA(const member_type& team_member) {
Expand All @@ -55,7 +59,7 @@ spacepoint_binning::output_type spacepoint_binning::operator()(
device::count_grid_capacities(
team_member.league_rank() * team_member.team_size() +
thr,
m_config, m_axes.first, m_axes.second, spacepoints_view,
config, axes.first, axes.second, spacepoints_view,
grid_capacities_view);
});
});
Expand Down Expand Up @@ -84,12 +88,12 @@ spacepoint_binning::output_type spacepoint_binning::operator()(
device::populate_grid(
team_member.league_rank() * team_member.team_size() +
thr,
m_config, spacepoints_view, grid_view);
config, spacepoints_view, grid_view);
});
});

// Return the freshly filled buffer.
return grid_buffer;
}

} // namespace traccc::kokkos
} // namespace traccc::kokkos
4 changes: 3 additions & 1 deletion extern/kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ message( STATUS "Building Kokkos as part of the TRACCC project" )

# Declare where to get Kokkos from.
set( TRACCC_KOKKOS_SOURCE
"URL;https://github.com/kokkos/kokkos/archive/refs/tags/3.7.00.tar.gz;URL_MD5;84991eca9f066383abe119a5bc7a11c4"
"URL;https://github.com/kokkos/kokkos/archive/refs/tags/4.3.01.tar.gz;URL_MD5;243de871b3dc2cf3990c1c404032df83"
CACHE STRING "Source for Kokkos, when built as part of this project" )
mark_as_advanced( TRACCC_KOKKOS_SOURCE )
FetchContent_Declare( Kokkos ${TRACCC_KOKKOS_SOURCE} )

# Default options for the Kokkos build.
set( Kokkos_ENABLE_SERIAL TRUE CACHE BOOL
"Enable the serial backend of Kokkos" )
set( BUILD_SHARED_LIBS TRUE CACHE BOOL
"Enable building of shared libs in Kokkos" )

# Get it into the current directory.
FetchContent_MakeAvailable( Kokkos )
Expand Down
Loading