We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90f7bd6 commit 0d442b1Copy full SHA for 0d442b1
include/matx/core/iterator.h
@@ -98,7 +98,15 @@ struct RandomOperatorIterator {
98
99
[[nodiscard]] __MATX_INLINE__ __MATX_HOST__ __MATX_DEVICE__ value_type operator[](difference_type offset) const
100
{
101
- return *self_type{t_, offset_ + offset};
+ if constexpr (OperatorType::Rank() == 0) {
102
+ return static_cast<value_type>(t_.operator()());
103
+ }
104
+ else {
105
+ auto arrs = detail::GetIdxFromAbs(t_, offset_+offset);
106
+ return cuda::std::apply([&](auto &&...args) {
107
+ return static_cast<value_type>(t_.operator()(args...));
108
+ }, arrs);
109
110
}
111
112
__MATX_INLINE__ __MATX_HOST__ __MATX_DEVICE__ self_type operator++(int)
0 commit comments