Skip to content
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 core/include/detray/core/detail/single_store.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Detray library, part of the ACTS project (R&D line)
*
* (c) 2022-2023 CERN for the benefit of the ACTS project
* (c) 2022-2026 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -118,13 +118,17 @@ class single_store {
/// @returns the collections iterator at the start position
DETRAY_HOST_DEVICE
constexpr auto begin(const context_type &ctx = {}) const {
return m_container.begin() + ctx.get() * m_context_size;
return m_container.begin() +
static_cast<std::iter_difference_t<const_iterator>>(
ctx.get() * m_context_size);
}

/// @returns the collections iterator sentinel
DETRAY_HOST_DEVICE
constexpr auto end(const context_type &ctx = {}) const {
return m_container.begin() + (ctx.get() + 1) * m_context_size;
return m_container.begin() +
static_cast<std::iter_difference_t<const_iterator>>(
(ctx.get() + 1) * m_context_size);
}

/// @returns access to the underlying container - const
Expand Down
6 changes: 3 additions & 3 deletions core/include/detray/utils/type_list.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Detray library, part of the ACTS project (R&D line)
*
* (c) 2023-2025 CERN for the benefit of the ACTS project
* (c) 2023-2026 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -104,8 +104,8 @@ struct get_at {};

template <std::size_t N, typename T, typename... Ts>
struct get_at<N, list<T, Ts...>> {
using type =
std::remove_cvref_t<decltype(detray::get<N>(dtuple<T, Ts...>{}))>;
using type = std::remove_cvref_t<decltype(detray::get<N>(
std::declval<dtuple<T, Ts...>>()))>;
};
template <typename L, std::size_t N>
using at = typename get_at<N, L>::type;
Expand Down
11 changes: 7 additions & 4 deletions tests/unit_tests/device/cuda/sf_finders_grid_cuda.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Detray library, part of the ACTS project (R&D line)
*
* (c) 2022-2024 CERN for the benefit of the ACTS project
* (c) 2022-2026 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -234,7 +234,8 @@ TEST(grids_cuda, grid2_complete_populator) {
// Other point with which the bin has been completed
const scalar gbin_f{static_cast<scalar>(gbin)};
const point3 tp{axis_r.min() + gbin_f * width_r,
axis_phi.min() + gbin_f * width_phi, 0.5};
axis_phi.min() + gbin_f * width_phi,
static_cast<scalar>(0.5)};

// Go through all points and compare
int pt_idx{0};
Expand Down Expand Up @@ -312,7 +313,8 @@ TEST(grids_cuda, grid2_attach_populator) {
// Other point with which the bin has been completed
const scalar gbin_f{static_cast<scalar>(gbin)};
const point3 tp{axis_r.min() + gbin_f * width_r,
axis_phi.min() + gbin_f * width_phi, 0.5};
axis_phi.min() + gbin_f * width_phi,
static_cast<scalar>(0.5)};

// Go through all points and compare
int pt_idx{0};
Expand Down Expand Up @@ -422,7 +424,8 @@ TEST(grids_cuda, grid2_dynamic_attach_populator) {
// Other point with which the bin has been completed
const scalar gbin_f{static_cast<scalar>(gbin)};
const point3 tp{axis_r.min() + gbin_f * width_r,
axis_phi.min() + gbin_f * width_phi, 0.5};
axis_phi.min() + gbin_f * width_phi,
static_cast<scalar>(0.5)};

// Go through all points and compare
int pt_idx{0};
Expand Down
Loading