Skip to content

Commit 906ad05

Browse files
committed
update spec
1 parent 38e4cf0 commit 906ad05

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

proposals/030-coherent-pointers.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ struct Ptr
7070
}
7171
```
7272

73-
If `coherentScope` is not `CoherentScope.NotCoherent`, all accesses to memory through this pointer will be considered coherent to the specified memory scope (example: `CoherentScope.Device` is coherent to the memory scope of `Device`).
73+
If `coherentScope` is not `CoherentScope.NotCoherent`, all accesses to memory through this pointer will be considered coherent to the specified memory scope (example: `CoherentScope::Device` is coherent to the memory scope of `Device`).
7474

7575
We will also provide a type alias for user-convenience.
7676

7777
```c#
78-
__generic<T, CoherentScope coherentScope>
79-
typealias CoherentPtr = Ptr<T, AddressSpace::UserPointer, coherentScope>;
78+
__generic<T>
79+
typealias CoherentPtr = Ptr<T, AddressSpace::UserPointer, CoherentScope::CrossDevice>;
8080
```
8181

8282
### Support For Coherent Buffers and Textures
@@ -85,7 +85,7 @@ Any access through a coherent-pointer to a buffer/texture is coherent.
8585

8686
```c#
8787
RWStructuredBuffer<int> val; // Texture works as well.
88-
CoherentPtr<int, CoherentScope.Device> p = &val[0];
88+
CoherentPtr<int, CoherentScope::Device> p = &val[0];
8989
*p = 10; // coherent store
9090
p = p+10;
9191
int b = *p; //coherent load
@@ -102,7 +102,11 @@ Any access through a coherent-pointer to a `groupshared` object is coherent; Sin
102102

103103
### Support Casting Pointers With Different `CoherentScope`
104104

105-
We will allow pointers with different `CoherentPtr` to be explicitly castable to each other. For example, `CoherentPtr<int, CoherentScope.Device>` will be castable to `CoherentPtr<int, MemoryScope.Workgroup>`.
105+
We will allow pointers with different `CoherentScope` to be explicitly castable to each other. For example, `CoherentPtr<int, CoherentScope::Device>` will be castable to `CoherentPtr<int, MemoryScope.Workgroup>`.
106+
107+
### Banned keywords
108+
109+
HLSL style `globallycoherent T*` and GLSL style `coherent T*` will be disallowed.
106110

107111
### Order of Implementation
108112

@@ -111,8 +115,8 @@ We will allow pointers with different `CoherentPtr` to be explicitly castable to
111115
3. Support for coherent buffers and textures
112116
4. Support for coherent workgroup memory
113117
5. Support for coherent cooperative matrix & cooperative vector
114-
6. Support casting pointers with different coherent `MemoryScope`
115-
7. Support the `globallycoherent` keyword
118+
6. Support casting between pointers with different `CoherentScope`
119+
7. disallow `globallycoherent T*` and `coherent T*`
116120

117121
## Future Work
118122

0 commit comments

Comments
 (0)