Skip to content

Conversation

@ArielG-NV
Copy link
Contributor

@ArielG-NV ArielG-NV commented Jul 15, 2025

resolves: #7408
Changes:

  • Proposal focuses more on "operations for coherence"

Copy link
Contributor

@csyonghe csyonghe left a comment

Choose a reason for hiding this comment

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

LGTM.

@ArielG-NV
Copy link
Contributor Author

ArielG-NV commented Jul 15, 2025

Are we good to just merge the proposal changes or should we wait for other team-members to review?


* C/C++ – `const int* ptr` or `int const*` both mean the underlying data pointed to is constant
* This will be equivlent to `Access::Read`

Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking change:
add one sub-bulletin for int* const ptr, equivalent to const Ptr<> ptr.

also typo: equivlent => equivalent

{
ReadWrite = 0,
Read = 1
//...
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this please, are there any other fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We may add Access:Write eventually.

Currently Write is not a planned feature, so instead of adding some unsupported Access enum, we omit Write for now.

}
```

If a pointer is `Access::Read`, a user program may only read from the given pointer. If a pointer is `Access::ReadWrite`, a user program may read from a given pointer or write to it.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: may => can

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use may only and can only in our documentation.

I do not fully understand why (may is formal, can tends to be informal)

let N : int,
let R : CoopMatMatrixUse,
let matrixLayout : CoopMatMatrixLayout,
Access access,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make access and addrSpace default as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not really make a difference. A user must supply a Ptr parameter.


### Support For Coherent Workgroup Memory

Any access through a coherent-pointer to a `groupshared` object is coherent; Since Slang does not currently support pointers to `groupshared` memory, this proposal will extend the existing `AddressSpace::GroupShared` implementation for pointers as needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Since => since.

The following keyword use is disallowed:
* `globallycoherent T*`
* `coherent T*`.
* `const T*` and `T* const`
Copy link
Contributor

Choose a reason for hiding this comment

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

and T const*

@ArielG-NV ArielG-NV merged commit 5de6650 into shader-slang:main Jul 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CBP] Create formal proposal for adding coherent operations through pointers

3 participants