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

Revert broadcasting changes to concat #890

Merged
merged 1 commit into from
Feb 25, 2025
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