Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Move and update "memory model" docs #301

Merged
merged 8 commits into from
Nov 21, 2022
Merged

Conversation

gonzalobg
Copy link
Collaborator

This PR moves the "memory model" related docs to a separate page, so that they can be easily linked from the Programming Guide.

It also updates the memory model docs.

It provides a new guarantee that we did not provide before, system-scope atomics are also atomic if the operation:

it is a load or store that affects a naturally-aligned object of sizes 1, 2, 4, or 8 bytes on mapped memory

The scripts to build the site have stopped working, so this PR also updates those.

The site layout is constrained to a 800px body width, which makes tables render poorly.
This PR bumps this to 1000px here.

Syntax highlighting within HTML tables seems to be buggy with Jekyll.

@gonzalobg
Copy link
Collaborator Author

@daniellustig please review.

@wmaxey
Copy link
Member

wmaxey commented Sep 29, 2022

@gonzalobg Is this good to get in?

@gonzalobg
Copy link
Collaborator Author

Waiting for review.

An atomic operation is atomic at the scope it specifies if:
- it specifies a scope other than `thread_scope_system`, **or**

the scope is `thread_scope_system` and:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why separate this part out? Isn't this whole thing logically equivalent to just listing all 5 bullets in a single list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. The numbered list below says that this "boolean" expression is true: 1 || (2 && (3 || 4 || 5 || 6)).
I got feedback that this was hard to follow when it is all together, so I decided to split it when the parenthesis open.

In rendered markdown it looked ok to me, but if this can be improved I'd like to improve it.

An atomic operation is atomic at the scope it specifies if:

  1. it specifies a scope other than thread_scope_system, or
  2. the scope is thread_scope_system and
  3. it affects an object in [unified memory] and [concurrentManagedAccess] is 1, or
  4. it affects an object in CPU memory and [hostNativeAtomicSupported] is 1, or
  5. it is a load or store that affects a naturally-aligned object of sizes 1, 2, 4, or 8 bytes on [mapped memory], or
  6. it affects an object in GPU memory and only GPU threads access it.

@daniellustig
Copy link
Contributor

Looks good to me, aside from the one minor comment I just posted

@gonzalobg
Copy link
Collaborator Author

@wmaxey @daniellustig i think we can just merge this.
Having this would simplify the docs of atomic_ref as well.

@daniellustig
Copy link
Contributor

@wmaxey @daniellustig i think we can just merge this. Having this would simplify the docs of atomic_ref as well.

👍

@wmaxey wmaxey merged commit 817c6b7 into NVIDIA:main Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants