Skip to content
Merged
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
13 changes: 5 additions & 8 deletions include/matx/operators/concat.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,48 +91,45 @@ namespace matx
}
}




template <int I = 0, int N>
__MATX_INLINE__ __MATX_DEVICE__ __MATX_HOST__ auto GetVal(cuda::std::array<index_t,RANK> &indices) const {

if constexpr ( I == N ) {
// This should never happen
return value_type{};
// returning this to satisfy lvalue requirements
} else {
const auto &op = cuda::std::get<I>(ops_);
auto idx = indices[axis_];
auto size = op.Size(axis_);
// If in range of this operator
if(idx < size) {
// evaluate operator
return get_value(cuda::std::forward<decltype(op)>(op), indices);
return cuda::std::apply(op, indices);
} else {
// otherwise remove this operator and recurse
indices[axis_] -= size;
return GetVal<I+1, N>(indices);
}
}
}



template <int I = 0, int N>
__MATX_INLINE__ __MATX_DEVICE__ __MATX_HOST__ decltype(auto) GetVal(cuda::std::array<index_t,RANK> &indices) {

if constexpr ( I == N ) {
// This should never happen
// returning this to satisfy lvalue requirements
auto &op = cuda::std::get<I-1>(ops_);
return get_value(cuda::std::forward<decltype(op)>(op), indices);
return cuda::std::apply(op, indices);
} else {
auto &op = cuda::std::get<I>(ops_);
auto idx = indices[axis_];
auto size = op.Size(axis_);
// If in range of this operator
if(idx < size) {
// evaluate operator
return get_value(cuda::std::forward<decltype(op)>(op), indices);
return cuda::std::apply(op, indices);
} else {
// otherwise remove this operator and recurse
indices[axis_] -= size;
Expand Down