diff --git a/src/ComputeSharp/Core/Attributes/GloballyCoherentAttribute.cs b/src/ComputeSharp/Core/Attributes/GloballyCoherentAttribute.cs new file mode 100644 index 00000000..a04f23d8 --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/GloballyCoherentAttribute.cs @@ -0,0 +1,26 @@ +using System; + +namespace ComputeSharp; + +/// +/// An attribute that indicates that a field in +/// a shader type should use the modifier. +/// +/// +/// +/// The modifier causes memory barriers and syncs to +/// flush data across the entire GPU such that other groups can see writes. Without this +/// modifier, a memory barrier or sync will only flush a UAV within the current thread group. +/// +/// +/// In other words, if compute shader thread in a given thread group needs to perform loads of +/// data that was written by atomics or stores in another thread group, the UAV slot where the +/// data resides must be tagged as , so the implementation +/// can ignore the local cache. Otherwise, this form of cross-thread group data sharing will +/// produce undefined results. +/// +/// +[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] +public sealed class GloballyCoherentAttribute : Attribute +{ +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs b/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs index e53897ef..178c81fc 100644 --- a/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs @@ -22,7 +22,7 @@ namespace ComputeSharp; public sealed class GroupSharedAttribute : Attribute { /// - /// Creates a new instance with the specified parameters. + /// Creates a new instance. /// public GroupSharedAttribute() {