From 10ba55d1561f2625f1542d91ed4b382bcc6314af Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 4 Sep 2022 15:21:00 +0200 Subject: [PATCH 1/4] Enable [ShaderMethod] support for global functions --- .../ShaderMethodSourceAttribute.cs | 4 +- .../SyntaxRewriters/ShaderSourceRewriter.cs | 124 ++++++++++++++---- .../ShaderMethodSourceGenerator.cs | 31 +++-- .../Core/Extensions/MethodInfoExtensions.cs | 14 +- 4 files changed, 128 insertions(+), 45 deletions(-) diff --git a/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs b/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs index d72109fe..b00de205 100644 --- a/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs +++ b/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs @@ -77,10 +77,10 @@ public sealed partial class ShaderMethodSourceAttribute : Attribute return ThrowArgumentExceptionForNonStaticMethod(name); } - var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); + IEnumerable attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); string methodName = function.Method.GetFullyQualifiedName(); - foreach (var attribute in attributes) + foreach (ShaderMethodSourceAttribute attribute in attributes) { if (attribute.methodName.Equals(methodName)) { diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxRewriters/ShaderSourceRewriter.cs index 8347860b..6a960102 100644 --- a/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.SourceGeneration.Hlsl/SyntaxRewriters/ShaderSourceRewriter.cs @@ -46,9 +46,9 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter private readonly bool isEntryPoint; /// - /// The current tree being visited. + /// The identifier of the current or tree being visited. /// - private MethodDeclarationSyntax? currentMethod; + private SyntaxToken currentMethodIdentifier; /// /// The current depth inside local declarations. @@ -111,7 +111,12 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter /// public MethodDeclarationSyntax? Visit(MethodDeclarationSyntax? node) { - this.currentMethod = node; + if (node is null) + { + return null; + } + + this.currentMethodIdentifier = node.Identifier; var updatedNode = (MethodDeclarationSyntax?)base.Visit(node)!; @@ -138,6 +143,40 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter return updatedNode; } + /// + public LocalFunctionStatementSyntax? Visit(LocalFunctionStatementSyntax? node) + { + if (node is null) + { + return null; + } + + this.currentMethodIdentifier = node.Identifier; + + var updatedNode = (LocalFunctionStatementSyntax?)base.Visit(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); + + if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + { + Diagnostics.Add(AsyncModifierOnMethodOrFunction, node); + } + + if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + { + Diagnostics.Add(UnsafeModifierOnMethodOrFunction, node); + } + + if (updatedNode is not null) + { + var implicitBlock = Block(this.implicitVariables.Select(static v => LocalDeclarationStatement(v)).ToArray()); + + updatedNode = updatedNode.WithBody(implicitBlock).AddBodyStatements(updatedNode.Body!.Statements.ToArray()); + } + + return updatedNode; + } + /// public override SyntaxNode VisitParameter(ParameterSyntax node) { @@ -200,35 +239,62 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter /// public override SyntaxNode? VisitLocalFunctionStatement(LocalFunctionStatementSyntax node) { - this.localFunctionDepth++; - - var updatedNode = - ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) - .WithBlockBody() - .WithAttributeLists(List()) - .WithIdentifier(Identifier($"__{this.currentMethod!.Identifier.Text}__{node.Identifier.Text}")); - - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); - - if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + // If the current identifier matches the one for the current method, it means the local function + // statement is the one being inspected, and it's nto coming from a local function in a method + // being parsed. That is, this was a blobal method that was annotated in source. + if (node.Identifier == this.currentMethodIdentifier) { - Diagnostics.Add(AsyncModifierOnMethodOrFunction, node); - } + var updatedNode = + ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) + .WithBlockBody() + .WithAttributeLists(List()); - if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + { + Diagnostics.Add(AsyncModifierOnMethodOrFunction, node); + } + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + { + Diagnostics.Add(UnsafeModifierOnMethodOrFunction, node); + } + + return updatedNode; + } + else { - Diagnostics.Add(UnsafeModifierOnMethodOrFunction, node); + this.localFunctionDepth++; + + var updatedNode = + ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) + .WithBlockBody() + .WithAttributeLists(List()) + .WithIdentifier(Identifier($"__{this.currentMethodIdentifier.Text}__{node.Identifier.Text}")); + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + { + Diagnostics.Add(AsyncModifierOnMethodOrFunction, node); + } + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + { + Diagnostics.Add(UnsafeModifierOnMethodOrFunction, node); + } + + this.localFunctionDepth--; + + // HLSL doesn't support local functions, so we first process them as usual and then remove + // them from the current syntax tree completely. These will be added to the shader source + // as external static method with a special name to avoid conflicts with other methods. + // The name will simply be in the format: "____". + this.localFunctions.Add(updatedNode.Identifier.Text, updatedNode); + + return null; } - - this.localFunctionDepth--; - - // HLSL doesn't support local functions, so we first process them as usual and then remove - // them from the current syntax tree completely. These will be added to the shader source - // as external static method with a special name to avoid conflicts with other methods. - // The name will simply be in the format: "____". - this.localFunctions.Add(updatedNode.Identifier.Text, updatedNode); - - return null; } /// @@ -370,7 +436,7 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter // updated name is detailed in the override handling the local function statement. if (method.MethodKind == MethodKind.LocalFunction) { - var functionIdentifier = $"__{this.currentMethod!.Identifier.Text}__{method.Name}"; + var functionIdentifier = $"__{this.currentMethodIdentifier.Text}__{method.Name}"; return updatedNode.WithExpression(IdentifierName(functionIdentifier)); } diff --git a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs index 52dde8f1..f293e6e4 100644 --- a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Text; @@ -27,13 +28,13 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator /// public void Initialize(IncrementalGeneratorInitializationContext context) { - // Get all declared methods with the [ShaderMethod] attribute - IncrementalValuesProvider<(MethodDeclarationSyntax Syntax, IMethodSymbol Symbol)> structDeclarations = + // Get all declared methods (including global function declarations) with the [ShaderMethod] attribute + IncrementalValuesProvider<(CSharpSyntaxNode Syntax, IMethodSymbol Symbol)> structDeclarations = context.SyntaxProvider .CreateSyntaxProvider( - static (node, token) => node is MethodDeclarationSyntax { AttributeLists.Count: > 0 } methodDeclaration, + static (node, token) => node is MethodDeclarationSyntax { AttributeLists.Count: > 0 } or LocalFunctionStatementSyntax { Parent: GlobalStatementSyntax { Parent: CompilationUnitSyntax }, AttributeLists.Count: > 0 }, static (context, token) => ( - Syntax: (MethodDeclarationSyntax)context.Node, + Syntax: (CSharpSyntaxNode)context.Node, Symbol: (IMethodSymbol?)context.SemanticModel.GetDeclaredSymbol(context.Node, token))) .Where(static item => item.Symbol is not null && item.Symbol.GetAttributes().Any(static a => a.AttributeClass?.ToDisplayString() == typeof(ShaderMethodAttribute).FullName))!; @@ -81,12 +82,12 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator /// Processes a given target method. /// /// The input object currently in use. - /// The node to process. + /// The or node to process. /// The instance for the current method. /// The resulting diagnostics from the processing operation. public static HlslMethodSourceInfo GetData( Compilation compilation, - MethodDeclarationSyntax methodDeclaration, + CSharpSyntaxNode methodDeclaration, IMethodSymbol methodSymbol, out ImmutableArray diagnostics) { @@ -116,14 +117,14 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator /// Gets a sequence of processed methods from a target method declaration. /// /// The collection of produced instances. - /// The instance for the current method. + /// The or instance for the current method. /// The instance for the method to process. /// The collection of currently discovered types. /// The collection of discovered constant definitions. /// A sequence of processed methods in (main method and all captured methods). private static (string TargetMethod, ImmutableArray<(string Signature, string Definition)> DependentMethods) GetProcessedMethods( ImmutableArray.Builder diagnostics, - MethodDeclarationSyntax methodDeclaration, + CSharpSyntaxNode methodDeclaration, SemanticModelProvider semanticModel, ICollection discoveredTypes, IDictionary constantDefinitions) @@ -132,10 +133,16 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator ShaderSourceRewriter shaderSourceRewriter = new(semanticModel, discoveredTypes, staticMethods, constantDefinitions, diagnostics); + // Process the possible syntax nodes + SyntaxNode visitedMethod = methodDeclaration switch + { + MethodDeclarationSyntax methodDeclarationSyntax => shaderSourceRewriter.Visit(methodDeclarationSyntax)!.WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier)), + LocalFunctionStatementSyntax functionStatementSyntax => shaderSourceRewriter.Visit(functionStatementSyntax)!.WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier)), + _ => throw new ArgumentException("Invalid method declaration syntax node type.") + }; + // Rewrite the method syntax tree - var targetMethod = shaderSourceRewriter - .Visit(methodDeclaration)! - .WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier)) + string targetMethod = visitedMethod .WithoutTrivia() .NormalizeWhitespace(eol: "\n") .ToFullString(); diff --git a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs index b2f1a9ac..81d7dfa7 100644 --- a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs +++ b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Reflection; +using System.Text.RegularExpressions; namespace ComputeSharp.Core.Extensions; @@ -17,13 +18,22 @@ internal static class MethodInfoExtensions { string parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName)); + // Fixup the method name for static local functions in global statements. This only needs to + // be done when the method is in a type with fully qualified name "Program", as that's the only + // case where it might happen. If the declaring type has a name, it can't be that for sure. + (string declaringType, string methodName) = (method.DeclaringType!.FullName!, method.Name) switch + { + ("Program", var name) => ("Program", Regex.Replace(name, @"<
\$>g__(\w+)\|\d+_\d+", static m => m.Groups[1].Value)), + (var type, var name) => (type, name) + }; + if (method.IsGenericMethod) { string arguments = string.Join(", ", method.GetGenericArguments().Select(static t => t.FullName)); - return $"{method.DeclaringType!.FullName!}.{method.Name}<{arguments}>({parameters})"; + return $"{declaringType}.{methodName}<{arguments}>({parameters})"; } - return $"{method.DeclaringType!.FullName!}.{method.Name}({parameters})"; + return $"{declaringType}.{methodName}({parameters})"; } } From a576ceeb3c9c1d7e5c9da3240a2767a9b7cbfd40 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 4 Sep 2022 15:26:53 +0200 Subject: [PATCH 2/4] Add blank ComputeSharp.Tests.GlobalStatements project --- ComputeSharp.sln | 11 +++++++++++ .../ComputeSharp.Tests.GlobalStatements.csproj | 18 ++++++++++++++++++ .../Program.cs | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj create mode 100644 tests/ComputeSharp.Tests.GlobalStatements/Program.cs diff --git a/ComputeSharp.sln b/ComputeSharp.sln index b64a7a9f..ab206e9f 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -124,6 +124,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.NuGet", "Compu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.DeviceLost", "tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj", "{5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.Tests.GlobalStatements", "tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj", "{669A414F-3B46-4B55-B587-061AF63C3067}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -348,6 +350,14 @@ Global {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|ARM64.Build.0 = Release|Any CPU {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|x64.ActiveCfg = Release|Any CPU {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|x64.Build.0 = Release|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|ARM64.Build.0 = Debug|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|x64.ActiveCfg = Debug|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|x64.Build.0 = Debug|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Release|ARM64.ActiveCfg = Release|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Release|ARM64.Build.0 = Release|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Release|x64.ActiveCfg = Release|Any CPU + {669A414F-3B46-4B55-B587-061AF63C3067}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -380,6 +390,7 @@ Global {C0B903AA-F32C-4760-B4B6-199AC4FE1C5A} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {E3403F19-A0D8-4317-8A54-322C7A13F2A2} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} + {669A414F-3B46-4B55-B587-061AF63C3067} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC} diff --git a/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj b/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj new file mode 100644 index 00000000..5fa7cd02 --- /dev/null +++ b/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj @@ -0,0 +1,18 @@ + + + + Exe + net6.0 + AnyCPU;x64;ARM64 + enable + + + + + + + + + + + diff --git a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs new file mode 100644 index 00000000..3751555c --- /dev/null +++ b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); From c2bd62d86eee75433e1c3df4f30b73e439e717f2 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 4 Sep 2022 15:32:11 +0200 Subject: [PATCH 3/4] Add global shader method test --- ...ComputeSharp.Tests.GlobalStatements.csproj | 4 ++ .../Program.cs | 40 ++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj b/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj index 5fa7cd02..ca713b52 100644 --- a/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj +++ b/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj @@ -6,6 +6,10 @@ AnyCPU;x64;ARM64 enable + + + + diff --git a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs index 3751555c..a9507482 100644 --- a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs +++ b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs @@ -1,2 +1,38 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using ComputeSharp; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +float[] numbers = Enumerable.Range(0, 128).Select(i => (float)i).ToArray(); + +using GraphicsDevice device = GraphicsDevice.GetDefault(); +using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(numbers); + +device.For(buffer.Length, new ApplyFunctionShader(buffer, AddHalf)); + +foreach (ref float number in numbers.AsSpan()) +{ + number = AddHalf(number); +} + +float[] result = buffer.ToArray(); + +CollectionAssert.AreEqual( + expected: numbers, + actual: result); + +Console.WriteLine("Test passed successfully"); + +// See https://github.com/Sergio0694/ComputeSharp/issues/374 +[ShaderMethod] +static float AddHalf(float input) => input + 0.5f; + +[AutoConstructor] +public readonly partial struct ApplyFunctionShader : IComputeShader +{ + private readonly ReadWriteBuffer sourceTexture; + private readonly Func func; + + public void Execute() + { + this.sourceTexture[ThreadIds.X] = this.func(this.sourceTexture[ThreadIds.X]); + } +} \ No newline at end of file From 21973f5545f85b85187f15b3a60a0dd58d842864 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 4 Sep 2022 15:33:41 +0200 Subject: [PATCH 4/4] Add ComputeSharp.Tests.GlobalStatements to CI --- .github/workflows/dotnet.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 31d41d70..11461bca 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -140,6 +140,9 @@ jobs: - name: Run ComputeSharp.Tests.DisableDynamicCompilation (.NET 6) run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release -f net6.0 -v n -l "console;verbosity=detailed" shell: cmd + - name: Run ComputeSharp.Tests.GlobalStatements (.NET 6) + run: dotnet test tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release -f net6.0 -v n -l "console;verbosity=detailed" + shell: cmd - name: Run ComputeSharp.Tests.Internals (.NET 6) run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release -f net6.0 -v n -l "console;verbosity=detailed" shell: cmd @@ -149,6 +152,9 @@ jobs: - name: Run ComputeSharp.Tests.DisableDynamicCompilation (.NET Core 3.1) run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release -f netcoreapp3.1 /p:Platform=x64 -v n -l "console;verbosity=detailed" shell: cmd + - name: Run ComputeSharp.Tests.GlobalStatements (.NET Core 3.1) + run: dotnet test tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release -f netcoreapp3.1 -v n -l "console;verbosity=detailed" + shell: cmd - name: Run ComputeSharp.Tests.Internals (.NET Core 3.1) run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release -f netcoreapp3.1 /p:Platform=x64 -v n -l "console;verbosity=detailed" shell: cmd @@ -158,6 +164,9 @@ jobs: - name: Run ComputeSharp.Tests.DisableDynamicCompilation (.NET Framework 4.7.2) run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release -f net472 /p:Platform=x64 -v n -l "console;verbosity=detailed" shell: cmd + - name: Run ComputeSharp.Tests.GlobalStatements (.NET Framework 4.7.2) + run: dotnet test tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release -f net472 -v n -l "console;verbosity=detailed" + shell: cmd - name: Run ComputeSharp.Tests.Internals (.NET Framework 4.7.2) run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release -f net472 /p:Platform=x64 -v n -l "console;verbosity=detailed" shell: cmd