kokkos / kokkos/mdspan

mdarray: Apply no_unique_address optimization to members of mdarray

Open
#170 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
507
Forks
87
Avg merge
15h 27m
Merged PRs (30d)
2

Description

@johan-overbye reports that:

mdarrays with all static extents seem to require an extra 4 bytes on top of the container. (Latest MSVC for x86-64 with /std:c++latest.)

The reference implementation of mdarray doesn't currently use any of various techniques (such as [[no_unique_address]]) for not using space for members with no data,

https://github.com/kokkos/mdspan/blob/9ccf361e13dcc3bff2791fda327c2b10e081cb12/include/experimental/__p1684_bits/mdarray.hpp#L454

but the reference implementation of mdspan uses a "compressed pair" abstraction for this purpose.

We should consider using this abstraction for mdarray as well.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with include/experimental/__p1684_bits/mdarray.hpp around line 454, then compare the compressed-pair abstraction and its uses in include/experimental/__p0009_bits/mdspan.hpp around lines 116 and 380. Determine whether that abstraction can be applied to mdarray; done means static-extents mdarrays avoid the reported extra storage without changing their intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.