ORNL / ORNL/cpp-proposals-pub

P0009: Add follow-on: inverse layout mapping

Open
#275 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
29
Forks
26
PR merge metrics
No merged PRs in 30d

Description

A colleague requested that all unique layout mappings have an inverse mapping function. This would map a 1-D offset to the corresponding multidimensional index tuple, if the offset corresponds to a valid multidimensional index tuple.

My colleague proposed it as a nonmember function, constrained on is_always_unique() and preconditioned on is_unique().

An interesting use case would be to change iteration order in a flattened loop. For example, one might be iterating over [0, required_span_size()) on a 2-D square domain, but might want to view the domain using a 2-D space-filling curve. One could do this by inverting the layout_left mapping, and then giving the resulting (i,j) index pair to a space-filling curve's layout mapping.

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 by reviewing the proposed inverse mapping requirements, including valid multidimensional index tuples, required_span_size(), is_always_unique(), and is_unique(). Define the nonmember API and its behavior for offsets that do not correspond to valid indices; done means the proposal resolves the interface and preconditions for changing iteration order.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.