Skip to content

Commit 7d29bfb

Browse files
authored
use alpaka::concepts::IndexVec where it is useful (#460)
1 parent 6b0d8a6 commit 7d29bfb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/alpaka/SimdPtr.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
#include "alpaka/Vec.hpp"
99
#include "alpaka/internal/interface.hpp"
1010
#include "alpaka/mem/Alignment.hpp"
11-
#include "alpaka/mem/concepts/IDataStorage.hpp"
1211
#include "alpaka/mem/concepts/IMdSpan.hpp"
12+
#include "alpaka/mem/concepts/IndexVec.hpp"
1313
#include "alpaka/trait.hpp"
1414

15-
#include <array>
1615
#include <concepts>
1716
#include <cstdint>
1817
#include <type_traits>
@@ -82,7 +81,7 @@ namespace alpaka
8281
*
8382
* @{
8483
*/
85-
constexpr auto operator[](alpaka::concepts::Vector auto const& idx) const
84+
constexpr auto operator[](alpaka::concepts::IndexVec<IdxType, T_MdSpan::dim()> auto const& idx) const
8685
{
8786
constexpr uint32_t valueAlignment = static_cast<uint32_t>(alignof(value_type));
8887
constexpr auto align = Alignment<valueAlignment>{};
@@ -93,7 +92,7 @@ namespace alpaka
9392
T_SimdWidth{}};
9493
}
9594

96-
constexpr auto operator[](alpaka::concepts::Vector auto const& idx)
95+
constexpr auto operator[](alpaka::concepts::IndexVec<IdxType, T_MdSpan::dim()> auto const& idx)
9796
{
9897
constexpr uint32_t valueAlignment = static_cast<uint32_t>(alignof(value_type));
9998
constexpr auto align = Alignment<valueAlignment>{};

include/alpaka/mem/LinearizedIdxGenerator.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "alpaka/Simd.hpp"
88
#include "alpaka/internal/interface.hpp"
99
#include "alpaka/mem/DataPitches.hpp"
10+
#include "alpaka/mem/concepts/IndexVec.hpp"
1011

1112
namespace alpaka
1213
{
@@ -41,7 +42,7 @@ namespace alpaka
4142
* @param idx n-dimensional offset, range [0, extents)
4243
* @return linearized index
4344
*/
44-
constexpr value_type operator[](alpaka::concepts::Vector auto const& idx) const
45+
constexpr value_type operator[](alpaka::concepts::IndexVec<T_IndexType, T_dim> auto const& idx) const
4546
{
4647
return linearize(m_extents, idx);
4748
}
@@ -51,7 +52,7 @@ namespace alpaka
5152
* @param idx n-dimensional offset, range [0, extents)
5253
* @return linearized index
5354
*/
54-
constexpr value_type operator[](alpaka::concepts::Vector auto const& idx)
55+
constexpr value_type operator[](alpaka::concepts::IndexVec<T_IndexType, T_dim> auto const& idx)
5556
{
5657
return linearize(m_extents, idx);
5758
}

0 commit comments

Comments
 (0)