Skip to content

Commit 1707c60

Browse files
committed
fix consistency of structure methods
1 parent 1ed0c4b commit 1707c60

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

include/noarr/structures/interop/cuda_traverser.cuh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef NOARR_STRUCTURES_CUDA_TRAVERSER_HPP
22
#define NOARR_STRUCTURES_CUDA_TRAVERSER_HPP
33

4-
#include <cstddef>
5-
64
#include "../base/contain.hpp"
75
#include "../base/state.hpp"
86
#include "../base/structs_common.hpp"
@@ -95,7 +93,7 @@ struct cuda_fix_t : strict_contain<T> {
9593
template<IsState State>
9694
requires (has_size<State>())
9795
[[nodiscard]]
98-
__device__ inline std::size_t size(State state) const noexcept {
96+
__device__ inline auto size(State state) const noexcept {
9997
return sub_structure().size(sub_state(state));
10098
}
10199

@@ -115,7 +113,7 @@ struct cuda_fix_t : strict_contain<T> {
115113
template<class Sub, IsState State, class Start = constexpr_arithmetic::make_const<0>>
116114
requires (has_offset_of<Sub, cuda_fix_t, State>())
117115
[[nodiscard]]
118-
__device__ inline std::size_t strict_offset_of(State state, Start start = Start{}) const noexcept {
116+
__device__ inline auto strict_offset_of(State state, Start start = Start{}) const noexcept {
119117
return offset_of<Sub>(sub_structure(), sub_state(state), start);
120118
}
121119

@@ -129,7 +127,7 @@ struct cuda_fix_t : strict_contain<T> {
129127
template<IsDim auto QDim, IsState State>
130128
requires (has_length<QDim, State>())
131129
[[nodiscard]]
132-
__device__ inline std::size_t length(State state) const noexcept {
130+
__device__ inline auto length(State state) const noexcept {
133131
return sub_structure().template length<QDim>(sub_state(state));
134132
}
135133

include/noarr/structures/structs/slice.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct shift_t : strict_contain<T, StartT> {
154154
}
155155

156156
template<auto QDim, IsState State>
157-
requires IsDim<decltype(QDim)>
157+
requires (has_length<QDim, State>())
158158
[[nodiscard]]
159159
constexpr auto length(State state) const noexcept {
160160
using namespace constexpr_arithmetic;
@@ -788,7 +788,7 @@ struct reverse_t : strict_contain<T> {
788788
}
789789

790790
template<auto QDim, IsState State>
791-
requires IsDim<decltype(QDim)>
791+
requires (has_length<QDim, State>())
792792
[[nodiscard]]
793793
constexpr auto length(State state) const noexcept {
794794
return sub_structure().template length<QDim>(state);

include/noarr/structures/structs/zcurve.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ struct merge_zcurve_t : strict_contain<T> {
263263
}
264264

265265
template<auto QDim, IsState State>
266-
requires IsDim<decltype(QDim)>
266+
requires (has_length<QDim, State>())
267267
[[nodiscard]]
268268
constexpr auto length(State state) const noexcept {
269269
if constexpr (QDim == Dim) {

0 commit comments

Comments
 (0)