From e48949cd4882f3cfab16b005004c37087e5a477d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 3 Apr 2022 15:17:01 +0200 Subject: [PATCH] Move primitives to ComputeSharp.Core --- ComputeSharp.sln | 19 ++ .../ComputeSharp.Core.NetStandard.projitems | 17 ++ .../ComputeSharp.Core.NetStandard.shproj | 13 + .../System/InteropServices/MemoryMarshal.cs | 36 +++ ...erpolatedStringHandlerArgumentAttribute.cs | 0 .../InterpolatedStringHandlerAttribute.cs | 0 .../RuntimeHelpers.cs | 18 ++ .../Attributes/AutoConstructorAttribute.cs | 0 .../ComputeSharp.Core.csproj | 222 ++++++++++++++++++ .../InvalidExecutionContextException.cs | 0 .../FormatInterpolatedStringHandler.cs | 0 ...TryWriteFormatInterpolatedStringHandler.cs | 0 .../Attributes/HlslIntrinsicNameAttribute.cs | 0 .../Intrinsics/Hlsl.cs | 0 .../Intrinsics/Hlsl.g.cs | 0 .../Intrinsics/Hlsl.tt | 0 .../Intrinsics/Hlsl.ttinclude | 0 .../Primitives/Bool/Bool.cs | 0 .../Primitives/Bool/Bool2.cs | 0 .../Primitives/Bool/Bool2.g.cs | 4 +- .../Primitives/Bool/Bool2.tt | 0 .../Primitives/Bool/Bool3.cs | 0 .../Primitives/Bool/Bool3.g.cs | 4 +- .../Primitives/Bool/Bool3.tt | 0 .../Primitives/Bool/Bool4.cs | 0 .../Primitives/Bool/Bool4.g.cs | 4 +- .../Primitives/Bool/Bool4.tt | 0 .../Primitives/Bool/BoolMxN.g.cs | 4 +- .../Primitives/Bool/BoolMxN.tt | 0 .../Primitives/Double/Double2.cs | 0 .../Primitives/Double/Double2.g.cs | 4 +- .../Primitives/Double/Double2.tt | 0 .../Primitives/Double/Double3.cs | 0 .../Primitives/Double/Double3.g.cs | 4 +- .../Primitives/Double/Double3.tt | 0 .../Primitives/Double/Double4.cs | 0 .../Primitives/Double/Double4.g.cs | 4 +- .../Primitives/Double/Double4.tt | 0 .../Primitives/Double/DoubleMxN.g.cs | 4 +- .../Primitives/Double/DoubleMxN.tt | 0 .../Primitives/Float/Float2.cs | 0 .../Primitives/Float/Float2.g.cs | 4 +- .../Primitives/Float/Float2.tt | 0 .../Primitives/Float/Float3.cs | 0 .../Primitives/Float/Float3.g.cs | 4 +- .../Primitives/Float/Float3.tt | 0 .../Primitives/Float/Float4.cs | 0 .../Primitives/Float/Float4.g.cs | 4 +- .../Primitives/Float/Float4.tt | 0 .../Primitives/Float/FloatMxN.g.cs | 4 +- .../Primitives/Float/FloatMxN.tt | 0 .../Primitives/Int/Int2.cs | 0 .../Primitives/Int/Int2.g.cs | 4 +- .../Primitives/Int/Int2.tt | 0 .../Primitives/Int/Int3.cs | 0 .../Primitives/Int/Int3.g.cs | 4 +- .../Primitives/Int/Int3.tt | 0 .../Primitives/Int/Int4.cs | 0 .../Primitives/Int/Int4.g.cs | 4 +- .../Primitives/Int/Int4.tt | 0 .../Primitives/Int/IntMxN.g.cs | 4 +- .../Primitives/Int/IntMxN.tt | 0 .../Primitives/MatrixIndex.cs | 0 .../Primitives/MatrixType.ttinclude | 4 +- .../Primitives/UInt/UInt2.cs | 0 .../Primitives/UInt/UInt2.g.cs | 4 +- .../Primitives/UInt/UInt2.tt | 0 .../Primitives/UInt/UInt3.cs | 0 .../Primitives/UInt/UInt3.g.cs | 4 +- .../Primitives/UInt/UInt3.tt | 0 .../Primitives/UInt/UInt4.cs | 0 .../Primitives/UInt/UInt4.g.cs | 4 +- .../Primitives/UInt/UInt4.tt | 0 .../Primitives/UInt/UIntMxN.g.cs | 4 +- .../Primitives/UInt/UIntMxN.tt | 0 .../Primitives/VectorType.ttinclude | 4 +- .../ComputeSharp.NetStandard.projitems | 2 - src/ComputeSharp/ComputeSharp.csproj | 199 ---------------- 78 files changed, 369 insertions(+), 245 deletions(-) create mode 100644 src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.projitems create mode 100644 src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.shproj create mode 100644 src/ComputeSharp.Core.NetStandard/System/InteropServices/MemoryMarshal.cs rename src/{ComputeSharp.NetStandard/System/Runtime/CompilerServices => ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices}/InterpolatedStringHandlerArgumentAttribute.cs (100%) rename src/{ComputeSharp.NetStandard/System/Runtime/CompilerServices => ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices}/InterpolatedStringHandlerAttribute.cs (100%) create mode 100644 src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/RuntimeHelpers.cs rename src/{ComputeSharp/Core => ComputeSharp.Core}/Attributes/AutoConstructorAttribute.cs (100%) create mode 100644 src/ComputeSharp.Core/ComputeSharp.Core.csproj rename src/{ComputeSharp/Core => ComputeSharp.Core}/Exceptions/InvalidExecutionContextException.cs (100%) rename src/{ComputeSharp/Core/Helpers/System.Runtime.CompilerServices => ComputeSharp.Core/Helpers}/FormatInterpolatedStringHandler.cs (100%) rename src/{ComputeSharp/Core/Helpers/System.Runtime.CompilerServices => ComputeSharp.Core/Helpers}/TryWriteFormatInterpolatedStringHandler.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Intrinsics/Hlsl.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Intrinsics/Hlsl.g.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Intrinsics/Hlsl.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Intrinsics/Hlsl.ttinclude (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool2.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool2.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool2.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool3.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool3.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool3.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool4.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool4.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/Bool4.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/BoolMxN.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Bool/BoolMxN.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double2.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double2.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double2.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double3.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double3.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double3.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double4.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double4.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/Double4.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/DoubleMxN.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Double/DoubleMxN.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float2.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float2.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float2.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float3.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float3.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float3.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float4.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float4.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/Float4.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/FloatMxN.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Float/FloatMxN.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int2.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int2.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int2.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int3.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int3.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int3.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int4.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int4.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/Int4.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/IntMxN.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/Int/IntMxN.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/MatrixIndex.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/MatrixType.ttinclude (98%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt2.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt2.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt2.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt3.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt3.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt3.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt4.cs (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt4.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UInt4.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UIntMxN.g.cs (99%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/UInt/UIntMxN.tt (100%) rename src/{ComputeSharp/Core => ComputeSharp.Core}/Primitives/VectorType.ttinclude (98%) diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 5bd3f951..22447587 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -81,6 +81,10 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TerraFX.Interop.Windows.D2D EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1Interop.NetStandard", "src\ComputeSharp.D2D1Interop.NetStandard\ComputeSharp.D2D1Interop.NetStandard.shproj", "{2608EB41-F98B-4BE5-9F4D-68FED6115088}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core", "src\ComputeSharp.Core\ComputeSharp.Core.csproj", "{764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Core.NetStandard", "src\ComputeSharp.Core.NetStandard\ComputeSharp.Core.NetStandard.shproj", "{3ACACF03-6B20-40BA-B8EC-11AC1624D2C9}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.projitems*{0071701e-b9c5-4098-be5f-ef556c4553c6}*SharedItemsImports = 5 @@ -91,11 +95,13 @@ Global src\ComputeSharp.D2D1Interop.NetStandard\ComputeSharp.D2D1Interop.NetStandard.projitems*{2608eb41-f98b-4be5-9f4d-68fed6115088}*SharedItemsImports = 13 src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems*{314eb353-e7e3-4146-8111-685cc83ec1de}*SharedItemsImports = 5 src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems*{314eb353-e7e3-4146-8111-685cc83ec1de}*SharedItemsImports = 5 + src\ComputeSharp.Core.NetStandard\ComputeSharp.Core.NetStandard.projitems*{3acacf03-6b20-40ba-b8ec-11ac1624d2c9}*SharedItemsImports = 13 src\ComputeSharp.D2D1Interop.NetStandard\ComputeSharp.D2D1Interop.NetStandard.projitems*{4d7d9ba8-a821-4b1c-9ee2-cbcf5849906e}*SharedItemsImports = 5 src\TerraFX.Interop.Windows.D2D1Interop\TerraFX.Interop.Windows.D2D1Interop.projitems*{4d7d9ba8-a821-4b1c-9ee2-cbcf5849906e}*SharedItemsImports = 5 src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems*{514ff00e-bbf0-4d55-a47c-eeeb6208adce}*SharedItemsImports = 13 samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{7048deea-0a6f-46a0-b951-b682a8f1cb75}*SharedItemsImports = 5 samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.projitems*{751bb05b-563d-4b3a-94c6-15e2d79d35ea}*SharedItemsImports = 13 + src\ComputeSharp.Core.NetStandard\ComputeSharp.Core.NetStandard.projitems*{764bc0f5-0c5e-49ad-abaa-e3874c0f3286}*SharedItemsImports = 5 src\TerraFX.Interop.Windows.Dynamic\TerraFX.Interop.Windows.Dynamic.projitems*{76c66257-fdaa-47ab-85e7-ef757eab10c0}*SharedItemsImports = 5 samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{8cefc324-ca6c-4845-9ad9-70b92bd87057}*SharedItemsImports = 13 src\TerraFX.Interop.Windows.D2D1Interop\TerraFX.Interop.Windows.D2D1Interop.projitems*{9da1da9f-f8b2-4b25-be80-c21f773029e3}*SharedItemsImports = 13 @@ -359,6 +365,18 @@ Global {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|ARM64.Build.0 = Release|Any CPU {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|x64.ActiveCfg = Release|Any CPU {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|x64.Build.0 = Release|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|Any CPU.Build.0 = Debug|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|ARM64.Build.0 = Debug|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|x64.ActiveCfg = Debug|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|x64.Build.0 = Debug|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Release|Any CPU.ActiveCfg = Release|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Release|Any CPU.Build.0 = Release|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Release|ARM64.ActiveCfg = Release|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Release|ARM64.Build.0 = Release|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Release|x64.ActiveCfg = Release|Any CPU + {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -385,6 +403,7 @@ Global {158F984D-CD96-4062-BD02-2268946031A0} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA} {9DA1DA9F-F8B2-4B25-BE80-C21F773029E3} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA} {2608EB41-F98B-4BE5-9F4D-68FED6115088} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA} + {3ACACF03-6B20-40BA-B8EC-11AC1624D2C9} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC} diff --git a/src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.projitems b/src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.projitems new file mode 100644 index 00000000..9003d0e7 --- /dev/null +++ b/src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.projitems @@ -0,0 +1,17 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 3acacf03-6b20-40ba-b8ec-11ac1624d2c9 + + + ComputeSharp.Core.NetStandard + + + + + + + + \ No newline at end of file diff --git a/src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.shproj b/src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.shproj new file mode 100644 index 00000000..9964b218 --- /dev/null +++ b/src/ComputeSharp.Core.NetStandard/ComputeSharp.Core.NetStandard.shproj @@ -0,0 +1,13 @@ + + + + 3acacf03-6b20-40ba-b8ec-11ac1624d2c9 + 14.0 + + + + + + + + diff --git a/src/ComputeSharp.Core.NetStandard/System/InteropServices/MemoryMarshal.cs b/src/ComputeSharp.Core.NetStandard/System/InteropServices/MemoryMarshal.cs new file mode 100644 index 00000000..86710490 --- /dev/null +++ b/src/ComputeSharp.Core.NetStandard/System/InteropServices/MemoryMarshal.cs @@ -0,0 +1,36 @@ +using System; +using System.Runtime.CompilerServices; + +namespace ComputeSharp.Core.NetStandard.System.Runtime.InteropServices; + +/// +/// A polyfill type that mirrors some methods from on .NET 6. +/// +internal static class MemoryMarshal +{ + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T GetReference(Span span) + { + return ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(span); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T GetReference(ReadOnlySpan span) + { + return ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(span); + } + + /// + /// Creates a new from a given reference. + /// + /// The type of reference to wrap. + /// The target reference. + /// The length of the to create. + /// A new wrapping . + public static unsafe Span CreateSpan(ref T value, int length) + { + return new(Unsafe.AsPointer(ref value), length); + } +} \ No newline at end of file diff --git a/src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/InterpolatedStringHandlerArgumentAttribute.cs b/src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/InterpolatedStringHandlerArgumentAttribute.cs similarity index 100% rename from src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/InterpolatedStringHandlerArgumentAttribute.cs rename to src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/InterpolatedStringHandlerArgumentAttribute.cs diff --git a/src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/InterpolatedStringHandlerAttribute.cs b/src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/InterpolatedStringHandlerAttribute.cs similarity index 100% rename from src/ComputeSharp.NetStandard/System/Runtime/CompilerServices/InterpolatedStringHandlerAttribute.cs rename to src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/InterpolatedStringHandlerAttribute.cs diff --git a/src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/RuntimeHelpers.cs b/src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/RuntimeHelpers.cs new file mode 100644 index 00000000..9d2046fc --- /dev/null +++ b/src/ComputeSharp.Core.NetStandard/System/Runtime.CompilerServices/RuntimeHelpers.cs @@ -0,0 +1,18 @@ +using System; +using System.Runtime.InteropServices; + +namespace ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices; + +/// +/// A polyfill type that mirrors some methods from on .NET 5. +/// +internal static class RuntimeHelpers +{ + /// + /// Allocates some memory tied to the lifetime of a specific type. + /// + /// The type to associate the memory to. + /// The size in byte of the memory to allocate. + /// A pointer to the allocated memory. + public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) => Marshal.AllocHGlobal(size); +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs b/src/ComputeSharp.Core/Attributes/AutoConstructorAttribute.cs similarity index 100% rename from src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs rename to src/ComputeSharp.Core/Attributes/AutoConstructorAttribute.cs diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj new file mode 100644 index 00000000..dd367caf --- /dev/null +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -0,0 +1,222 @@ + + + + netstandard2.0;net6.0 + bin\Release + ComputeSharp.Core.xml + + + + + true + true + + + + + + + + + + + + + + + True + True + Hlsl.tt + + + True + True + Bool2.tt + + + True + True + Bool3.tt + + + True + True + Bool4.tt + + + True + True + BoolMxN.tt + + + True + True + Double2.tt + + + True + True + Double3.tt + + + True + True + Double4.tt + + + True + True + DoubleMxN.tt + + + True + True + Float2.tt + + + True + True + Float3.tt + + + True + True + Float4.tt + + + True + True + FloatMxN.tt + + + True + True + Int2.tt + + + True + True + Int3.tt + + + True + True + Int4.tt + + + True + True + IntMxN.tt + + + True + True + UInt2.tt + + + True + True + UInt3.tt + + + True + True + UInt4.tt + + + True + True + UIntMxN.tt + + + + + + TextTemplatingFileGenerator + Hlsl.g.cs + + + TextTemplatingFileGenerator + Bool2.g.cs + + + TextTemplatingFileGenerator + Bool3.g.cs + + + TextTemplatingFileGenerator + Bool4.g.cs + + + TextTemplatingFileGenerator + BoolMxN.g.cs + + + TextTemplatingFileGenerator + Double2.g.cs + + + TextTemplatingFileGenerator + Double3.g.cs + + + TextTemplatingFileGenerator + Double4.g.cs + + + TextTemplatingFileGenerator + DoubleMxN.g.cs + + + TextTemplatingFileGenerator + Float2.g.cs + + + TextTemplatingFileGenerator + Float3.g.cs + + + TextTemplatingFileGenerator + Float4.g.cs + + + TextTemplatingFileGenerator + FloatMxN.g.cs + + + TextTemplatingFileGenerator + Int2.g.cs + + + TextTemplatingFileGenerator + Int3.g.cs + + + TextTemplatingFileGenerator + Int4.g.cs + + + TextTemplatingFileGenerator + IntMxN.g.cs + + + TextTemplatingFileGenerator + UInt2.g.cs + + + TextTemplatingFileGenerator + UInt3.g.cs + + + TextTemplatingFileGenerator + UInt4.g.cs + + + TextTemplatingFileGenerator + UIntMxN.g.cs + + + + + + diff --git a/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs b/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs similarity index 100% rename from src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs rename to src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs diff --git a/src/ComputeSharp/Core/Helpers/System.Runtime.CompilerServices/FormatInterpolatedStringHandler.cs b/src/ComputeSharp.Core/Helpers/FormatInterpolatedStringHandler.cs similarity index 100% rename from src/ComputeSharp/Core/Helpers/System.Runtime.CompilerServices/FormatInterpolatedStringHandler.cs rename to src/ComputeSharp.Core/Helpers/FormatInterpolatedStringHandler.cs diff --git a/src/ComputeSharp/Core/Helpers/System.Runtime.CompilerServices/TryWriteFormatInterpolatedStringHandler.cs b/src/ComputeSharp.Core/Helpers/TryWriteFormatInterpolatedStringHandler.cs similarity index 100% rename from src/ComputeSharp/Core/Helpers/System.Runtime.CompilerServices/TryWriteFormatInterpolatedStringHandler.cs rename to src/ComputeSharp.Core/Helpers/TryWriteFormatInterpolatedStringHandler.cs diff --git a/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs b/src/ComputeSharp.Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs similarity index 100% rename from src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs rename to src/ComputeSharp.Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.cs similarity index 100% rename from src/ComputeSharp/Core/Intrinsics/Hlsl.cs rename to src/ComputeSharp.Core/Intrinsics/Hlsl.cs diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.g.cs similarity index 100% rename from src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs rename to src/ComputeSharp.Core/Intrinsics/Hlsl.g.cs diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.tt b/src/ComputeSharp.Core/Intrinsics/Hlsl.tt similarity index 100% rename from src/ComputeSharp/Core/Intrinsics/Hlsl.tt rename to src/ComputeSharp.Core/Intrinsics/Hlsl.tt diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.ttinclude b/src/ComputeSharp.Core/Intrinsics/Hlsl.ttinclude similarity index 100% rename from src/ComputeSharp/Core/Intrinsics/Hlsl.ttinclude rename to src/ComputeSharp.Core/Intrinsics/Hlsl.ttinclude diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool.cs diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool2.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool2.cs diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs index f1beeb1c..86158121 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.tt b/src/ComputeSharp.Core/Primitives/Bool/Bool2.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool2.tt rename to src/ComputeSharp.Core/Primitives/Bool/Bool2.tt diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool3.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool3.cs diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs index a70a8163..018577c6 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.tt b/src/ComputeSharp.Core/Primitives/Bool/Bool3.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool3.tt rename to src/ComputeSharp.Core/Primitives/Bool/Bool3.tt diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool4.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool4.cs diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs rename to src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs index 699eb862..175339be 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.tt b/src/ComputeSharp.Core/Primitives/Bool/Bool4.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/Bool4.tt rename to src/ComputeSharp.Core/Primitives/Bool/Bool4.tt diff --git a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs rename to src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs index e34bc6bf..3925f701 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif namespace ComputeSharp; diff --git a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.tt b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Bool/BoolMxN.tt rename to src/ComputeSharp.Core/Primitives/Bool/BoolMxN.tt diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.cs b/src/ComputeSharp.Core/Primitives/Double/Double2.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/Double2.cs rename to src/ComputeSharp.Core/Primitives/Double/Double2.cs diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Double/Double2.g.cs rename to src/ComputeSharp.Core/Primitives/Double/Double2.g.cs index fdc974de..86c06ce4 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.tt b/src/ComputeSharp.Core/Primitives/Double/Double2.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/Double2.tt rename to src/ComputeSharp.Core/Primitives/Double/Double2.tt diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.cs b/src/ComputeSharp.Core/Primitives/Double/Double3.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/Double3.cs rename to src/ComputeSharp.Core/Primitives/Double/Double3.cs diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Double/Double3.g.cs rename to src/ComputeSharp.Core/Primitives/Double/Double3.g.cs index b9eecdc9..6bad3710 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.tt b/src/ComputeSharp.Core/Primitives/Double/Double3.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/Double3.tt rename to src/ComputeSharp.Core/Primitives/Double/Double3.tt diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.cs b/src/ComputeSharp.Core/Primitives/Double/Double4.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/Double4.cs rename to src/ComputeSharp.Core/Primitives/Double/Double4.cs diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Double/Double4.g.cs rename to src/ComputeSharp.Core/Primitives/Double/Double4.g.cs index 6b1a6b8e..47a8035a 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.tt b/src/ComputeSharp.Core/Primitives/Double/Double4.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/Double4.tt rename to src/ComputeSharp.Core/Primitives/Double/Double4.tt diff --git a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs b/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs rename to src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs index dfbca48e..0090b66a 100644 --- a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif namespace ComputeSharp; diff --git a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.tt b/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Double/DoubleMxN.tt rename to src/ComputeSharp.Core/Primitives/Double/DoubleMxN.tt diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/Float2.cs rename to src/ComputeSharp.Core/Primitives/Float/Float2.cs diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Float/Float2.g.cs rename to src/ComputeSharp.Core/Primitives/Float/Float2.g.cs index 0f398339..e1962a1a 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.tt b/src/ComputeSharp.Core/Primitives/Float/Float2.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/Float2.tt rename to src/ComputeSharp.Core/Primitives/Float/Float2.tt diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/Float3.cs rename to src/ComputeSharp.Core/Primitives/Float/Float3.cs diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Float/Float3.g.cs rename to src/ComputeSharp.Core/Primitives/Float/Float3.g.cs index 59c29513..22887d9d 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.tt b/src/ComputeSharp.Core/Primitives/Float/Float3.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/Float3.tt rename to src/ComputeSharp.Core/Primitives/Float/Float3.tt diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/Float4.cs rename to src/ComputeSharp.Core/Primitives/Float/Float4.cs diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Float/Float4.g.cs rename to src/ComputeSharp.Core/Primitives/Float/Float4.g.cs index 6f3f7a5a..c22bb7fe 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.tt b/src/ComputeSharp.Core/Primitives/Float/Float4.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/Float4.tt rename to src/ComputeSharp.Core/Primitives/Float/Float4.tt diff --git a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs rename to src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs index 6a838b30..54194c88 100644 --- a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif namespace ComputeSharp; diff --git a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.tt b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Float/FloatMxN.tt rename to src/ComputeSharp.Core/Primitives/Float/FloatMxN.tt diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/Int2.cs rename to src/ComputeSharp.Core/Primitives/Int/Int2.cs diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Int/Int2.g.cs rename to src/ComputeSharp.Core/Primitives/Int/Int2.g.cs index 4ecee7dd..af6218ba 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.tt b/src/ComputeSharp.Core/Primitives/Int/Int2.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/Int2.tt rename to src/ComputeSharp.Core/Primitives/Int/Int2.tt diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/Int3.cs rename to src/ComputeSharp.Core/Primitives/Int/Int3.cs diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Int/Int3.g.cs rename to src/ComputeSharp.Core/Primitives/Int/Int3.g.cs index 40afd255..6b64d48c 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.tt b/src/ComputeSharp.Core/Primitives/Int/Int3.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/Int3.tt rename to src/ComputeSharp.Core/Primitives/Int/Int3.tt diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/Int4.cs rename to src/ComputeSharp.Core/Primitives/Int/Int4.cs diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Int/Int4.g.cs rename to src/ComputeSharp.Core/Primitives/Int/Int4.g.cs index a38f14a3..0189a123 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.tt b/src/ComputeSharp.Core/Primitives/Int/Int4.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/Int4.tt rename to src/ComputeSharp.Core/Primitives/Int/Int4.tt diff --git a/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs rename to src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs index 5b48b091..7f37623c 100644 --- a/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif namespace ComputeSharp; diff --git a/src/ComputeSharp/Core/Primitives/Int/IntMxN.tt b/src/ComputeSharp.Core/Primitives/Int/IntMxN.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/Int/IntMxN.tt rename to src/ComputeSharp.Core/Primitives/Int/IntMxN.tt diff --git a/src/ComputeSharp/Core/Primitives/MatrixIndex.cs b/src/ComputeSharp.Core/Primitives/MatrixIndex.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/MatrixIndex.cs rename to src/ComputeSharp.Core/Primitives/MatrixIndex.cs diff --git a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude similarity index 98% rename from src/ComputeSharp/Core/Primitives/MatrixType.ttinclude rename to src/ComputeSharp.Core/Primitives/MatrixType.ttinclude index 01e662d5..e39de84a 100644 --- a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude @@ -13,8 +13,8 @@ void GenerateAllMatrixProperties(string typeName, int elementSize) using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif namespace ComputeSharp; diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UInt2.cs rename to src/ComputeSharp.Core/Primitives/UInt/UInt2.cs diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs rename to src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs index b45dd25e..3de44ea2 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.tt b/src/ComputeSharp.Core/Primitives/UInt/UInt2.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UInt2.tt rename to src/ComputeSharp.Core/Primitives/UInt/UInt2.tt diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UInt3.cs rename to src/ComputeSharp.Core/Primitives/UInt/UInt3.cs diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs rename to src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs index 38114335..1a754e1a 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.tt b/src/ComputeSharp.Core/Primitives/UInt/UInt3.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UInt3.tt rename to src/ComputeSharp.Core/Primitives/UInt/UInt3.tt diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UInt4.cs rename to src/ComputeSharp.Core/Primitives/UInt/UInt4.cs diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs rename to src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs index 694718aa..e78eb14e 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs @@ -3,8 +3,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.tt b/src/ComputeSharp.Core/Primitives/UInt/UInt4.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UInt4.tt rename to src/ComputeSharp.Core/Primitives/UInt/UInt4.tt diff --git a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs similarity index 99% rename from src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs rename to src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs index b0359271..b2049e19 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs @@ -1,8 +1,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif namespace ComputeSharp; diff --git a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.tt b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.tt similarity index 100% rename from src/ComputeSharp/Core/Primitives/UInt/UIntMxN.tt rename to src/ComputeSharp.Core/Primitives/UInt/UIntMxN.tt diff --git a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude similarity index 98% rename from src/ComputeSharp/Core/Primitives/VectorType.ttinclude rename to src/ComputeSharp.Core/Primitives/VectorType.ttinclude index acf95d3b..de653781 100644 --- a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude @@ -61,8 +61,8 @@ void GenerateVectorProperties(string typeName, int elementSize) using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER -using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.NetStandard.System.Runtime.InteropServices.MemoryMarshal; +using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; +using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #nullable enable diff --git a/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems b/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems index 330d197f..e96aa677 100644 --- a/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems +++ b/src/ComputeSharp.NetStandard/ComputeSharp.NetStandard.projitems @@ -18,8 +18,6 @@ - - diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index 34893c6a..0674274c 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -44,203 +44,4 @@ - - - - - - - - True - True - Hlsl.tt - - - True - True - Bool2.tt - - - True - True - Bool3.tt - - - True - True - Bool4.tt - - - True - True - BoolMxN.tt - - - True - True - Double2.tt - - - True - True - Double3.tt - - - True - True - Double4.tt - - - True - True - DoubleMxN.tt - - - True - True - Float2.tt - - - True - True - Float3.tt - - - True - True - Float4.tt - - - True - True - FloatMxN.tt - - - True - True - Int2.tt - - - True - True - Int3.tt - - - True - True - Int4.tt - - - True - True - IntMxN.tt - - - True - True - UInt2.tt - - - True - True - UInt3.tt - - - True - True - UInt4.tt - - - True - True - UIntMxN.tt - - - - - - TextTemplatingFileGenerator - Hlsl.g.cs - - - TextTemplatingFileGenerator - Bool2.g.cs - - - TextTemplatingFileGenerator - Bool3.g.cs - - - TextTemplatingFileGenerator - Bool4.g.cs - - - TextTemplatingFileGenerator - BoolMxN.g.cs - - - TextTemplatingFileGenerator - Double2.g.cs - - - TextTemplatingFileGenerator - Double3.g.cs - - - TextTemplatingFileGenerator - Double4.g.cs - - - TextTemplatingFileGenerator - DoubleMxN.g.cs - - - TextTemplatingFileGenerator - Float2.g.cs - - - TextTemplatingFileGenerator - Float3.g.cs - - - TextTemplatingFileGenerator - Float4.g.cs - - - TextTemplatingFileGenerator - FloatMxN.g.cs - - - TextTemplatingFileGenerator - Int2.g.cs - - - TextTemplatingFileGenerator - Int3.g.cs - - - TextTemplatingFileGenerator - Int4.g.cs - - - TextTemplatingFileGenerator - IntMxN.g.cs - - - TextTemplatingFileGenerator - UInt2.g.cs - - - TextTemplatingFileGenerator - UInt3.g.cs - - - TextTemplatingFileGenerator - UInt4.g.cs - - - TextTemplatingFileGenerator - UIntMxN.g.cs - -