Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arrays]: Array outer dimension requires array storage ordering definition #451

Open
steleman opened this issue Feb 23, 2023 · 1 comment
Labels
clarify specification Change text of spec, not (mainly) semantics of spec enhance/change spec Semantic changes to language, not clarification

Comments

@steleman
Copy link
Contributor

steleman commented Feb 23, 2023

What is the expected enhancement?

The OpenQASM3 Spec for Arrays contains the following statement:

The subscript operator [] is used for element access, and for multi-dimensional
arrays subarray accesses can be specified using a comma-delimited list of indices
(e.g. myArr[1, 2, 3]), _with the outer dimension specified first_.

https://openqasm.com/language/types.html#arrays

The reference to an array's outer dimension is ambiguous, because the current Spec does not define the storage ordering for Arrays. The memory contents of an array's outer dimension is dependent on the array's storage ordering.

Proposed remedy:

OpenQASM3 arrays shall be stored in Row Major order.

There are subtle implications when deciding the storage ordering for Arrays. The Row Major ordering provides optimization advantages to the compiler that are not available with Column Major ordering.

@steleman steleman added the enhancement default GH label label Feb 23, 2023
@jwoehr
Copy link
Collaborator

jwoehr commented Feb 25, 2023

I'm going to wait to hear from the TSC before attempting to turn this Issue into a Pull Request.

@jlapeyre jlapeyre added clarify specification Change text of spec, not (mainly) semantics of spec enhance/change spec Semantic changes to language, not clarification and removed enhancement default GH label labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarify specification Change text of spec, not (mainly) semantics of spec enhance/change spec Semantic changes to language, not clarification
Projects
None yet
Development

No branches or pull requests

3 participants