Conversation
mdspan_copy/mdspan_copy.md
Outdated
There was a problem hiding this comment.
mdspans are views; would you therefore consider passing them by value, as is done in P1673?
| void copy(const mdspan<SrcElementType, SrcExtents, SrcLayoutPolicy, SrcAccessorPolicy> &src, const mdspan<DstElementType, DstExtents, DstLayoutPolicy, DstAccessorPolicy> &dst) | |
| void copy(mdspan<SrcElementType, SrcExtents, SrcLayoutPolicy, SrcAccessorPolicy> src, mdspan<DstElementType, DstExtents, DstLayoutPolicy, DstAccessorPolicy> dst); |
There was a problem hiding this comment.
revisiting this, because even though they are views, the size of the mdspan is proportional to the number of dynamic extents; so it's very possible to have mdspans that are not passible in registers. I'm happy to keep it as we have in other papers, but this particular aspect might get challenged
There was a problem hiding this comment.
@nmm0 I don't really mind either way. For std::linalg, all the mdspan are no more than rank 2, but here, they might have arbitrary rank.
I suspect LEWG would want to hear that argument. They might also want some performance measurements to justify a difference from the status quo.
mdspan_copy/mdspan_copy.md
Outdated
There was a problem hiding this comment.
Naive implementation is not tedious
for i0 in [0, extents(0)
for i1 in [0, extents(1)
...
for iK in [0, extents(K)
dst[i0, i1, ..., iK] = src[i0, i1, ..., iK];just (sometimes) really inefficient.
There was a problem hiding this comment.
Haha well, I think writing an 8-nested for loop is pretty tedious :P. I guess it's a matter of opinion
There was a problem hiding this comment.
I already submitted a PR to kokkos/mdspan that does generic iteration over extents of any rank. It's not really tedious, but would be really inefficient without at least the specializations for exhaustive layouts.
Co-authored-by: Mark Hoemmen <mhoemmen@users.noreply.github.com>
mdspan
No description provided.