From 76ceb1aefe8797236639821093285ee28de5ad18 Mon Sep 17 00:00:00 2001 From: Marcel Koester Date: Tue, 29 Aug 2023 10:26:08 +0100 Subject: [PATCH] Removed CLS compliance. (#1057) * Removed CLSCompliance attribute from ILGPU. * Removed CLSCompliance attribute from ILGPU.Algorithms. * Removed CLSCompliance attribute from Tests. --- Src/ILGPU.Algorithms/AssemblyAttributes.cs | 1 - Src/ILGPU.Algorithms/ComparisonOperations.tt | 5 +--- Src/ILGPU.Algorithms/HistogramLaunchers.tt | 3 -- Src/ILGPU.Algorithms/HistogramOperations.tt | 5 +--- .../Optimization/Optimizers/PSO.cs | 17 ++++++----- Src/ILGPU.Algorithms/RadixSortOperations.tt | 8 +----- .../Random/IRandomProvider.cs | 1 - Src/ILGPU.Algorithms/Random/RNG.cs | 4 --- .../Random/RandomExtensions.cs | 5 +--- Src/ILGPU.Algorithms/Random/ThreadWiseRNG.cs | 11 ++++---- Src/ILGPU.Algorithms/Random/XorShift128.cs | 1 - .../Random/XorShift128Plus.cs | 1 - Src/ILGPU.Algorithms/Random/XorShift32.cs | 1 - Src/ILGPU.Algorithms/Random/XorShift64Star.cs | 1 - .../Runtime/Cuda/API/CuFFTAPI.cs | 1 - .../Runtime/Cuda/API/CuFFTWAPI.cs | 1 - .../Runtime/Cuda/API/NvJpegAPI.cs | 1 - .../Runtime/Cuda/API/NvmlAPI.cs | 2 -- Src/ILGPU.Algorithms/Runtime/Cuda/CuFFT.cs | 1 - .../Runtime/Cuda/CuFFTPlan.cs | 3 +- Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTW.cs | 3 +- .../Runtime/Cuda/CuFFTWPlan.tt | 5 ++-- Src/ILGPU.Algorithms/Runtime/Cuda/CuRand.cs | 4 --- Src/ILGPU.Algorithms/Runtime/Cuda/NvJpeg.cs | 3 +- .../Runtime/Cuda/NvJpegLibrary.cs | 3 +- .../Runtime/Cuda/NvJpegState.cs | 3 +- .../Runtime/Cuda/NvJpegStructs.cs | 2 -- .../Runtime/Cuda/NvmlDevice.cs | 16 +---------- .../Runtime/Cuda/NvmlEnums.cs | 3 +- .../Runtime/Cuda/NvmlStructs.cs | 28 +------------------ Src/ILGPU.Algorithms/ScanReduceOperations.tt | 5 +--- Src/ILGPU.Algorithms/Sequencers.tt | 5 +--- Src/ILGPU.Algorithms/UniqueLaunchers.tt | 5 +--- Src/ILGPU.Algorithms/Vectors/VectorTypes.tt | 24 ++++------------ Src/ILGPU.Algorithms/XMath/Abs.cs | 3 +- Src/ILGPU.Algorithms/XMath/BitOperations.cs | 8 +----- Src/ILGPU.Algorithms/XMath/Ints.cs | 6 +--- Src/ILGPU.Algorithms/XMath/MinMax.cs | 14 +--------- Src/ILGPU.Tests/Generic/AssemblyAttributes.cs | 2 -- Src/ILGPU/Atomic.cs | 6 +--- Src/ILGPU/AtomicFunctions.tt | 25 +++++------------ .../OpenCL/CLCodeGenerator.Emitter.cs | 1 - .../Backends/PTX/PTXCodeGenerator.Emitter.cs | 1 - .../Backends/PTX/PTXInstructions.Data.cs | 3 +- .../PointerViews/ViewImplementation.cs | 3 +- Src/ILGPU/Frontend/ILInstruction.cs | 3 -- Src/ILGPU/HalfConversion.tt | 8 +----- Src/ILGPU/IR/AddressSpace.cs | 3 +- Src/ILGPU/IR/Construction/Values.cs | 4 --- .../IR/Intrinsics/IntrinsicImplementation.cs | 1 - Src/ILGPU/IR/Values/Constants.cs | 4 --- Src/ILGPU/IndexTypes.tt | 1 - Src/ILGPU/Interop.cs | 6 ---- Src/ILGPU/IntrinsicMath.BitOperations.cs | 8 +----- Src/ILGPU/IntrinsicMath.cs | 24 ---------------- Src/ILGPU/Properties/AssemblyInfo.cs | 3 +- Src/ILGPU/Runtime/CPU/CPUMemoryBuffer.cs | 2 -- Src/ILGPU/Runtime/Cuda/LibDevice.tt | 6 +--- Src/ILGPU/Runtime/OpenCL/CLAPI.cs | 14 ++-------- Src/ILGPU/Runtime/OpenCL/CLDevice.cs | 1 - Src/ILGPU/Static/TypeInformation.ttinclude | 4 +-- Src/ILGPU/Util/Bitwise.cs | 6 +--- Src/ILGPU/Util/Utilities.cs | 1 - 63 files changed, 60 insertions(+), 293 deletions(-) diff --git a/Src/ILGPU.Algorithms/AssemblyAttributes.cs b/Src/ILGPU.Algorithms/AssemblyAttributes.cs index 8dd4c3ba5..4871c1bbb 100644 --- a/Src/ILGPU.Algorithms/AssemblyAttributes.cs +++ b/Src/ILGPU.Algorithms/AssemblyAttributes.cs @@ -1,5 +1,4 @@ using System; using System.Runtime.CompilerServices; -[assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo(ILGPU.Context.RuntimeAssemblyName)] diff --git a/Src/ILGPU.Algorithms/ComparisonOperations.tt b/Src/ILGPU.Algorithms/ComparisonOperations.tt index 139de8866..61c7c5e84 100644 --- a/Src/ILGPU.Algorithms/ComparisonOperations.tt +++ b/Src/ILGPU.Algorithms/ComparisonOperations.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2020-2021 ILGPU Project +// Copyright (c) 2020-2023 ILGPU Project // www.ilgpu.net // // File: ComparisonOperations.tt/ComparisonOperations.cs @@ -27,9 +27,6 @@ namespace ILGPU.Algorithms.ComparisonOperations /// /// Represents an comparison between two elements of type <#= type.Type #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct Comparison<#= type.Name #> : IComparisonOperation<<#= type.Type #>> { diff --git a/Src/ILGPU.Algorithms/HistogramLaunchers.tt b/Src/ILGPU.Algorithms/HistogramLaunchers.tt index d56d41168..da76fa087 100644 --- a/Src/ILGPU.Algorithms/HistogramLaunchers.tt +++ b/Src/ILGPU.Algorithms/HistogramLaunchers.tt @@ -49,9 +49,6 @@ namespace ILGPU.Algorithms /// /// Single-element view that indicates whether the histogram has overflowed. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public static void Histogram( this Accelerator accelerator, AcceleratorStream stream, diff --git a/Src/ILGPU.Algorithms/HistogramOperations.tt b/Src/ILGPU.Algorithms/HistogramOperations.tt index def2e053c..6d2afeb89 100644 --- a/Src/ILGPU.Algorithms/HistogramOperations.tt +++ b/Src/ILGPU.Algorithms/HistogramOperations.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2020-2021 ILGPU Project +// Copyright (c) 2020-2023 ILGPU Project // www.ilgpu.net // // File: HistogramOperations.tt/HistogramOperations.cs @@ -27,9 +27,6 @@ namespace ILGPU.Algorithms.HistogramOperations /// /// Represents atomically incrementing a histogram bin of type <#= type.Type #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct HistogramIncrement<#= type.Name #> : IIncrementOperation<<#= type.Type #>> { diff --git a/Src/ILGPU.Algorithms/Optimization/Optimizers/PSO.cs b/Src/ILGPU.Algorithms/Optimization/Optimizers/PSO.cs index 5b4a69b73..74556fed4 100644 --- a/Src/ILGPU.Algorithms/Optimization/Optimizers/PSO.cs +++ b/Src/ILGPU.Algorithms/Optimization/Optimizers/PSO.cs @@ -28,12 +28,12 @@ public static class PSO /// A common choice for Omega. /// public const float Omega = 0.8f; - + /// /// A common choice for PhiG. /// public const float PhiG = 1.5f; - + /// /// A common choice for PhiP. /// @@ -52,7 +52,7 @@ public static class PSO /// public static ReadOnlySpan DefaultFloatParameters => FloatParameters; } - + /// /// Represents a particle-swap optimization engine (PSO) that uses a PSO algorithm /// to solve n-dimensional optimization problems. @@ -61,7 +61,6 @@ public static class PSO /// The element type of a numeric type. /// The evaluation data type. /// The RNG type. - [CLSCompliant(false)] public sealed class PSO : OptimizationEngine where TNumericType : unmanaged, IVectorType @@ -73,10 +72,10 @@ public sealed class PSO private const int ParameterOmega = 0; private const int ParameterPhiP = 1; private const int ParameterPhiG = 2; - + private readonly MemoryBuffer2D velocities; private readonly MemoryBuffer2D bestPositions; - + /// /// Creates a new PS engine. /// @@ -108,7 +107,7 @@ public PSO( bestPositions.View, EvaluationsView); } - + /// /// Returns a PSO-specific data view. /// @@ -122,7 +121,7 @@ public TElementType Omega get => GetParameter(ParameterOmega); set => GetParameter(ParameterOmega) = value; } - + /// /// Gets or sets the phi p velocity parameter. /// @@ -131,7 +130,7 @@ public TElementType PhiP get => GetParameter(ParameterPhiP); set => GetParameter(ParameterPhiP) = value; } - + /// /// Gets or sets the phi g velocity parameter. /// diff --git a/Src/ILGPU.Algorithms/RadixSortOperations.tt b/Src/ILGPU.Algorithms/RadixSortOperations.tt index acc1f15d0..1958de1a3 100644 --- a/Src/ILGPU.Algorithms/RadixSortOperations.tt +++ b/Src/ILGPU.Algorithms/RadixSortOperations.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2019-2021 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: RadixSortOperations.tt/RadixSortOperations.cs @@ -27,9 +27,6 @@ namespace ILGPU.Algorithms.RadixSortOperations /// /// Represents an ascending radix sort operation of type <#= type.Type #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct Ascending<#=type.Name #> : IRadixSortOperation<<#= type.Type #>> { @@ -100,9 +97,6 @@ namespace ILGPU.Algorithms.RadixSortOperations /// /// Represents a descending radix sort operation of type <#= type.Type #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct Descending<#= type.Name #> : IRadixSortOperation<<#= type.Type #>> { diff --git a/Src/ILGPU.Algorithms/Random/IRandomProvider.cs b/Src/ILGPU.Algorithms/Random/IRandomProvider.cs index b62f3ef3b..17ca8ec3f 100644 --- a/Src/ILGPU.Algorithms/Random/IRandomProvider.cs +++ b/Src/ILGPU.Algorithms/Random/IRandomProvider.cs @@ -53,7 +53,6 @@ public interface IRandomProvider /// An abstract RNG provider that supports period shifts. /// /// The implementing provider type. - [CLSCompliant(false)] public interface IRandomProvider : IRandomProvider where TProvider : struct, IRandomProvider { diff --git a/Src/ILGPU.Algorithms/Random/RNG.cs b/Src/ILGPU.Algorithms/Random/RNG.cs index 5cde2461b..d5ed7eafc 100644 --- a/Src/ILGPU.Algorithms/Random/RNG.cs +++ b/Src/ILGPU.Algorithms/Random/RNG.cs @@ -31,7 +31,6 @@ public abstract class RNG : AcceleratorObject /// The random provider type. /// The current accelerator. /// The parent RNG provider. - [CLSCompliant(false)] public static RNG Create( Accelerator accelerator, System.Random random) @@ -47,7 +46,6 @@ public static RNG Create( /// /// The maximum number of parallel warps. /// - [CLSCompliant(false)] public static RNG Create( Accelerator accelerator, System.Random random, @@ -148,7 +146,6 @@ public abstract void FillUniform( /// is stored within an underlying memory buffer. /// /// The random provider type. - [CLSCompliant(false)] public readonly struct RNGView : IRandomProvider where TRandomProvider : unmanaged, IRandomProvider { @@ -259,7 +256,6 @@ public readonly double NextDouble() => /// /// The random provider type. /// Members of this class are not thread safe. - [CLSCompliant(false)] public class RNG : RNG where TRandomProvider : unmanaged, IRandomProvider { diff --git a/Src/ILGPU.Algorithms/Random/RandomExtensions.cs b/Src/ILGPU.Algorithms/Random/RandomExtensions.cs index 579ed86fb..282f73647 100644 --- a/Src/ILGPU.Algorithms/Random/RandomExtensions.cs +++ b/Src/ILGPU.Algorithms/Random/RandomExtensions.cs @@ -180,7 +180,6 @@ public static long Next( /// The random provider type. /// The current accelerator. /// The parent RNG provider. - [CLSCompliant(false)] public static RNG CreateRNG( this Accelerator accelerator, System.Random random) @@ -196,7 +195,6 @@ public static RNG CreateRNG( /// /// The maximum number of parallel warps. /// - [CLSCompliant(false)] public static RNG CreateRNG( this Accelerator accelerator, System.Random random, @@ -220,7 +218,7 @@ internal static void InitializeRNGKernel( { randomProvider[i] = default(TRandomProvider).CreateProvider(ref provider); } - + // Update provider state for future iterations sourceProviders[index] = provider; } @@ -236,7 +234,6 @@ internal static void InitializeRNGKernel( /// The view to fill. /// The source RNG provider. /// The number of CPU initializers to use. - [CLSCompliant(false)] public static void InitRNGView( this Accelerator accelerator, AcceleratorStream stream, diff --git a/Src/ILGPU.Algorithms/Random/ThreadWiseRNG.cs b/Src/ILGPU.Algorithms/Random/ThreadWiseRNG.cs index c0b30c990..f6ac4d041 100644 --- a/Src/ILGPU.Algorithms/Random/ThreadWiseRNG.cs +++ b/Src/ILGPU.Algorithms/Random/ThreadWiseRNG.cs @@ -19,17 +19,16 @@ namespace ILGPU.Algorithms.Random /// Represents a single RNG instance per thread stored separately in a memory buffer. /// /// The underlying RNG provider type. - [CLSCompliant(false)] public class ThreadWiseRNG : DisposeBase where TRandomProvider : unmanaged, IRandomProvider { #region Instance - + /// /// Stores a single RNG instance per thread. /// private readonly MemoryBuffer1D randomProviders; - + /// /// Constructs an RNG using the given provider instance. /// @@ -54,9 +53,9 @@ public ThreadWiseRNG( randomProviders = accelerator.Allocate1D(maxNumThreads); accelerator.InitRNGView(stream, RNGView, random, numInitializers); } - + #endregion - + #region Methods /// @@ -65,7 +64,7 @@ public ThreadWiseRNG( public ArrayView RNGView => randomProviders.View; #endregion - + #region IDisposable /// diff --git a/Src/ILGPU.Algorithms/Random/XorShift128.cs b/Src/ILGPU.Algorithms/Random/XorShift128.cs index 71e1a7c03..b942f603d 100644 --- a/Src/ILGPU.Algorithms/Random/XorShift128.cs +++ b/Src/ILGPU.Algorithms/Random/XorShift128.cs @@ -20,7 +20,6 @@ namespace ILGPU.Algorithms.Random /// Implements a simple and fast xor-shift rng. /// /// https://en.wikipedia.org/wiki/Xorshift - [CLSCompliant(false)] public struct XorShift128 : IEquatable, IRandomProvider { #region Static diff --git a/Src/ILGPU.Algorithms/Random/XorShift128Plus.cs b/Src/ILGPU.Algorithms/Random/XorShift128Plus.cs index 89ecb7106..e56431a5a 100644 --- a/Src/ILGPU.Algorithms/Random/XorShift128Plus.cs +++ b/Src/ILGPU.Algorithms/Random/XorShift128Plus.cs @@ -20,7 +20,6 @@ namespace ILGPU.Algorithms.Random /// Implements a simple and fast xor-shift rng. /// /// https://en.wikipedia.org/wiki/Xorshift - [CLSCompliant(false)] public struct XorShift128Plus : IEquatable, IRandomProvider diff --git a/Src/ILGPU.Algorithms/Random/XorShift32.cs b/Src/ILGPU.Algorithms/Random/XorShift32.cs index 72730de71..adce2c54c 100644 --- a/Src/ILGPU.Algorithms/Random/XorShift32.cs +++ b/Src/ILGPU.Algorithms/Random/XorShift32.cs @@ -20,7 +20,6 @@ namespace ILGPU.Algorithms.Random /// Implements a simple and fast xor-shift rng. /// /// https://en.wikipedia.org/wiki/Xorshift - [CLSCompliant(false)] public struct XorShift32 : IEquatable, IRandomProvider { #region Static diff --git a/Src/ILGPU.Algorithms/Random/XorShift64Star.cs b/Src/ILGPU.Algorithms/Random/XorShift64Star.cs index d1df63694..9fd0335f6 100644 --- a/Src/ILGPU.Algorithms/Random/XorShift64Star.cs +++ b/Src/ILGPU.Algorithms/Random/XorShift64Star.cs @@ -20,7 +20,6 @@ namespace ILGPU.Algorithms.Random /// Implements a simple and fast xor-shift rng. /// /// https://en.wikipedia.org/wiki/Xorshift - [CLSCompliant(false)] public struct XorShift64Star : IEquatable, IRandomProvider diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTAPI.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTAPI.cs index dd6a6e176..c421b8ad9 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTAPI.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTAPI.cs @@ -18,7 +18,6 @@ namespace ILGPU.Runtime.Cuda.API /// /// An implementation of the cuFFT API. /// - [CLSCompliant(false)] public abstract partial class CuFFTAPI { #region Static diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTWAPI.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTWAPI.cs index a61d03323..4d264bd74 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTWAPI.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/API/CuFFTWAPI.cs @@ -16,7 +16,6 @@ namespace ILGPU.Runtime.Cuda.API /// /// An implementation of the cuFFT API. /// - [CLSCompliant(false)] public abstract partial class CuFFTWAPI { #region Static diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvJpegAPI.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvJpegAPI.cs index 58548450b..95986133e 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvJpegAPI.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvJpegAPI.cs @@ -16,7 +16,6 @@ namespace ILGPU.Runtime.Cuda.API /// /// An implementation of the nvJpeg API. /// - [CLSCompliant(false)] public abstract partial class NvJpegAPI { #region Static diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvmlAPI.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvmlAPI.cs index e85b9956d..9f4d14696 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvmlAPI.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/API/NvmlAPI.cs @@ -20,7 +20,6 @@ namespace ILGPU.Runtime.Cuda.API /// /// An implementation of the NVML API. /// - [CLSCompliant(false)] public abstract partial class NvmlAPI { #region Static @@ -281,7 +280,6 @@ public unsafe NvmlReturn DeviceGetBoardPartNumber( /// Provides access to /// without using raw pointers. /// - [CLSCompliant(false)] public unsafe NvmlReturn DeviceGetBridgeChipInfo( IntPtr device, out NvmlBridgeChipHierarchy bridgeHierarchy) diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFT.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFT.cs index 2ae50353b..b649fe155 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFT.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFT.cs @@ -17,7 +17,6 @@ namespace ILGPU.Runtime.Cuda /// /// Wrapper over cuFFT to simplify integration with ILGPU. /// - [CLSCompliant(false)] public sealed class CuFFT { /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTPlan.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTPlan.cs index d73572288..1fc1ef633 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTPlan.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTPlan.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: CuFFTPlan.cs @@ -18,7 +18,6 @@ namespace ILGPU.Runtime.Cuda /// /// Represents a cuFFT plan. /// - [CLSCompliant(false)] public sealed partial class CuFFTPlan : DisposeBase { /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTW.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTW.cs index de58c84e6..9f9b855fe 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTW.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTW.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: CuFFTW.cs @@ -17,7 +17,6 @@ namespace ILGPU.Runtime.Cuda /// /// Wrapper over cuFFTW to simplify integration with ILGPU. /// - [CLSCompliant(false)] public sealed partial class CuFFTW { /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTWPlan.tt b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTWPlan.tt index a4fd30638..6dd728602 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTWPlan.tt +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTWPlan.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: CuFFTWPlan.tt/CuFFTWPlan.cs @@ -35,7 +35,6 @@ namespace ILGPU.Runtime.Cuda /// /// Represents a cuFFTW plan for "<#= realType #>" type. /// - [CLSCompliant(false)] public sealed class CuFFTWPlan<#= suffix #> : DisposeBase { /// @@ -57,7 +56,7 @@ namespace ILGPU.Runtime.Cuda } base.Dispose(disposing); } - + /// /// The underlying API wrapper. /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/CuRand.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/CuRand.cs index 2aae7a7bd..ceb7f01d6 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/CuRand.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/CuRand.cs @@ -296,7 +296,6 @@ private void UpdateOrKeepStream(AcceleratorStream stream) /// /// The stream to use. /// The view to fill. - [CLSCompliant(false)] public unsafe void FillUniform( AcceleratorStream stream, ArrayView view) @@ -314,7 +313,6 @@ public unsafe void FillUniform( /// /// The stream to use. /// The view to fill. - [CLSCompliant(false)] public unsafe void FillUniform( AcceleratorStream stream, ArrayView view) @@ -534,7 +532,6 @@ private CPUCuRand( /// Fills the given span with uniformly distributed unsigned integers. /// /// The span to fill. - [CLSCompliant(false)] public unsafe void FillUniform(Span span) { fixed (uint* ptr = span) @@ -551,7 +548,6 @@ public unsafe void FillUniform(Span span) /// Fills the given span with uniformly distributed unsigned longs. /// /// The span to fill. - [CLSCompliant(false)] public unsafe void FillUniform(Span span) { fixed (ulong* ptr = span) diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpeg.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpeg.cs index 6ac50bf24..ed0834950 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpeg.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpeg.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: NvJpeg.cs @@ -17,7 +17,6 @@ namespace ILGPU.Runtime.Cuda /// /// Wrapper over NvJpeg to simplify integration with ILGPU. /// - [CLSCompliant(false)] public sealed class NvJpeg { /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegLibrary.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegLibrary.cs index 9a31415ee..b475b8b26 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegLibrary.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegLibrary.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: NvJpegLibrary.cs @@ -18,7 +18,6 @@ namespace ILGPU.Runtime.Cuda /// /// Represents an NvJpeg library. /// - [CLSCompliant(false)] public sealed partial class NvJpegLibrary : DisposeBase { /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegState.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegState.cs index 638f6f19b..da223b562 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegState.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegState.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: NvJpegState.cs @@ -18,7 +18,6 @@ namespace ILGPU.Runtime.Cuda /// /// Represents an NvJpeg state. /// - [CLSCompliant(false)] public sealed partial class NvJpegState : DisposeBase { /// diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegStructs.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegStructs.cs index 45f0a9356..5008db190 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegStructs.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvJpegStructs.cs @@ -18,14 +18,12 @@ namespace ILGPU.Runtime.Cuda { - [CLSCompliant(false)] public unsafe struct NvJpegImage_Interop { public fixed ulong Channel[NvJpegConstants.NVJPEG_MAX_COMPONENT]; public fixed ulong Pitch[NvJpegConstants.NVJPEG_MAX_COMPONENT]; } - [CLSCompliant(false)] public struct NvJpegImage { #region Properties diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlDevice.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlDevice.cs index 59ac90c75..548b6e9fe 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlDevice.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlDevice.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: NvmlDevice.cs @@ -79,7 +79,6 @@ public static NvmlDevice CreateFromUUID(string uuid) /// Constructs a new instance to access the Nvidia Management Library /// from the index of the GPU. /// - [CLSCompliant(false)] public static NvmlDevice CreateFromIndex(uint index) { var api = CreateInitAPI(new NvmlAPIVersion?()); @@ -117,7 +116,6 @@ private static NvmlAPI CreateInitAPI(NvmlAPIVersion? apiVersion) /// /// Returns the associated NVML API instance. /// - [CLSCompliant(false)] public NvmlAPI API { get; } /// @@ -152,7 +150,6 @@ protected override void Dispose(bool disposing) /// Returns the the intended operating speed of the device's fan. /// /// The fan speed percentage. - [CLSCompliant(false)] public uint GetFanSpeed() { NvmlException.ThrowIfFailed( @@ -165,7 +162,6 @@ public uint GetFanSpeed() /// /// The fan to query. /// The fan speed percentage. - [CLSCompliant(false)] public uint GetFanSpeed(uint fan) { NvmlException.ThrowIfFailed( @@ -176,7 +172,6 @@ public uint GetFanSpeed(uint fan) /// /// Returns the current temperature readings for the device, in degrees C. /// - [CLSCompliant(false)] public uint GetGpuTemperature() { NvmlException.ThrowIfFailed( @@ -191,7 +186,6 @@ public uint GetGpuTemperature() /// Returns the temperature threshold for the device, in degrees C. /// /// The threshold to query. - [CLSCompliant(false)] public uint GetTemperatureThreshold(NvmlTemperatureThresholds threshold) { NvmlException.ThrowIfFailed( @@ -206,7 +200,6 @@ public uint GetTemperatureThreshold(NvmlTemperatureThresholds threshold) /// Returns the current speed of the graphics clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetGraphicsClockSpeed() { NvmlException.ThrowIfFailed( @@ -221,7 +214,6 @@ public uint GetGraphicsClockSpeed() /// Returns the current speed of the SM clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetStreamingMultiprocessorClockSpeed() { NvmlException.ThrowIfFailed( @@ -236,7 +228,6 @@ public uint GetStreamingMultiprocessorClockSpeed() /// Returns the current speed of the memory clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetMemoryClockSpeed() { NvmlException.ThrowIfFailed( @@ -251,7 +242,6 @@ public uint GetMemoryClockSpeed() /// Returns the current speed of the video clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetVideoClockSpeed() { NvmlException.ThrowIfFailed( @@ -266,7 +256,6 @@ public uint GetVideoClockSpeed() /// Returns the max speed of the graphics clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetMaxGraphicsClockSpeed() { NvmlException.ThrowIfFailed( @@ -281,7 +270,6 @@ public uint GetMaxGraphicsClockSpeed() /// Returns the max speed of the SM clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetMaxStreamingMultiprocessorClockSpeed() { NvmlException.ThrowIfFailed( @@ -296,7 +284,6 @@ public uint GetMaxStreamingMultiprocessorClockSpeed() /// Returns the max speed of the memory clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetMaxMemoryClockSpeed() { NvmlException.ThrowIfFailed( @@ -311,7 +298,6 @@ public uint GetMaxMemoryClockSpeed() /// Returns the max speed of the video clock for the device, in MHz. /// /// The speed in MHz. - [CLSCompliant(false)] public uint GetMaxVideoClockSpeed() { NvmlException.ThrowIfFailed( diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlEnums.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlEnums.cs index 93a7aba77..68e572775 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlEnums.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlEnums.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: NvmlEnums.cs @@ -338,7 +338,6 @@ public enum NvmlValueType : int NVML_VALUE_TYPE_COUNT } - [CLSCompliant(false)] public static class NvmlConstants { public const uint NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE = 16; diff --git a/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlStructs.cs b/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlStructs.cs index 178020db2..0c4f6dcf4 100644 --- a/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlStructs.cs +++ b/Src/ILGPU.Algorithms/Runtime/Cuda/NvmlStructs.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: NvmlStructs.cs @@ -18,7 +18,6 @@ namespace ILGPU.Runtime.Cuda { - [CLSCompliant(false)] public struct NvmlDeviceAttributes { public uint MultiprocessorCount; @@ -32,7 +31,6 @@ public struct NvmlDeviceAttributes public ulong MemorySizeMB; } - [CLSCompliant(false)] public struct NvmlBAR1Memory { public ulong Bar1Total; @@ -40,7 +38,6 @@ public struct NvmlBAR1Memory public ulong Bar1Used; } - [CLSCompliant(false)] public struct NvmlBridgeChipInfo { internal const int INTEROP_SIZE = sizeof(NvmlBridgeChipType) + sizeof(uint); @@ -49,7 +46,6 @@ public struct NvmlBridgeChipInfo public uint FwVersion; } - [CLSCompliant(false)] [StructLayout(LayoutKind.Explicit, Size = INTEROP_SIZE)] public unsafe struct NvmlBridgeChipHierarchy_Interop { @@ -65,14 +61,12 @@ public unsafe struct NvmlBridgeChipHierarchy_Interop public NvmlBridgeChipInfo* BridgeChipInfo; } - [CLSCompliant(false)] public struct NvmlBridgeChipHierarchy { public byte BridgeCount; public NvmlBridgeChipInfo[] BridgeChipInfo; } - [CLSCompliant(false)] public struct NvmlEccErrorCounts { public ulong L1Cache; @@ -81,7 +75,6 @@ public struct NvmlEccErrorCounts public ulong RegisterFile; } - [CLSCompliant(false)] public struct NvmlEncoderSessionInfo { public uint SessionId; @@ -94,7 +87,6 @@ public struct NvmlEncoderSessionInfo public uint AverageLatency; } - [CLSCompliant(false)] public struct NvmlFBCSessionInfo { public uint SessionId; @@ -111,7 +103,6 @@ public struct NvmlFBCSessionInfo public uint AverageLatency; } - [CLSCompliant(false)] public struct NvmlFBCStats { public uint SessionsCount; @@ -119,7 +110,6 @@ public struct NvmlFBCStats public uint AverageLatency; } - [CLSCompliant(false)] public unsafe struct NvmlHwbcEntry_Interop { public const int NVML_MAX_FIRMWAREVERSION = 32; @@ -128,14 +118,12 @@ public unsafe struct NvmlHwbcEntry_Interop public fixed byte FirmwareVersion[NVML_MAX_FIRMWAREVERSION]; } - [CLSCompliant(false)] public struct NvmlHwbcEntry { public uint HwbcId; public string FirmwareVersion; } - [CLSCompliant(false)] public unsafe struct NvmlLedState_Interop { public const int NVML_MAX_CAUSE = 256; @@ -150,7 +138,6 @@ public struct NvmlLedState public NvmlLedColor Color; } - [CLSCompliant(false)] public struct NvmlMemory { public ulong Total; @@ -158,7 +145,6 @@ public struct NvmlMemory public ulong Used; } - [CLSCompliant(false)] public unsafe struct NvmlPciInfo_Interop { public fixed byte BusIdLegacy[ @@ -171,7 +157,6 @@ public unsafe struct NvmlPciInfo_Interop public fixed byte BusId[(int)NvmlConstants.NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; } - [CLSCompliant(false)] public unsafe struct NvmlPciInfo { public string BusIdLegacy; @@ -183,7 +168,6 @@ public unsafe struct NvmlPciInfo public string BusId; } - [CLSCompliant(false)] public struct NvmlProcessInfo { public uint Pid; @@ -192,7 +176,6 @@ public struct NvmlProcessInfo public uint ComputeInstanceId; } - [CLSCompliant(false)] public unsafe struct NvmlPSUInfo_Interop { public const int NVML_MAX_STATE = 80; @@ -202,7 +185,6 @@ public unsafe struct NvmlPSUInfo_Interop public uint Voltage; } - [CLSCompliant(false)] public unsafe struct NvmlPSUInfo { public uint Current; @@ -211,7 +193,6 @@ public unsafe struct NvmlPSUInfo public uint Voltage; } - [CLSCompliant(false)] [StructLayout(LayoutKind.Explicit)] public struct NvmlSample { @@ -234,7 +215,6 @@ public struct NvmlSample public long SllVal; } - [CLSCompliant(false)] public struct NvmlUnitFanInfo { internal const int INTEROP_SIZE = sizeof(uint) + sizeof(NvmlFanState); @@ -243,7 +223,6 @@ public struct NvmlUnitFanInfo public NvmlFanState State; } - [CLSCompliant(false)] [StructLayout(LayoutKind.Explicit, Size = INTEROP_SIZE)] public unsafe struct NvmlUnitFanSpeeds_Interop { @@ -259,14 +238,12 @@ public unsafe struct NvmlUnitFanSpeeds_Interop public NvmlUnitFanInfo* Fans; } - [CLSCompliant(false)] public unsafe struct NvmlUnitFanSpeeds { public uint Count; public NvmlUnitFanInfo[] Fans; } - [CLSCompliant(false)] public unsafe struct NvmlUnitInfo_Interop { public const int NVML_MAX_STRLEN = 96; @@ -277,7 +254,6 @@ public unsafe struct NvmlUnitInfo_Interop public fixed byte Serial[NVML_MAX_STRLEN]; } - [CLSCompliant(false)] public struct NvmlUnitInfo { public string FirmwareVersion; @@ -286,14 +262,12 @@ public struct NvmlUnitInfo public string Serial; } - [CLSCompliant(false)] public struct NvmlUtilization { public uint Gpu; public uint Memory; } - [CLSCompliant(false)] public struct NvmlViolationTime { public ulong ReferenceTime; diff --git a/Src/ILGPU.Algorithms/ScanReduceOperations.tt b/Src/ILGPU.Algorithms/ScanReduceOperations.tt index 59baecc75..76ffed8fa 100644 --- a/Src/ILGPU.Algorithms/ScanReduceOperations.tt +++ b/Src/ILGPU.Algorithms/ScanReduceOperations.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2019-2021 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: ScanReduceOperations.tt/ScanReduceOperations.cs @@ -38,9 +38,6 @@ namespace ILGPU.Algorithms.ScanReduceOperations /// /// Represents an <#= op.Name #> reduction of type <#= type.Type #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct <#= op.Name #><#= type.Name #> : IScanReduceOperation<<#= type.Type #>> { /// diff --git a/Src/ILGPU.Algorithms/Sequencers.tt b/Src/ILGPU.Algorithms/Sequencers.tt index d9a20c896..78fbdd5fd 100644 --- a/Src/ILGPU.Algorithms/Sequencers.tt +++ b/Src/ILGPU.Algorithms/Sequencers.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2019-2021 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: Sequencers.tt/Sequencers.cs @@ -28,9 +28,6 @@ namespace ILGPU.Algorithms.Sequencers /// /// Represents an identity implementation of a sequencer. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct <#= type.Name #>Sequencer : ISequencer<<#= type.Type #>> { /// diff --git a/Src/ILGPU.Algorithms/UniqueLaunchers.tt b/Src/ILGPU.Algorithms/UniqueLaunchers.tt index 22fb2b8be..ca451d74e 100644 --- a/Src/ILGPU.Algorithms/UniqueLaunchers.tt +++ b/Src/ILGPU.Algorithms/UniqueLaunchers.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2020-2021 ILGPU Project +// Copyright (c) 2020-2023 ILGPU Project // www.ilgpu.net // // File: UniqueLaunchers.tt/UniqueLaunchers.cs @@ -38,9 +38,6 @@ namespace ILGPU.Algorithms /// The accelerator stream. /// The input view. /// The new/valid length of the input view. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public static long Unique( this Accelerator accelerator, AcceleratorStream stream, diff --git a/Src/ILGPU.Algorithms/Vectors/VectorTypes.tt b/Src/ILGPU.Algorithms/Vectors/VectorTypes.tt index 136274fc8..27c9bc685 100644 --- a/Src/ILGPU.Algorithms/Vectors/VectorTypes.tt +++ b/Src/ILGPU.Algorithms/Vectors/VectorTypes.tt @@ -27,12 +27,12 @@ var accumulationTypes = new Dictionary() { "byte", "sbyte", "short", "ushort", "int", "float", "double" }}, {"Int64", new string[] { "byte", "sbyte", "short", "ushort", "int", "uint", "float", "double" }}, - + {"UInt32", new string[] { "byte", "ushort", "uint", "float", "double" }}, {"UInt64", new string[] { "byte", "ushort", "uint", "ulong", "float", "double" }}, - + {"Float", new string[] { "float", "byte", "sbyte", "short", "ushort", "int", "uint", "long", "ulong" }}, {"Double", new string[] @@ -86,9 +86,6 @@ namespace ILGPU.Algorithms.Vectors /// /// Represents a vectorized <#= type.Type #> type with length <#= vectorLength #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly record struct <#= typeName #>( <#= string.Join(", ", vectorItemNames .Take(vectorLength) @@ -111,7 +108,6 @@ namespace ILGPU.Algorithms.Vectors /// /// The offset of the <#= vectorItemNames[i] #> field in bytes. /// - [CLSCompliant(false)] public static UIntPtr OffsetPtr<#= vectorItemNames[i] #> => new UIntPtr((uint)Offset<#= vectorItemNames[i] #>); <# } #> @@ -331,12 +327,10 @@ namespace ILGPU.Algorithms.Vectors /// The computed average. public <#= typeName #> ComputeAverage(long denominator) => this / FromScalar((<#= type.Type #>)denominator); - + <# } #> <# foreach (var accType in accumulations) { #> <# var otherTypeName = GetTypeNameByName(accType, vectorLength); #> -<# string clsCompliant = type.IsCLSCompliant && - GetTypeByName(accType).IsCLSCompliant ? "true" : "false"; #> <# if (accType != type.Type) { #> /// /// Adds an accumulation instance and a more coarse grained value instance. @@ -344,43 +338,39 @@ namespace ILGPU.Algorithms.Vectors /// The precise accumulation instance. /// The value to add. /// The accumulated instance. - [CLSCompliant(<#= clsCompliant #>)] public static <#= typeName #> operator +( <#= typeName #> current, <#= otherTypeName #> toAccumulate) => current + ConvertFrom_<#= accType #>(toAccumulate); - + /// /// Adds an accumulation instance and a more coarse grained value instance. /// /// The precise accumulation instance. /// The value to add. /// The accumulated instance. - [CLSCompliant(<#= clsCompliant #>)] public static <#= typeName #> operator +( <#= otherTypeName #> toAccumulate, <#= typeName #> current) => ConvertFrom_<#= accType #>(toAccumulate) + current; - + /// /// Subtracts an accumulation instance and a more coarse grained value instance. /// /// The precise accumulation instance. /// The value to subtract. /// The accumulated instance. - [CLSCompliant(<#= clsCompliant #>)] public static <#= typeName #> operator -( <#= typeName #> current, <#= otherTypeName #> toAccumulate) => current - ConvertFrom_<#= accType #>(toAccumulate); - + /// /// Subtracts an accumulation instance and a more coarse grained value instance. /// /// The precise accumulation instance. /// The value to subtract. /// The accumulated instance. - [CLSCompliant(<#= clsCompliant #>)] public static <#= typeName #> operator -( <#= otherTypeName #> toAccumulate, <#= typeName #> current) => @@ -391,7 +381,6 @@ namespace ILGPU.Algorithms.Vectors /// /// The target memory address. /// The current value to add. - [CLSCompliant(<#= clsCompliant #>)] public static void AtomicAdd( ref <#= typeName #> target, <#= otherTypeName #> value) => @@ -452,7 +441,6 @@ namespace ILGPU.Algorithms.Vectors /// /// The denominator to use. /// The computed average. - [CLSCompliant(<#= clsCompliant #>)] public <#= typeName #> ComputeAverage(<#= accType #> denominator) => this / FromScalar((<#= type.Type #>)denominator); diff --git a/Src/ILGPU.Algorithms/XMath/Abs.cs b/Src/ILGPU.Algorithms/XMath/Abs.cs index 9fcea5179..1e97f84c8 100644 --- a/Src/ILGPU.Algorithms/XMath/Abs.cs +++ b/Src/ILGPU.Algorithms/XMath/Abs.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2019-2021 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: Abs.cs @@ -39,7 +39,6 @@ public static float Abs(float value) => /// /// The value. /// |value|. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static sbyte Abs(sbyte value) => IntrinsicMath.Abs(value); diff --git a/Src/ILGPU.Algorithms/XMath/BitOperations.cs b/Src/ILGPU.Algorithms/XMath/BitOperations.cs index a7072afdf..24997e719 100644 --- a/Src/ILGPU.Algorithms/XMath/BitOperations.cs +++ b/Src/ILGPU.Algorithms/XMath/BitOperations.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2020-2021 ILGPU Project +// Copyright (c) 2020-2023 ILGPU Project // www.ilgpu.net // // File: BitOperations.cs @@ -31,7 +31,6 @@ partial class XMath /// /// The value to use. /// The number of one bits. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int PopCount(uint value) => IntrinsicMath.PopCount(value); @@ -48,7 +47,6 @@ partial class XMath /// /// The value to use. /// The number of one bits. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int PopCount(ulong value) => IntrinsicMath.PopCount(value); @@ -71,7 +69,6 @@ public static int LeadingZeroCount(int value) => /// /// The value to use. /// The number of leading zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int LeadingZeroCount(uint value) => IntrinsicMath.LeadingZeroCount(value); @@ -90,7 +87,6 @@ public static int LeadingZeroCount(long value) => /// /// The value to use. /// The number of leading zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int LeadingZeroCount(ulong value) => IntrinsicMath.LeadingZeroCount(value); @@ -113,7 +109,6 @@ public static int TrailingZeroCount(int value) => /// /// The value to use. /// The number of trailing zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(uint value) => IntrinsicMath.TrailingZeroCount(value); @@ -132,7 +127,6 @@ public static int TrailingZeroCount(long value) => /// /// The value to use. /// The number of trailing zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(ulong value) => IntrinsicMath.TrailingZeroCount(value); diff --git a/Src/ILGPU.Algorithms/XMath/Ints.cs b/Src/ILGPU.Algorithms/XMath/Ints.cs index 81bc65807..dc762463b 100644 --- a/Src/ILGPU.Algorithms/XMath/Ints.cs +++ b/Src/ILGPU.Algorithms/XMath/Ints.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2019-2021 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: Ints.cs @@ -75,7 +75,6 @@ public static long DivRoundUp(long numerator, long denominator) => /// /// The value to decompose. /// The lower and upper part. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IntrinsicMath.IntegerParts Decompose(long value) => IntrinsicMath.Decompose(value); @@ -85,7 +84,6 @@ public static IntrinsicMath.IntegerParts Decompose(long value) => /// /// The value to decompose. /// The lower and upper part. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IntrinsicMath.IntegerParts Decompose(ulong value) => IntrinsicMath.Decompose(value); @@ -95,7 +93,6 @@ public static IntrinsicMath.IntegerParts Decompose(ulong value) => /// /// The lower and upper parts. /// The composed integer. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong ComposeULong(IntrinsicMath.IntegerParts parts) => parts.ToULong(); @@ -105,7 +102,6 @@ public static ulong ComposeULong(IntrinsicMath.IntegerParts parts) => /// /// The lower and upper parts. /// The composed integer. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long ComposeLong(IntrinsicMath.IntegerParts parts) => (long)parts.ToULong(); diff --git a/Src/ILGPU.Algorithms/XMath/MinMax.cs b/Src/ILGPU.Algorithms/XMath/MinMax.cs index 7b559eb59..5173946aa 100644 --- a/Src/ILGPU.Algorithms/XMath/MinMax.cs +++ b/Src/ILGPU.Algorithms/XMath/MinMax.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU Algorithms -// Copyright (c) 2019-2021 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: MinMax.cs @@ -42,7 +42,6 @@ public static float Min(float first, float second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static sbyte Min(sbyte first, sbyte second) => IntrinsicMath.Min(first, second); @@ -93,7 +92,6 @@ public static byte Min(byte first, byte second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Min(ushort first, ushort second) => IntrinsicMath.Min(first, second); @@ -104,7 +102,6 @@ public static ushort Min(ushort first, ushort second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Min(uint first, uint second) => IntrinsicMath.Min(first, second); @@ -115,7 +112,6 @@ public static uint Min(uint first, uint second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Min(ulong first, ulong second) => IntrinsicMath.Min(first, second); @@ -146,7 +142,6 @@ public static float Max(float first, float second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static sbyte Max(sbyte first, sbyte second) => IntrinsicMath.Max(first, second); @@ -197,7 +192,6 @@ public static byte Max(byte first, byte second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Max(ushort first, ushort second) => IntrinsicMath.Max(first, second); @@ -208,7 +202,6 @@ public static ushort Max(ushort first, ushort second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Max(uint first, uint second) => IntrinsicMath.Max(first, second); @@ -219,7 +212,6 @@ public static uint Max(uint first, uint second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Max(ulong first, ulong second) => IntrinsicMath.Max(first, second); @@ -253,7 +245,6 @@ public static float Clamp(float value, float min, float max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static sbyte Clamp(sbyte value, sbyte min, sbyte max) => IntrinsicMath.Clamp(value, min, max); @@ -309,7 +300,6 @@ public static byte Clamp(byte value, byte min, byte max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Clamp(ushort value, ushort min, ushort max) => IntrinsicMath.Clamp(value, min, max); @@ -321,7 +311,6 @@ public static ushort Clamp(ushort value, ushort min, ushort max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Clamp(uint value, uint min, uint max) => IntrinsicMath.Clamp(value, min, max); @@ -333,7 +322,6 @@ public static uint Clamp(uint value, uint min, uint max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Clamp(ulong value, ulong min, ulong max) => IntrinsicMath.Clamp(value, min, max); diff --git a/Src/ILGPU.Tests/Generic/AssemblyAttributes.cs b/Src/ILGPU.Tests/Generic/AssemblyAttributes.cs index 459886aa1..bce24fa1f 100644 --- a/Src/ILGPU.Tests/Generic/AssemblyAttributes.cs +++ b/Src/ILGPU.Tests/Generic/AssemblyAttributes.cs @@ -1,6 +1,4 @@ using ILGPU; -using System; using System.Runtime.CompilerServices; -[assembly: CLSCompliant(false)] [assembly: InternalsVisibleTo(Context.RuntimeAssemblyName)] diff --git a/Src/ILGPU/Atomic.cs b/Src/ILGPU/Atomic.cs index 0edfca8a4..3f9a23e82 100644 --- a/Src/ILGPU/Atomic.cs +++ b/Src/ILGPU/Atomic.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2017-2021 ILGPU Project +// Copyright (c) 2017-2023 ILGPU Project // www.ilgpu.net // // File: Atomic.cs @@ -90,7 +90,6 @@ public static Index1D Add(ref Index1D target, Index1D value) => /// The target location. /// The target value. /// The old value. - [CLSCompliant(false)] [AtomicIntrinsic(AtomicIntrinsicKind.Exchange, AtomicFlags.Unsigned)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Exchange(ref uint target, uint value) => @@ -102,7 +101,6 @@ public static uint Exchange(ref uint target, uint value) => /// The target location. /// The target value. /// The old value. - [CLSCompliant(false)] [AtomicIntrinsic(AtomicIntrinsicKind.Exchange, AtomicFlags.Unsigned)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Exchange(ref ulong target, ulong value) => @@ -159,7 +157,6 @@ public static Index1D Exchange(ref Index1D target, Index1D value) => /// The expected comparison value. /// The target value. /// The old value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [AtomicIntrinsic(AtomicIntrinsicKind.CompareExchange, AtomicFlags.Unsigned)] public static uint CompareExchange( @@ -178,7 +175,6 @@ ref Unsafe.As(ref target), /// The expected comparison value. /// The target value. /// The old value. - [CLSCompliant(false)] [AtomicIntrinsic(AtomicIntrinsicKind.CompareExchange, AtomicFlags.Unsigned)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong CompareExchange( diff --git a/Src/ILGPU/AtomicFunctions.tt b/Src/ILGPU/AtomicFunctions.tt index 244599173..f354e978a 100644 --- a/Src/ILGPU/AtomicFunctions.tt +++ b/Src/ILGPU/AtomicFunctions.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2016-2021 ILGPU Project +// Copyright (c) 2016-2023 ILGPU Project // www.ilgpu.net // // File: AtomicFunctions.tt/AtomicFunctions.cs @@ -36,9 +36,6 @@ namespace ILGPU /// /// Represents an atomic compare-exchange operation of type <#= type.Type #>. /// -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> public readonly struct CompareExchange<#= type.Name #> : ICompareExchangeOperation<<#= type.Type #>> { @@ -109,7 +106,6 @@ namespace ILGPU /// The target location. /// The value to add. /// The old value that was stored at the target location. - [CLSCompliant(false)] [AtomicIntrinsic(AtomicIntrinsicKind.Add, AtomicFlags.Unsigned)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static <#= type.Type #> Add( @@ -131,7 +127,6 @@ namespace ILGPU /// The target location. /// The value to add. /// The old value that was stored at the target location. - [CLSCompliant(false)] [AtomicIntrinsic(AtomicIntrinsicKind.Add, AtomicFlags.None)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static <#= type.Type #> Add( @@ -165,8 +160,7 @@ namespace ILGPU /// The target location. /// The comparison value. /// The old value that was stored at the target location. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] +<# if (type.IsUnsignedInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Max, AtomicFlags.Unsigned)] <# } else if (type.IsInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Max, AtomicFlags.None)] @@ -203,8 +197,7 @@ namespace ILGPU /// The target location. /// The comparison value. /// The old value that was stored at the target location. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] +<# if (type.IsUnsignedInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Min, AtomicFlags.Unsigned)] <# } else if (type.IsInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Min, AtomicFlags.None)] @@ -242,8 +235,7 @@ namespace ILGPU /// The target location. /// The comparison value. /// The old value that was stored at the target location. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] +<# if (type.IsUnsignedInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.And, AtomicFlags.Unsigned)] <# } else if (type.IsInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.And, AtomicFlags.None)] @@ -281,8 +273,7 @@ namespace ILGPU /// The target location. /// The comparison value. /// The old value that was stored at the target location. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] +<# if (type.IsUnsignedInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Or, AtomicFlags.Unsigned)] <# } else if (type.IsInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Or, AtomicFlags.None)] @@ -320,8 +311,7 @@ namespace ILGPU /// The target location. /// The comparison value. /// The old value that was stored at the target location. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] +<# if (type.IsUnsignedInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Xor, AtomicFlags.Unsigned)] <# } else if (type.IsInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Xor, AtomicFlags.None)] @@ -349,8 +339,7 @@ namespace ILGPU /// The target location. /// The target value. /// The old value. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] +<# if (type.IsUnsignedInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Exchange, AtomicFlags.Unsigned)] <# } else if (type.IsInt) { #> [AtomicIntrinsic(AtomicIntrinsicKind.Exchange, AtomicFlags.None)] diff --git a/Src/ILGPU/Backends/OpenCL/CLCodeGenerator.Emitter.cs b/Src/ILGPU/Backends/OpenCL/CLCodeGenerator.Emitter.cs index 5fa76fb1a..de6416999 100644 --- a/Src/ILGPU/Backends/OpenCL/CLCodeGenerator.Emitter.cs +++ b/Src/ILGPU/Backends/OpenCL/CLCodeGenerator.Emitter.cs @@ -586,7 +586,6 @@ public void AppendConstant(long value) => /// Appends a constant. /// /// The constant to append. - [CLSCompliant(false)] public void AppendConstant(ulong value) => stringBuilder.Append(value); diff --git a/Src/ILGPU/Backends/PTX/PTXCodeGenerator.Emitter.cs b/Src/ILGPU/Backends/PTX/PTXCodeGenerator.Emitter.cs index dbb529153..a7cc2ba62 100644 --- a/Src/ILGPU/Backends/PTX/PTXCodeGenerator.Emitter.cs +++ b/Src/ILGPU/Backends/PTX/PTXCodeGenerator.Emitter.cs @@ -292,7 +292,6 @@ public void AppendConstant(long value) /// Appends a constant. /// /// The constant to append. - [CLSCompliant(false)] public void AppendConstant(ulong value) { AppendArgument(); diff --git a/Src/ILGPU/Backends/PTX/PTXInstructions.Data.cs b/Src/ILGPU/Backends/PTX/PTXInstructions.Data.cs index e04451b3e..54b490ee2 100644 --- a/Src/ILGPU/Backends/PTX/PTXInstructions.Data.cs +++ b/Src/ILGPU/Backends/PTX/PTXInstructions.Data.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2019-2022 ILGPU Project +// Copyright (c) 2019-2023 ILGPU Project // www.ilgpu.net // // File: PTXInstructions.Data.cs @@ -107,7 +107,6 @@ partial class PTXInstructions /// /// A warp member mask that considers all threads in a warp. /// - [CLSCompliant(false)] public const uint AllThreadsInAWarpMemberMask = 0xffffffff; private static readonly Dictionary LEAMulOperations = diff --git a/Src/ILGPU/Backends/PointerViews/ViewImplementation.cs b/Src/ILGPU/Backends/PointerViews/ViewImplementation.cs index e398b1c6e..fb2fdb06d 100644 --- a/Src/ILGPU/Backends/PointerViews/ViewImplementation.cs +++ b/Src/ILGPU/Backends/PointerViews/ViewImplementation.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2018-2021 ILGPU Project +// Copyright (c) 2018-2023 ILGPU Project // www.ilgpu.net // // File: ViewImplementation.cs @@ -21,7 +21,6 @@ namespace ILGPU.Backends.PointerViews /// native pointers. /// /// The element type. - [CLSCompliant(false)] [StructLayout(LayoutKind.Sequential)] public unsafe readonly struct ViewImplementation where T : unmanaged diff --git a/Src/ILGPU/Frontend/ILInstruction.cs b/Src/ILGPU/Frontend/ILInstruction.cs index 3400d4a47..b3ae53170 100644 --- a/Src/ILGPU/Frontend/ILInstruction.cs +++ b/Src/ILGPU/Frontend/ILInstruction.cs @@ -651,7 +651,6 @@ public sealed class ILInstruction : IEquatable /// /// The instruction argument. /// The current location. - [CLSCompliant(false)] public ILInstruction( int offset, ILInstructionType type, @@ -697,13 +696,11 @@ public ILInstruction( /// /// Returns the number of elements to pop from the stack. /// - [CLSCompliant(false)] public ushort PopCount { get; } /// /// Returns the number of elements to push onto the stack. /// - [CLSCompliant(false)] public ushort PushCount { get; } /// diff --git a/Src/ILGPU/HalfConversion.tt b/Src/ILGPU/HalfConversion.tt index e920c616e..7ae9b5327 100644 --- a/Src/ILGPU/HalfConversion.tt +++ b/Src/ILGPU/HalfConversion.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2016-2021 ILGPU Project +// Copyright (c) 2016-2023 ILGPU Project // www.ilgpu.net // // File: HalfConversion.tt/HalfConversion.cs @@ -96,9 +96,6 @@ namespace ILGPU /// Implicitly converts a half to type <#= type.Name #>. /// /// The half to convert. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> <# if (type.IsUnsignedInt) { #> [ConvertIntrinisc(ConvertFlags.TargetUnsigned)] <# } else { #> @@ -112,9 +109,6 @@ namespace ILGPU /// Explicitly converts an instance of type <#= type.Name #> to a half. /// /// The value to convert. -<# if (!type.IsCLSCompliant) { #> - [CLSCompliant(false)] -<# } #> <# if (type.IsUnsignedInt) { #> [ConvertIntrinisc(ConvertFlags.SourceUnsigned)] <# } else { #> diff --git a/Src/ILGPU/IR/AddressSpace.cs b/Src/ILGPU/IR/AddressSpace.cs index 897cefd94..c50614d9c 100644 --- a/Src/ILGPU/IR/AddressSpace.cs +++ b/Src/ILGPU/IR/AddressSpace.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2018-2021 ILGPU Project +// Copyright (c) 2018-2023 ILGPU Project // www.ilgpu.net // // File: AddressSpace.cs @@ -50,7 +50,6 @@ public interface IAddressSpace { } /// /// Represents an address-space annotation. /// - [CLSCompliant(false)] [AttributeUsage(AttributeTargets.Struct)] public sealed class AddressSpaceAttribute : Attribute { diff --git a/Src/ILGPU/IR/Construction/Values.cs b/Src/ILGPU/IR/Construction/Values.cs index 0890d4229..f97771bcf 100644 --- a/Src/ILGPU/IR/Construction/Values.cs +++ b/Src/ILGPU/IR/Construction/Values.cs @@ -150,7 +150,6 @@ public PrimitiveValue CreatePrimitiveValue(Location location, bool value) => /// The current location. /// The value. /// The created primitive value. - [CLSCompliant(false)] public PrimitiveValue CreatePrimitiveValue(Location location, sbyte value) => Append(new PrimitiveValue( GetInitializer(location), @@ -184,7 +183,6 @@ public PrimitiveValue CreatePrimitiveValue(Location location, short value) => /// The current location. /// The value. /// The created primitive value. - [CLSCompliant(false)] public PrimitiveValue CreatePrimitiveValue(Location location, ushort value) => CreatePrimitiveValue(location, (short)value); @@ -206,7 +204,6 @@ public PrimitiveValue CreatePrimitiveValue(Location location, int value) => /// The current location. /// The value. /// The created primitive value. - [CLSCompliant(false)] public PrimitiveValue CreatePrimitiveValue(Location location, uint value) => CreatePrimitiveValue(location, (int)value); @@ -228,7 +225,6 @@ public PrimitiveValue CreatePrimitiveValue(Location location, long value) => /// The current location. /// The value. /// The created primitive value. - [CLSCompliant(false)] public PrimitiveValue CreatePrimitiveValue(Location location, ulong value) => CreatePrimitiveValue(location, (long)value); diff --git a/Src/ILGPU/IR/Intrinsics/IntrinsicImplementation.cs b/Src/ILGPU/IR/Intrinsics/IntrinsicImplementation.cs index ef258b05c..1554dfff6 100644 --- a/Src/ILGPU/IR/Intrinsics/IntrinsicImplementation.cs +++ b/Src/ILGPU/IR/Intrinsics/IntrinsicImplementation.cs @@ -142,6 +142,5 @@ public IntrinsicMapping ResolveMapping() /// specialization. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - [CLSCompliant(false)] public sealed class IntrinsicImplementationAttribute : Attribute { } } diff --git a/Src/ILGPU/IR/Values/Constants.cs b/Src/ILGPU/IR/Values/Constants.cs index b88a8d8c5..9c79a7684 100644 --- a/Src/ILGPU/IR/Values/Constants.cs +++ b/Src/ILGPU/IR/Values/Constants.cs @@ -147,7 +147,6 @@ internal PrimitiveValue( /// /// Returns the value as si8. /// - [CLSCompliant(false)] public sbyte Int8Value => (sbyte)(rawValue & 0xff); /// @@ -173,19 +172,16 @@ internal PrimitiveValue( /// /// Returns the value as u16. /// - [CLSCompliant(false)] public ushort UInt16Value => (ushort)Int16Value; /// /// Returns the value as u32. /// - [CLSCompliant(false)] public uint UInt32Value => (uint)Int32Value; /// /// Returns the value as u64. /// - [CLSCompliant(false)] public ulong UInt64Value => (ulong)Int64Value; /// diff --git a/Src/ILGPU/IndexTypes.tt b/Src/ILGPU/IndexTypes.tt index 5eac9ca3e..cbfa669de 100644 --- a/Src/ILGPU/IndexTypes.tt +++ b/Src/ILGPU/IndexTypes.tt @@ -516,7 +516,6 @@ namespace ILGPU /// Implicitly converts an index to an unsigned value. /// /// The index to convert. - [CLSCompliant(false)] public static explicit operator u<#= baseType #>(<#= name #> idx) => (u<#= baseType #>)idx.X; } diff --git a/Src/ILGPU/Interop.cs b/Src/ILGPU/Interop.cs index 49cd8b862..8f8926d67 100644 --- a/Src/ILGPU/Interop.cs +++ b/Src/ILGPU/Interop.cs @@ -166,7 +166,6 @@ public static int OffsetOf(string fieldName) /// /// The value to cast. /// The int value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [InteropIntrinsic(InteropIntrinsicKind.FloatAsInt)] public static ushort FloatAsInt(Half value) => @@ -177,7 +176,6 @@ public static ushort FloatAsInt(Half value) => /// /// The value to cast. /// The int value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [InteropIntrinsic(InteropIntrinsicKind.FloatAsInt)] public static uint FloatAsInt(float value) => @@ -188,7 +186,6 @@ public static uint FloatAsInt(float value) => /// /// The value to cast. /// The int value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [InteropIntrinsic(InteropIntrinsicKind.FloatAsInt)] public static ulong FloatAsInt(double value) => @@ -199,7 +196,6 @@ public static ulong FloatAsInt(double value) => /// /// The value to cast. /// The float value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [InteropIntrinsic(InteropIntrinsicKind.IntAsFloat)] public static Half IntAsFloat(ushort value) => @@ -210,7 +206,6 @@ public static Half IntAsFloat(ushort value) => /// /// The value to cast. /// The float value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [InteropIntrinsic(InteropIntrinsicKind.IntAsFloat)] public static float IntAsFloat(uint value) => @@ -221,7 +216,6 @@ public static float IntAsFloat(uint value) => /// /// The value to cast. /// The float value. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] [InteropIntrinsic(InteropIntrinsicKind.IntAsFloat)] public static double IntAsFloat(ulong value) => diff --git a/Src/ILGPU/IntrinsicMath.BitOperations.cs b/Src/ILGPU/IntrinsicMath.BitOperations.cs index 0e6b21413..9d1ef72fc 100644 --- a/Src/ILGPU/IntrinsicMath.BitOperations.cs +++ b/Src/ILGPU/IntrinsicMath.BitOperations.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2020-2021 ILGPU Project +// Copyright (c) 2020-2023 ILGPU Project // www.ilgpu.net // // File: IntrinsicMath.BitOperations.cs @@ -43,7 +43,6 @@ public static class BitOperations /// /// The value to use. /// The number of one bits. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int PopCount(uint value) { @@ -66,7 +65,6 @@ public static int PopCount(uint value) /// /// The value to use. /// The number of one bits. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int PopCount(ulong value) { @@ -95,7 +93,6 @@ public static int LeadingZeroCount(int value) => /// /// The value to use. /// The number of leading zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int LeadingZeroCount(uint value) { @@ -121,7 +118,6 @@ public static int LeadingZeroCount(long value) => /// /// The value to use. /// The number of leading zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int LeadingZeroCount(ulong value) { @@ -141,7 +137,6 @@ public static int LeadingZeroCount(ulong value) /// /// The value to use. /// The number of trailing zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(uint value) => TrailingZeroCount((int)value); @@ -160,7 +155,6 @@ public static int TrailingZeroCount(int value) => /// /// The value to use. /// The number of trailing zeros. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(ulong value) => TrailingZeroCount((long)value); diff --git a/Src/ILGPU/IntrinsicMath.cs b/Src/ILGPU/IntrinsicMath.cs index 1aa228adb..eedc91d82 100644 --- a/Src/ILGPU/IntrinsicMath.cs +++ b/Src/ILGPU/IntrinsicMath.cs @@ -58,7 +58,6 @@ public static Half Abs(Half value) => /// /// The value. /// |value|. - [CLSCompliant(false)] public static sbyte Abs(sbyte value) => (sbyte)Abs((int)value); @@ -118,7 +117,6 @@ public static float Min(float first, float second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] public static sbyte Min(sbyte first, sbyte second) => (sbyte)Min((int)first, second); @@ -166,7 +164,6 @@ public static byte Min(byte first, byte second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] public static ushort Min(ushort first, ushort second) => (ushort)Min((uint)first, second); @@ -176,7 +173,6 @@ public static ushort Min(ushort first, ushort second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.Min, ArithmeticFlags.Unsigned)] public static uint Min(uint first, uint second) => Math.Min(first, second); @@ -187,7 +183,6 @@ public static uint Min(uint first, uint second) => /// The first argument. /// The second argument. /// The minimum of first and second value. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.Min, ArithmeticFlags.Unsigned)] public static ulong Min(ulong first, ulong second) => Math.Min(first, second); @@ -218,7 +213,6 @@ public static float Max(float first, float second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] public static sbyte Max(sbyte first, sbyte second) => (sbyte)Max((int)first, second); @@ -266,7 +260,6 @@ public static byte Max(byte first, byte second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] public static ushort Max(ushort first, ushort second) => (ushort)Max((uint)first, second); @@ -276,7 +269,6 @@ public static ushort Max(ushort first, ushort second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.Max, ArithmeticFlags.Unsigned)] public static uint Max(uint first, uint second) => Math.Max(first, second); @@ -287,7 +279,6 @@ public static uint Max(uint first, uint second) => /// The first argument. /// The second argument. /// The maximum of first and second value. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.Max, ArithmeticFlags.Unsigned)] public static ulong Max(ulong first, ulong second) => Math.Max(first, second); @@ -323,7 +314,6 @@ public static float Clamp(float value, float min, float max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] public static sbyte Clamp(sbyte value, sbyte min, sbyte max) => Max(Min(value, max), min); @@ -374,7 +364,6 @@ public static byte Clamp(byte value, byte min, byte max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] public static ushort Clamp(ushort value, ushort min, ushort max) => Max(Min(value, max), min); @@ -385,7 +374,6 @@ public static ushort Clamp(ushort value, ushort min, ushort max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] public static uint Clamp(uint value, uint min, uint max) => Max(Min(value, max), min); @@ -396,7 +384,6 @@ public static uint Clamp(uint value, uint min, uint max) => /// The first argument. /// The second argument. /// The clamped value in the interval [min, max]. - [CLSCompliant(false)] public static ulong Clamp(ulong value, ulong min, ulong max) => Max(Min(value, max), min); @@ -417,7 +404,6 @@ public static ulong Clamp(ulong value, ulong min, ulong max) => /// /// The value to use. /// The number of one bits. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.PopC)] public static int PopCount(uint value) => BitOperations.PopCount(value); @@ -434,7 +420,6 @@ public static ulong Clamp(ulong value, ulong min, ulong max) => /// /// The value to use. /// The number of one bits. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.PopC)] public static int PopCount(ulong value) => BitOperations.PopCount(value); @@ -456,7 +441,6 @@ public static int LeadingZeroCount(int value) => /// /// The value to use. /// The number of leading zeros. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.CLZ)] public static int LeadingZeroCount(uint value) => BitOperations.LeadingZeroCount(value); @@ -475,7 +459,6 @@ public static int LeadingZeroCount(long value) => /// /// The value to use. /// The number of leading zeros. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.CLZ)] public static int LeadingZeroCount(ulong value) => BitOperations.LeadingZeroCount(value); @@ -498,7 +481,6 @@ public static int TrailingZeroCount(int value) => /// /// The value to use. /// The number of trailing zeros. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.CTZ)] public static int TrailingZeroCount(uint value) => BitOperations.TrailingZeroCount(value); @@ -517,7 +499,6 @@ public static int TrailingZeroCount(long value) => /// /// The value to use. /// The number of trailing zeros. - [CLSCompliant(false)] [MathIntrinsic(MathIntrinsicKind.CTZ)] public static int TrailingZeroCount(ulong value) => BitOperations.TrailingZeroCount(value); @@ -581,7 +562,6 @@ public static long DivRoundUp(long numerator, long denominator) => /// /// Represents integer parts of an 64 bit integer. /// - [CLSCompliant(false)] public struct IntegerParts { /// @@ -625,7 +605,6 @@ public IntegerParts(uint lower, uint upper) /// /// The value to decompose. /// The lower and upper part. - [CLSCompliant(false)] public static IntegerParts Decompose(long value) => Decompose((ulong)value); /// @@ -633,7 +612,6 @@ public IntegerParts(uint lower, uint upper) /// /// The value to decompose. /// The lower and upper part. - [CLSCompliant(false)] public static IntegerParts Decompose(ulong value) => new IntegerParts(value); @@ -642,7 +620,6 @@ public static IntegerParts Decompose(ulong value) => /// /// The lower and upper parts. /// The composed integer. - [CLSCompliant(false)] public static ulong ComposeULong(IntegerParts parts) => parts.ToULong(); /// @@ -650,7 +627,6 @@ public static IntegerParts Decompose(ulong value) => /// /// The lower and upper parts. /// The composed integer. - [CLSCompliant(false)] public static long ComposeLong(IntegerParts parts) => (long)ComposeULong(parts); #endregion diff --git a/Src/ILGPU/Properties/AssemblyInfo.cs b/Src/ILGPU/Properties/AssemblyInfo.cs index 725c6c06a..eb142aaea 100644 --- a/Src/ILGPU/Properties/AssemblyInfo.cs +++ b/Src/ILGPU/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2021 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: AssemblyInfo.cs @@ -13,4 +13,3 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] -[assembly: CLSCompliant(true)] diff --git a/Src/ILGPU/Runtime/CPU/CPUMemoryBuffer.cs b/Src/ILGPU/Runtime/CPU/CPUMemoryBuffer.cs index 6bd629a1f..133f858aa 100644 --- a/Src/ILGPU/Runtime/CPU/CPUMemoryBuffer.cs +++ b/Src/ILGPU/Runtime/CPU/CPUMemoryBuffer.cs @@ -498,7 +498,6 @@ public static unsafe CPUMemoryBuffer Create( /// The native value pointer. /// The length of this source. /// A wrapped pointer memory buffer. - [CLSCompliant(false)] public static unsafe CPUMemoryBuffer Create( Accelerator accelerator, T* value, @@ -518,7 +517,6 @@ public static unsafe CPUMemoryBuffer Create( /// The length of this source. /// The element size. /// A wrapped pointer memory buffer. - [CLSCompliant(false)] public static unsafe CPUMemoryBuffer Create( Accelerator accelerator, IntPtr ptr, diff --git a/Src/ILGPU/Runtime/Cuda/LibDevice.tt b/Src/ILGPU/Runtime/Cuda/LibDevice.tt index b1779a7f3..14815dfad 100644 --- a/Src/ILGPU/Runtime/Cuda/LibDevice.tt +++ b/Src/ILGPU/Runtime/Cuda/LibDevice.tt @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2021-2022 ILGPU Project +// Copyright (c) 2021-2023 ILGPU Project // www.ilgpu.net // // File: LibDevice.tt/LibDevice.cs @@ -26,8 +26,6 @@ using ILGPU.Backends.PTX; using System.Runtime.CompilerServices; #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member -#pragma warning disable CS3001 // Argument type is not CLS-compliant -#pragma warning disable CS3002 // Return type is not CLS-compliant #pragma warning disable IDE0018 // Inline variable declaration #pragma warning disable IDE1006 // Naming Styles @@ -55,8 +53,6 @@ namespace ILGPU.Runtime.Cuda #pragma warning restore IDE1006 // Naming Styles #pragma warning restore IDE0018 // Inline variable declaration -#pragma warning restore CS3002 // Return type is not CLS-compliant -#pragma warning restore CS3001 // Argument type is not CLS-compliant #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member <#+ diff --git a/Src/ILGPU/Runtime/OpenCL/CLAPI.cs b/Src/ILGPU/Runtime/OpenCL/CLAPI.cs index 20b99dfbd..09e231c3c 100644 --- a/Src/ILGPU/Runtime/OpenCL/CLAPI.cs +++ b/Src/ILGPU/Runtime/OpenCL/CLAPI.cs @@ -140,7 +140,6 @@ public CLError GetPlatforms(IntPtr[] platforms, ref int numPlatforms) /// The target platform ids to fill. /// The resolved number of platforms. /// The error code. - [CLSCompliant(false)] public CLError GetPlatforms(IntPtr* platforms, ref int numPlatforms) => clGetPlatformIDs(numPlatforms, platforms, out numPlatforms); @@ -219,7 +218,6 @@ public CLError GetDevices( /// The device ids to fill. /// The number of devices. /// The error code. - [CLSCompliant(false)] public CLError GetDevices( IntPtr platform, CLDeviceType deviceType, @@ -510,7 +508,6 @@ public CLError BuildProgram( /// The program build options (refer to the OpenCL specification). /// /// The error code. - [CLSCompliant(false)] public CLError BuildProgram( IntPtr program, IntPtr* devices, @@ -557,7 +554,6 @@ public CLError BuildProgram( /// The parameter value to use. /// The resulting parameter value size. /// The error code. - [CLSCompliant(false)] public CLError GetProgramInfo( IntPtr program, CLProgramInfo paramName, @@ -581,7 +577,6 @@ public CLError GetProgramInfo( /// The parameter value to use. /// The resulting parameter value size. /// The error code. - [CLSCompliant(false)] public CLError GetProgramBuildInfo( IntPtr program, IntPtr device, @@ -697,7 +692,6 @@ public CLError SetKernelArgument( /// The argument size in bytes. /// A pointer to the value to set. /// The error code. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public CLError SetKernelArgumentUnsafe( IntPtr kernel, @@ -718,7 +712,6 @@ public CLError SetKernelArgumentUnsafe( /// The argument size in bytes. /// A pointer to the value to set. /// The error code. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public CLError SetKernelArgumentUnsafeWithKernel( CLKernel kernel, @@ -788,7 +781,6 @@ internal unsafe CLError LaunchKernelWithStreamBinding( /// All global work sizes. /// All local work sizes. /// The error code. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public CLError LaunchKernelUnsafe( IntPtr queue, @@ -1117,7 +1109,7 @@ internal CLError WaitForEvents(ReadOnlySpan events) /// previously enqueued commands to complete before it completes. /// /// This command blocks command execution, that is, any following commands - /// enqueued after it do not execute until it completes. + /// enqueued after it do not execute until it completes. /// /// The command queue. /// The error code. @@ -1132,9 +1124,9 @@ internal CLError EnqueueBarrier(IntPtr queue) => /// Enqueues a barrier command on the given command queue which waits for the /// list of events to complete, or if the list is empty, waits for all previously /// enqueued commands to complete before it completes. - /// + /// /// This command blocks command execution, that is, any following commands - /// enqueued after it do not execute until it completes. + /// enqueued after it do not execute until it completes. /// /// The command queue. /// The events to wait on. diff --git a/Src/ILGPU/Runtime/OpenCL/CLDevice.cs b/Src/ILGPU/Runtime/OpenCL/CLDevice.cs index 27437f61a..29a4ccb58 100644 --- a/Src/ILGPU/Runtime/OpenCL/CLDevice.cs +++ b/Src/ILGPU/Runtime/OpenCL/CLDevice.cs @@ -615,7 +615,6 @@ public bool HasAnyExtension(TCollection extensions) /// All input values. /// The resolved value. /// True, if the value could be resolved. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool TryGetKernelSubGroupInfo( IntPtr kernel, diff --git a/Src/ILGPU/Static/TypeInformation.ttinclude b/Src/ILGPU/Static/TypeInformation.ttinclude index b904e4d79..2f2369583 100644 --- a/Src/ILGPU/Static/TypeInformation.ttinclude +++ b/Src/ILGPU/Static/TypeInformation.ttinclude @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2016-2021 ILGPU Project +// Copyright (c) 2016-2023 ILGPU Project // www.ilgpu.net // // File: TypeInformation.ttinclude @@ -59,8 +59,6 @@ public class TypeInformation public bool IsFloat => Kind == TypeInformationKind.Float; - public bool IsCLSCompliant => !(IsUnsignedInt || Name == "Int8"); - public string SizeOfType => Name == "Half" ? "sizeof(ushort)" : $"sizeof({Type})"; public string DefaultValue => Name == "Half" ? "Half.Zero" : "0"; diff --git a/Src/ILGPU/Util/Bitwise.cs b/Src/ILGPU/Util/Bitwise.cs index fd3fd441f..3c2f30248 100644 --- a/Src/ILGPU/Util/Bitwise.cs +++ b/Src/ILGPU/Util/Bitwise.cs @@ -1,6 +1,6 @@ // --------------------------------------------------------------------------------------- // ILGPU -// Copyright (c) 2022 ILGPU Project +// Copyright (c) 2022-2023 ILGPU Project // www.ilgpu.net // // File: Bitwise.cs @@ -45,7 +45,6 @@ public static int And(int first, int second) => /// /// Performs bitwise operator & on two values. /// \ - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint And(uint first, uint second) => first & second; @@ -60,7 +59,6 @@ public static long And(long first, long second) => /// /// Performs bitwise operator & on two values. /// - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong And(ulong first, ulong second) => first & second; @@ -89,7 +87,6 @@ public static int Or(int first, int second) => /// /// Performs bitwise operator | on two values. /// - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Or(uint first, uint second) => first | second; @@ -104,7 +101,6 @@ public static long Or(long first, long second) => /// /// Performs bitwise operator | on two values. /// - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Or(ulong first, ulong second) => first | second; diff --git a/Src/ILGPU/Util/Utilities.cs b/Src/ILGPU/Util/Utilities.cs index f0f74ca01..3ade1efa7 100644 --- a/Src/ILGPU/Util/Utilities.cs +++ b/Src/ILGPU/Util/Utilities.cs @@ -77,7 +77,6 @@ public static bool IsPowerOf2(long value) => /// /// The integer value. /// True, if the given integer is a power of two. - [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPowerOf2(ulong value) => value > 0 & ((value & (value - 1)) == 0);