From 399218f525b43d458f9db57b83c4fb720b57c85a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 29 Aug 2019 00:31:35 +0200 Subject: [PATCH] Code tweaks to the ThreadIds struct --- src/ComputeSharp.Core/Primitives/ThreadIds.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ComputeSharp.Core/Primitives/ThreadIds.cs b/src/ComputeSharp.Core/Primitives/ThreadIds.cs index aa0f8035..7b4944a6 100644 --- a/src/ComputeSharp.Core/Primitives/ThreadIds.cs +++ b/src/ComputeSharp.Core/Primitives/ThreadIds.cs @@ -1,4 +1,6 @@ -namespace ComputeSharp +using ComputeSharp.Exceptions; + +namespace ComputeSharp { /// /// A that indicates the ids of a given GPU thread running a compute shader @@ -6,18 +8,18 @@ public readonly struct ThreadIds { /// - /// The X id of the current thread + /// Gets the X id of the current thread /// - public readonly int X; + public int X => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(X)}"); /// - /// The Y id of the current thread + /// Gets the Y id of the current thread /// - public readonly int Y; + public int Y => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(Y)}"); /// - /// The Z id of the current thread + /// Gets the Z id of the current thread /// - public readonly int Z; + public int Z => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(Z)}"); } }