@@ -91,48 +91,45 @@ namespace matx
91
91
}
92
92
}
93
93
94
-
95
-
96
-
97
94
template <int I = 0 , int N>
98
95
__MATX_INLINE__ __MATX_DEVICE__ __MATX_HOST__ auto GetVal (cuda::std::array<index_t ,RANK> &indices) const {
99
96
100
97
if constexpr ( I == N ) {
101
98
// This should never happen
102
99
return value_type{};
103
- // returning this to satisfy lvalue requirements
104
100
} else {
105
101
const auto &op = cuda::std::get<I>(ops_);
106
102
auto idx = indices[axis_];
107
103
auto size = op.Size (axis_);
108
104
// If in range of this operator
109
105
if (idx < size) {
110
106
// evaluate operator
111
- return get_value ( cuda::std::forward< decltype (op)>(op) , indices);
107
+ return cuda::std::apply (op, indices);
112
108
} else {
113
109
// otherwise remove this operator and recurse
114
110
indices[axis_] -= size;
115
111
return GetVal<I+1 , N>(indices);
116
112
}
117
113
}
118
114
}
119
-
115
+
116
+
120
117
template <int I = 0 , int N>
121
118
__MATX_INLINE__ __MATX_DEVICE__ __MATX_HOST__ decltype (auto ) GetVal(cuda::std::array<index_t ,RANK> &indices) {
122
119
123
120
if constexpr ( I == N ) {
124
121
// This should never happen
125
122
// returning this to satisfy lvalue requirements
126
123
auto &op = cuda::std::get<I-1 >(ops_);
127
- return get_value ( cuda::std::forward< decltype (op)>(op) , indices);
124
+ return cuda::std::apply (op, indices);
128
125
} else {
129
126
auto &op = cuda::std::get<I>(ops_);
130
127
auto idx = indices[axis_];
131
128
auto size = op.Size (axis_);
132
129
// If in range of this operator
133
130
if (idx < size) {
134
131
// evaluate operator
135
- return get_value ( cuda::std::forward< decltype (op)>(op) , indices);
132
+ return cuda::std::apply (op, indices);
136
133
} else {
137
134
// otherwise remove this operator and recurse
138
135
indices[axis_] -= size;
0 commit comments