From af70de254764e5d6e19a4991d5f76b9dac7e8695 Mon Sep 17 00:00:00 2001 From: SingleAccretion Date: Sat, 12 Dec 2020 20:01:26 +0300 Subject: [PATCH 1/7] Create a packaging project --- ComputeSharp.sln | 3 ++- global.json | 5 ++++ .../ComputeSharp.Benchmark.csproj | 12 ++++----- .../ComputeSharp.Core.csproj | 18 ++++++++++++- .../ComputeSharp.Graphics.csproj | 1 - .../ComputeSharp.Package.msbuildproj | 26 +++++++++++++++++++ .../ComputeSharp.Shaders.csproj | 1 - .../ComputeSharp.SourceGenerators.csproj | 12 ++++++--- src/ComputeSharp/ComputeSharp.csproj | 17 +++++++++--- src/Directory.Build.props | 9 +++++++ 10 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 global.json create mode 100644 src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj create mode 100644 src/Directory.Build.props diff --git a/ComputeSharp.sln b/ComputeSharp.sln index b6780dc1..97bcda1d 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -28,11 +28,12 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_SolutionItems", "{1A9C4108-F61A-4ABE-B5CF-F524521EAE2D}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + global.json = global.json LICENSE = LICENSE README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SourceGenerators", "src\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj", "{EB52CB67-4162-4722-874B-44EA8DA5450E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SourceGenerators", "src\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj", "{EB52CB67-4162-4722-874B-44EA8DA5450E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/global.json b/global.json new file mode 100644 index 00000000..2cb2ac9b --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "5.0.100" + } +} \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj index 99d0ea05..a07c33ef 100644 --- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj +++ b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj @@ -7,15 +7,15 @@ + - + - + \ No newline at end of file diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index abf25208..aa99e033 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -4,11 +4,27 @@ netstandard2.0;net5.0 true 9.0 - enable + + + + + false + true + + false + + diff --git a/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj b/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj index e98b35cd..d5fab37a 100644 --- a/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj +++ b/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj @@ -2,7 +2,6 @@ net5.0 - enable true diff --git a/src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj b/src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj new file mode 100644 index 00000000..d14cc0c8 --- /dev/null +++ b/src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj @@ -0,0 +1,26 @@ + + + net5.0 + + + + ComputeSharp + A .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders + New interlocked intrinsics APIs, performance and memory optimizations + 2.0.0 + https://github.com/Sergio0694/ComputeSharp.git + https://github.com/Sergio0694/ComputeSharp + Sergio Pedri + Sergio Pedri + Copyright (c) 2020 Sergio Pedri + MIT + false + https://i.imgur.com/ntvmD6P.png + dotnet net netcore netstandard csharp library graphics shader hlsl compute gpu + + + + + + + \ No newline at end of file diff --git a/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj b/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj index a085e449..4c325294 100644 --- a/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj +++ b/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj @@ -2,7 +2,6 @@ net5.0 - enable true diff --git a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj index 1c9c7e2d..467bb2d1 100644 --- a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj +++ b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj @@ -3,16 +3,20 @@ netstandard2.0 9.0 - enable + + + + analyzers\dotnet\cs + false - - + + - + diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index 54bca4f1..71f419d3 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -2,18 +2,27 @@ net5.0 - preview - enable + 9.0 true + + lib\$(TargetFramework) + + - - + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..84867398 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,9 @@ + + + enable + + + + + + \ No newline at end of file From 4773a965bd913896cbbcb65848e09e0f1b1420f5 Mon Sep 17 00:00:00 2001 From: SingleAccretion Date: Sat, 12 Dec 2020 20:17:51 +0300 Subject: [PATCH 2/7] Fix condition --- src/ComputeSharp.Core/ComputeSharp.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index aa99e033..1e9be6b5 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -15,7 +15,7 @@ Right now this is conditioned on the target framework, so this property is primarily for readability This may change in the future --> - false + false true false From 83cdc563da817c0928879ba1c824026c9f5de297 Mon Sep 17 00:00:00 2001 From: SingleAccretion Date: Sat, 12 Dec 2020 20:17:51 +0300 Subject: [PATCH 3/7] Fix condition --- src/ComputeSharp.Core/ComputeSharp.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index aa99e033..1e9be6b5 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -15,7 +15,7 @@ Right now this is conditioned on the target framework, so this property is primarily for readability This may change in the future --> - false + false true false From cc321612c631365cb0bc41b4ce6d748d6510376b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 12 Dec 2020 18:26:36 +0100 Subject: [PATCH 4/7] Minor code style tweaks --- .../ComputeSharp.Benchmark.csproj | 1 - .../ComputeSharp.ImageProcessing.csproj | 17 +++++------------ .../ComputeSharp.Sample.csproj | 9 ++++----- src/ComputeSharp.Core/ComputeSharp.Core.csproj | 14 ++++++-------- .../ComputeSharp.Tests.csproj | 9 ++++----- 5 files changed, 19 insertions(+), 31 deletions(-) diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj index a07c33ef..06bb8291 100644 --- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj +++ b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj @@ -7,7 +7,6 @@ - diff --git a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj index 422f73dd..88210549 100644 --- a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj +++ b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj @@ -6,13 +6,7 @@ - - - - - - PreserveNewest - + @@ -21,11 +15,10 @@ - + diff --git a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj index fb05ec61..8b2bf452 100644 --- a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj +++ b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj @@ -7,11 +7,10 @@ - + diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index 1e9be6b5..c820d0b9 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -7,14 +7,11 @@ - + + false true @@ -24,6 +21,7 @@ + diff --git a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj index 722a7e0f..d4f1c821 100644 --- a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj +++ b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj @@ -14,11 +14,10 @@ - + From 4455c31d20b94856aa9ea7cef3ec4d25bb59419c Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 12 Dec 2020 18:28:59 +0100 Subject: [PATCH 5/7] Removed unnecessary .nuspec file --- src/ComputeSharp/ComputeSharp.nuspec | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/ComputeSharp/ComputeSharp.nuspec diff --git a/src/ComputeSharp/ComputeSharp.nuspec b/src/ComputeSharp/ComputeSharp.nuspec deleted file mode 100644 index 46218663..00000000 --- a/src/ComputeSharp/ComputeSharp.nuspec +++ /dev/null @@ -1,26 +0,0 @@ - - - - ComputeSharp - 2.0.0 - ComputeSharp - Sergio Pedri - Sergio Pedri - MIT - https://github.com/Sergio0694/ComputeSharp - https://i.imgur.com/ntvmD6P.png - false - A .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders - New interlocked intrinsics APIs, performance and memory optimizations - Copyright (c) 2020 Sergio Pedri - dotnet net netcore netstandard csharp library graphics shader hlsl compute gpu - - - - - - - - - - From d002aed17b597a7d4975a592bba4e30b12141b44 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 12 Dec 2020 18:31:20 +0100 Subject: [PATCH 6/7] Suppressed a nullability warning --- src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs b/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs index 9fd1fbd1..236d9f78 100644 --- a/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs +++ b/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs @@ -81,7 +81,7 @@ namespace ComputeSharp { Guard.IsTrue(function.Method.IsStatic, "Captured delegates need to wrap static methods"); - var attributes = function.Method.DeclaringType.Assembly.GetCustomAttributes(); + var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); string methodName = function.Method.GetFullName(); foreach (var attribute in attributes) From 4caf59707a30d6f71a88e273250a479d0389a9e8 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 12 Dec 2020 18:33:13 +0100 Subject: [PATCH 7/7] Added packaging project to solution --- ComputeSharp.sln | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 97bcda1d..01e8f1c0 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -35,6 +35,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SourceGenerators", "src\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj", "{EB52CB67-4162-4722-874B-44EA8DA5450E}" EndProject +Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ComputeSharp.Package", "src\ComputeSharp.Package\ComputeSharp.Package.msbuildproj", "{0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{FB17EF84-9208-47AC-921F-680CB1DAD8BA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -123,6 +127,14 @@ Global {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|Any CPU.Build.0 = Release|Any CPU {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.ActiveCfg = Release|Any CPU {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.Build.0 = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|x64.ActiveCfg = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|x64.Build.0 = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|Any CPU.Build.0 = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|x64.ActiveCfg = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -133,6 +145,7 @@ Global {7A48A85D-8866-4DED-A404-653ED09BF396} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {E91F4D24-922A-4921-A8D7-9C45A143C45D} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3} = {FB17EF84-9208-47AC-921F-680CB1DAD8BA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC}