We should loop Peter Gottschling into this discussion as he implemented this for MTL4.

Best Regards,
Andrew Lumsdaine
(Sent from portable device, please excuse brevity and typos.)


On Dec 16, 2019, at 1:18 PM, Hoemmen, Mark via SG14 <sg14@lists.isocpp.org> wrote:



On 12/11/19, 2:24 PM, "SG14 on behalf of Jeremy Ong via SG14" <sg14-bounces@lists.isocpp.org on behalf of sg14@lists.isocpp.org> wrote:

> This is a bit out of left field, but I'd be interested in a data structure adapter which packs its elements based on Morton codes (or some other space-filling Hilbert curve, see https://en.wikipedia.org/wiki/Z-order_curve).

 

Greetings!  It should be possible to write an mdspan (P0009) Layout that uses a space-filling curve to order its elements.  I’ll be happy to talk with you more if you’re interested.  The main purpose of mdspan’s Layout customization point is to optimize array layout for the computer architecture and parallelization scheme – e.g., to ensure coalesced access on GPUs and improve spatial locality on CPUs.  Users can write custom Layouts, but if you think a space-filling curve Layout should be part of the standard, please let me know and I’ll bring it up with the other P0009 authors.  That would likely be offered as a follow-on paper.

 

Thanks!

Mark Hoemmen

_______________________________________________
SG14 mailing list
SG14@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/sg14