On span parameter pack and iterators #28
kannavkm
started this conversation in
Project Subtensor
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The main reason for keeping span types as a parameter pack is that they can be extended to work with
dynamic_extents
andstatic_extents
. Since we have the slice types available to us at compile-time, we can do some interesting things. We can determine if a subtensor is "simple," i.e., made up of onlystrided_span
types at compile-time, and can optimize some operations for such simple subtensors.For example, I was thinking the following: for slices that only contain strided types, we can do the assignment the simple way. And for
non_strided_span
we can do the assignment via iterators.Moreover, I thought that keeping the span types in a parameter pack as template arguments means that we can have some help in defining the iterator in the case of heterogeneous span types. I haven't thought that much about iterators, and frankly, I believe I don't have much experience in this regard, so any suggestions would be beneficial.
Beta Was this translation helpful? Give feedback.
All reactions