diff --git a/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs b/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs
index 19f4cd2e..55aab668 100644
--- a/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs
+++ b/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs
@@ -9,13 +9,13 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static int check_and_adjust_axis(NDArray nd, int axis)
{
return check_and_adjust_axis(nd.ndim, axis);
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static int check_and_adjust_axis(int ndims, int axis)
{
int adjusted = axis >= 0 ? axis : ndims + axis;
diff --git a/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs b/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs
index 8544ea12..94077dd5 100644
--- a/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs
+++ b/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs
@@ -5,10 +5,10 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public NPTypeCode ResolveUnaryReturnType(in NDArray nd, Type @override) => ResolveUnaryReturnType(nd, @override?.GetTypeCode());
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public NPTypeCode ResolveUnaryReturnType(in NDArray nd, NPTypeCode? @override)
{
if (!@override.HasValue)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs
index 3872b1f8..5974853b 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs
index ac7a8db8..77d75f25 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddByte(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs
index 53b2601a..8bcc23c8 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddChar(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs
index a09886f6..69fd4b14 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddDecimal(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs
index 331f9b68..e9f5bdf2 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddDouble(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs
index 90363287..45f327f1 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs
index 2bc074c5..44689ea3 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs
index 7bd79c68..ff6e3e79 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs
index 2b4d4eb2..0c1b5200 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddSingle(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs
index 5df258fe..0c25ecb1 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddUInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs
index fa6f04d4..e89a7b8c 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddUInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs
index ce29ff19..3037f12e 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray AddUInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs b/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs
index 1c1e41ed..492d4f29 100644
--- a/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs
@@ -19,7 +19,7 @@ protected static NDArray MultiplyMatrix(NDArray left, NDArray right, NDArray @ou
#else
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.multiply.html
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
protected static NDArray MultiplyMatrix(NDArray left, NDArray right, NDArray @out = null)
{
Debug.Assert(left.Shape.NDim == 2);
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs
index 418f47a5..648f1ddd 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs
index 6a6e3e23..f448d63b 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideByte(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs
index f4286836..e6fe7330 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideChar(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs
index 6da4ca69..c7ba96e0 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideDecimal(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs
index 83eda834..151c0fc2 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideDouble(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs
index ecd1e963..20faf165 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs
index 8616f876..735f5111 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs
index 12f9ee36..ce6cdc78 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs
index bb5304fa..72137bd1 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideSingle(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs
index d45c5335..af461bb9 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideUInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs
index e8ab4390..0b852776 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideUInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs
index d182a73f..537f2f35 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray DivideUInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs
index 5fc5899c..994f7f35 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs
index 0a0a5c78..11d22a62 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModByte(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs
index c9d1b0c6..ad067530 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModChar(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs
index 42d6b81b..324a4bb7 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModDecimal(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs
index c11a1c6c..a686d028 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModDouble(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs
index fc1c15af..22356c32 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs
index b1933f80..1c65c62d 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs
index 82cca9ed..809fac77 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs
index de2c60ab..2c6fd25a 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModSingle(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs
index 98f1510a..48357c47 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModUInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs
index d6c930b2..ce46c202 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModUInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs
index 72c97fc4..52362279 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray ModUInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs
index 2a3a9c78..2af0ceb0 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs
index 813ebbc1..483cd848 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyByte(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs
index 62207149..924b85a9 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyChar(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs
index b0e4c079..fe8177ed 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyDecimal(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs
index c94e7682..8ac47f9c 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyDouble(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs
index 22afa700..37baeec5 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs
index 4d211968..39398974 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs
index fe43c451..fc4eafb2 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs
index e6a401cd..8395520c 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplySingle(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs
index ca9f2866..bf0efb3c 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyUInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs
index 86038bd0..7be49267 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyUInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs
index f5099050..5c021cc7 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyUInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs
index 9ca7c7f0..9bf03885 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs
index 419d89e1..bf2b9dab 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractByte(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs
index d692edae..d0e8dcce 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractChar(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs
index 29f15bc8..70069735 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractDecimal(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs
index 8e506696..e16a2b19 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractDouble(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs
index 4fcf5398..f36d68bb 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs
index 1a76fb39..b0dc307d 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs
index 926bec66..aab2823c 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs
index 65a49ba3..ebe6eaea 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractSingle(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs
index 9f9e9374..5c266bfe 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractUInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs
index a130fe15..beba776b 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractUInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs
index 8047bee8..a83addf2 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray SubtractUInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs
index aaeeab09..d41dd443 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray MultiplyBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs
index 73a09a48..381d21a3 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs
@@ -19,7 +19,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray Dot__1__(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs
index 1556126c..3268965e 100644
--- a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs
+++ b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs
@@ -25,7 +25,7 @@ namespace NumSharp.Backends
//v2
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray __3____1__(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs b/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs
index 25045f97..9829193c 100644
--- a/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs
+++ b/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs
@@ -14,7 +14,7 @@ public static class NDIteratorExtensions
///
/// The ndarray to iterate.
/// Should this iterator loop forever?
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDIterator AsIterator(this NDArray nd, bool autoreset = false) where T : unmanaged
{
return new NDIterator(nd, autoreset);
diff --git a/src/NumSharp.Core/Backends/NDArray.String.cs b/src/NumSharp.Core/Backends/NDArray.String.cs
index 612c5e53..a5fd2cce 100644
--- a/src/NumSharp.Core/Backends/NDArray.String.cs
+++ b/src/NumSharp.Core/Backends/NDArray.String.cs
@@ -15,14 +15,14 @@ public partial class NDArray
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray FromString(string str) => np.array(str);
///
/// Converts the entire to a string.
///
/// Performs a copy due to String .net-framework limitations.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static string AsString(NDArray arr)
{
unsafe
diff --git a/src/NumSharp.Core/Backends/NDArray.cs b/src/NumSharp.Core/Backends/NDArray.cs
index 57108d61..ef944200 100644
--- a/src/NumSharp.Core/Backends/NDArray.cs
+++ b/src/NumSharp.Core/Backends/NDArray.cs
@@ -301,7 +301,7 @@ private NDArray(IArraySlice array, Shape shape) : this(array.TypeCode)
///
internal NPTypeCode GetTypeCode
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => Storage.TypeCode;
}
@@ -310,7 +310,7 @@ internal NPTypeCode GetTypeCode
///
protected internal unsafe void* Address
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => Storage.Address;
}
@@ -371,9 +371,9 @@ public NDArray T
///
public Shape Shape
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => Storage.Shape;
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
set => Storage.Reshape(value);
}
@@ -408,7 +408,7 @@ public ArraySlice Data() where T : unmanaged
/// Setting does not replace internal storage array.
protected internal IArraySlice Array
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => Storage.InternalArray;
}
@@ -605,7 +605,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public bool GetBoolean(params int[] indices) => Storage.GetBoolean(indices);
///
@@ -614,7 +614,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public byte GetByte(params int[] indices) => Storage.GetByte(indices);
///
@@ -623,7 +623,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public char GetChar(params int[] indices) => Storage.GetChar(indices);
///
@@ -632,7 +632,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public decimal GetDecimal(params int[] indices) => Storage.GetDecimal(indices);
///
@@ -641,7 +641,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public double GetDouble(params int[] indices) => Storage.GetDouble(indices);
///
@@ -650,7 +650,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public short GetInt16(params int[] indices) => Storage.GetInt16(indices);
///
@@ -659,7 +659,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public int GetInt32(params int[] indices) => Storage.GetInt32(indices);
///
@@ -668,7 +668,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public long GetInt64(params int[] indices) => Storage.GetInt64(indices);
///
@@ -677,7 +677,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public float GetSingle(params int[] indices) => Storage.GetSingle(indices);
///
@@ -686,7 +686,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public ushort GetUInt16(params int[] indices) => Storage.GetUInt16(indices);
///
@@ -695,7 +695,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public uint GetUInt32(params int[] indices) => Storage.GetUInt32(indices);
///
@@ -704,7 +704,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public ulong GetUInt64(params int[] indices) => Storage.GetUInt64(indices);
///
@@ -713,7 +713,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public ValueType GetValue(params int[] indices) => Storage.GetValue(indices);
///
@@ -722,7 +722,7 @@ public NDArray[] GetNDArrays(int axis = 0)
/// The shape's indices to get.
///
/// When is not
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public T GetValue(params int[] indices) where T : unmanaged => Storage.GetValue(indices);
///
@@ -730,7 +730,7 @@ public NDArray[] GetNDArrays(int axis = 0)
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public ValueType GetAtIndex(int index) => Storage.GetAtIndex(index);
///
@@ -738,7 +738,7 @@ public NDArray[] GetNDArrays(int axis = 0)
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public T GetAtIndex(int index) where T : unmanaged => Storage.GetAtIndex(index);
#endregion
@@ -898,7 +898,7 @@ public void ReplaceData(IArraySlice values)
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetAtIndex(object obj, int index) => Storage.SetAtIndex(obj, index);
///
@@ -906,7 +906,7 @@ public void ReplaceData(IArraySlice values)
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetAtIndex(T value, int index) where T : unmanaged => Storage.SetAtIndex(value, index);
#if _REGEN
@@ -916,7 +916,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void Set#1(#2 value, params int[] indices) => Storage.Set#1(value, indices);
%
@@ -926,7 +926,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetBoolean(bool value, params int[] indices) => Storage.SetBoolean(value, indices);
///
@@ -934,7 +934,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetByte(byte value, params int[] indices) => Storage.SetByte(value, indices);
///
@@ -942,7 +942,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetInt16(short value, params int[] indices) => Storage.SetInt16(value, indices);
///
@@ -950,7 +950,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetUInt16(ushort value, params int[] indices) => Storage.SetUInt16(value, indices);
///
@@ -958,7 +958,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetInt32(int value, params int[] indices) => Storage.SetInt32(value, indices);
///
@@ -966,7 +966,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetUInt32(uint value, params int[] indices) => Storage.SetUInt32(value, indices);
///
@@ -974,7 +974,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetInt64(long value, params int[] indices) => Storage.SetInt64(value, indices);
///
@@ -982,7 +982,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetUInt64(ulong value, params int[] indices) => Storage.SetUInt64(value, indices);
///
@@ -990,7 +990,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetChar(char value, params int[] indices) => Storage.SetChar(value, indices);
///
@@ -998,7 +998,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetDouble(double value, params int[] indices) => Storage.SetDouble(value, indices);
///
@@ -1006,7 +1006,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetSingle(float value, params int[] indices) => Storage.SetSingle(value, indices);
///
@@ -1014,7 +1014,7 @@ public void ReplaceData(IArraySlice values)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetDecimal(decimal value, params int[] indices) => Storage.SetDecimal(value, indices);
#endif
diff --git a/src/NumSharp.Core/Backends/NPTypeCode.cs b/src/NumSharp.Core/Backends/NPTypeCode.cs
index 6a1b2d04..78584a68 100644
--- a/src/NumSharp.Core/Backends/NPTypeCode.cs
+++ b/src/NumSharp.Core/Backends/NPTypeCode.cs
@@ -120,7 +120,7 @@ public static NPTypeCode GetTypeCode()
///
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static Type AsType(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -156,7 +156,7 @@ public static Type AsType(this NPTypeCode typeCode)
/// Checks if given has a match in .
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static bool IsValidNPType(this Type type)
{
return type.GetTypeCode() != NPTypeCode.Empty;
@@ -169,7 +169,7 @@ public static bool IsValidNPType(this Type type)
///
/// The size is computed by
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static int SizeOf(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -205,7 +205,7 @@ public static int SizeOf(this NPTypeCode typeCode)
/// Is a float, double, complex or decimal?
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static bool IsRealNumber(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -241,7 +241,7 @@ public static bool IsRealNumber(this NPTypeCode typeCode)
/// Is a uint, byte, ulong and so on.
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static bool IsUnsigned(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -277,7 +277,7 @@ public static bool IsUnsigned(this NPTypeCode typeCode)
/// Is a float, double, complex or decimal?
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static bool IsSigned(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -313,7 +313,7 @@ public static bool IsSigned(this NPTypeCode typeCode)
/// Is a float, double, complex or decimal?
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
internal static int GetGroup(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -355,7 +355,7 @@ internal static int GetGroup(this NPTypeCode typeCode)
/// Is a float, double, complex or decimal?
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
internal static int GetPriority(this NPTypeCode typeCode)
{
switch (typeCode)
@@ -395,7 +395,7 @@ internal static int GetPriority(this NPTypeCode typeCode)
/// Gets NumSharp's equivalent of
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
internal static NPTypeCode ToTypeCode(this NPY_TYPECHAR typeCode)
{
switch (typeCode)
@@ -465,7 +465,7 @@ internal static NPTypeCode ToTypeCode(this NPY_TYPECHAR typeCode)
/// Gets NumSharp's equivalent of
///
[DebuggerNonUserCode]
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
internal static NPY_TYPECHAR ToTYPECHAR(this NPTypeCode typeCode)
{
switch (typeCode)
diff --git a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs
index 29f41c0f..4aead90a 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs
@@ -90,116 +90,116 @@ public static ArraySlice Scalar(T val) where T : unmanaged
return new ArraySlice(UnmanagedMemoryBlock.FromPool(_buffer)) {[0] = val};
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromArray(T[,,,,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromBuffer(byte[] arr, bool copy = false) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromBuffer(arr, copy));
}
/// The length in objects of and not in bytes.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static ArraySlice FromPool(StackedMemoryPool pool) where T : unmanaged
{
return new ArraySlice(UnmanagedMemoryBlock.FromPool(pool));
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static IArraySlice FromArray(Array arr, bool copy = false)
{
var elementType = arr.GetType().GetElementType();
@@ -235,7 +235,7 @@ public static IArraySlice FromArray(Array arr, bool copy = false)
}
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static IArraySlice FromMemoryBlock(IMemoryBlock block, bool copy = false)
{
if (block is IArraySlice arr)
diff --git a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs
index 5e6e8ba0..ab45a6f9 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs
@@ -43,7 +43,7 @@ namespace NumSharp.Backends.Unmanaged
public int ItemLength
{
- [MethodImpl((MethodImplOptions)768)] get => InfoOf.Size;
+ [MethodImpl(OptimizeAndInline)] get => InfoOf.Size;
}
#region Construction
@@ -124,13 +124,13 @@ object IArraySlice.this[int index]
///
public T this[int index]
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
get
{
Debug.Assert(index < Count, "index < Count, Memory corruption expected.");
return *(Address + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
set
{
Debug.Assert(index < Count, "index < Count, Memory corruption expected.");
@@ -138,20 +138,20 @@ public T this[int index]
}
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public T GetIndex(int index)
{
return *(Address + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void SetIndex(int index, object value)
{
Debug.Assert(index < Count, "index < Count, Memory corruption expected.");
*(Address + index) = (T)value;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void SetIndex(int index, T value)
{
Debug.Assert(index < Count, "index < Count, Memory corruption expected.");
@@ -160,7 +160,7 @@ public void SetIndex(int index, T value)
#endregion
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public bool Contains(T item)
{
bool equals = false;
@@ -179,7 +179,7 @@ public bool Contains(T item)
}
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void Fill(T value)
{
if (Unsafe.SizeOf() == 1)
@@ -233,7 +233,7 @@ public void Fill(T value)
///
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public ArraySlice Slice(int start)
{
if ((uint)start > (uint)Count)
@@ -245,7 +245,7 @@ public ArraySlice Slice(int start)
///
///
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public ArraySlice Slice(int start, int length)
{
#if BIT64
@@ -275,7 +275,7 @@ public bool TryCopyTo(Span destination)
}
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void CopyTo(Span destination)
{
if ((uint)Count <= (uint)destination.Length)
@@ -293,7 +293,7 @@ public void CopyTo(Span destination)
///
/// The address to copy to
/// The destiniton has to be atleast the size of this array, otherwise memory corruption is likely to occur.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void CopyTo(IntPtr dst)
{
// Using "if (!TryCopyTo(...))" results in two branches: one for the length
@@ -308,7 +308,7 @@ public void CopyTo(IntPtr dst)
///
/// The address to copy to
/// The destiniton has to be atleast the size of this array, otherwise memory corruption is likely to occur.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void CopyTo(IntPtr dst, int sourceOffset, int sourceCount)
{
// Using "if (!TryCopyTo(...))" results in two branches: one for the length
@@ -320,7 +320,7 @@ public void CopyTo(IntPtr dst, int sourceOffset, int sourceCount)
///
/// offset of source via count (not bytes)
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void CopyTo(Span destination, int sourceOffset)
{
CopyTo(destination, sourceOffset, Count - sourceOffset);
@@ -329,18 +329,18 @@ public void CopyTo(Span destination, int sourceOffset)
///
/// offset of source via count (not bytes)
/// How many items to copy
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void CopyTo(Span destination, int sourceOffset, int sourceLength)
{
CopyTo(destination, sourceOffset, sourceLength);
}
[EditorBrowsable(EditorBrowsableState.Never)]
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public ref T GetPinnableReference() => ref Unsafe.AsRef(Address);
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public ArraySlice Clone() => new ArraySlice(UnmanagedMemoryBlock.Copy(Address, Count));
@@ -353,14 +353,14 @@ Span IArraySlice.AsSpan()
return new Span(VoidAddress, Count);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
TRet IArraySlice.GetIndex(int index)
{
Debug.Assert(InfoOf.Size == InfoOf.Size);
return *((TRet*)VoidAddress + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
void IArraySlice.SetIndex(int index, TVal value)
{
Debug.Assert(InfoOf.Size == InfoOf.Size);
@@ -368,7 +368,7 @@ void IArraySlice.SetIndex(int index, TVal value)
*((TVal*)VoidAddress + index) = value;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
object IArraySlice.GetIndex(int index)
{
Debug.Assert(index < Count, "index < Count, Memory corruption expected.");
@@ -412,7 +412,7 @@ void IArraySlice.CopyTo(Span destination)
///
ref T1 IArraySlice.GetPinnableReference() => ref Unsafe.AsRef(VoidAddress);
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
IArraySlice IArraySlice.Clone() => new ArraySlice(UnmanagedMemoryBlock.Copy(Address, Count));
ArraySlice IArraySlice.Clone() => new ArraySlice(UnmanagedMemoryBlock.Copy(Address, Count));
@@ -424,7 +424,7 @@ void IArraySlice.CopyTo(Span destination)
///
unsafe void* IMemoryBlock.Address
{
- [MethodImpl((MethodImplOptions)768)] get => VoidAddress;
+ [MethodImpl(OptimizeAndInline)] get => VoidAddress;
}
///
@@ -433,7 +433,7 @@ unsafe void* IMemoryBlock.Address
///
long IMemoryBlock.Count
{
- [MethodImpl((MethodImplOptions)768)] get => Count;
+ [MethodImpl(OptimizeAndInline)] get => Count;
}
///
@@ -442,7 +442,7 @@ long IMemoryBlock.Count
/// Calculated by *
long IMemoryBlock.BytesLength
{
- [MethodImpl((MethodImplOptions)768)] get => Count * InfoOf.Size;
+ [MethodImpl(OptimizeAndInline)] get => Count * InfoOf.Size;
}
///
@@ -450,12 +450,12 @@ long IMemoryBlock.BytesLength
///
NPTypeCode IMemoryBlock.TypeCode
{
- [MethodImpl((MethodImplOptions)768)] get => TypeCode;
+ [MethodImpl(OptimizeAndInline)] get => TypeCode;
}
IMemoryBlock IArraySlice.MemoryBlock
{
- [MethodImpl((MethodImplOptions)768)] get => MemoryBlock;
+ [MethodImpl(OptimizeAndInline)] get => MemoryBlock;
}
///
@@ -486,7 +486,7 @@ public void DangerousFree()
/// allocates, so should generally be avoided, however it is sometimes
/// necessary to bridge the gap with APIs written in terms of arrays.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public T[] ToArray()
{
if (Count == 0)
diff --git a/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs b/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs
index 65d9d971..c3ee779a 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs
@@ -128,7 +128,7 @@ public unsafe void Return(IntPtr x)
#region Garbage Collection
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
private void tryStartGC()
{
//try start GC
@@ -139,7 +139,7 @@ private void tryStartGC()
_runGC(GarbageCollectionDelay);
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
private void _runGC(int delay, int restarts = 0)
{
//assinging to prevent GC from collecting.
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs
index 4ce85a04..3975a91d 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs
@@ -14,7 +14,7 @@ public static partial class UnmanagedMemoryBlock
/// The type to cast this memory block to.
///
/// Returns a copy.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static IMemoryBlock CastTo(this IMemoryBlock source, NPTypeCode to)
{
switch (to)
@@ -63,7 +63,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source, NPTypeCode to)
///
///
/// Returns a copy.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static IMemoryBlock CastTo(this IMemoryBlock source) where TOut : unmanaged
{
switch (source.TypeCode)
@@ -99,7 +99,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source) where TO
///
///
/// Returns a copy.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static IMemoryBlock CastTo(this IMemoryBlock source) where TIn : unmanaged where TOut : unmanaged
{
unsafe
@@ -124,7 +124,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source
///
///
/// Returns a copy.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static IMemoryBlock CastTo(this IMemoryBlock source) where TIn : unmanaged where TOut : unmanaged
{
unsafe
@@ -1180,7 +1180,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source) whe
///
///
/// Returns a copy.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static unsafe void CastTo(this IMemoryBlock source, IMemoryBlock @out, int? bytesOffset = null, int? countOffset = null)
{
var len = source.Count;
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs
index aeb88aa1..fc1414a3 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs
@@ -24,7 +24,7 @@ public unsafe struct UnmanagedMemoryBlock : IUnmanagedMemoryBlock, IMemoryBlo
///
/// The length in objects of and not in bytes.
/// Does claim ownership since allocation is publicly.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public UnmanagedMemoryBlock(long count)
{
var bytes = BytesCount = count * InfoOf.Size;
@@ -40,7 +40,7 @@ public UnmanagedMemoryBlock(long count)
///
/// The length in objects of and not in bytes.
/// Does claim ownership.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public UnmanagedMemoryBlock(T* ptr, long count)
{
_disposer = Disposer.Null;
@@ -56,7 +56,7 @@ public UnmanagedMemoryBlock(T* ptr, long count)
/// The length in objects of and not in bytes.
///
/// Does claim ownership.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public UnmanagedMemoryBlock(T* start, long count, Action dispose)
{
Count = count;
@@ -71,7 +71,7 @@ public UnmanagedMemoryBlock(T* start, long count, Action dispose)
///
/// The length in objects of and not in bytes.
/// Does claim ownership.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public UnmanagedMemoryBlock(GCHandle handle, long count)
{
Count = count;
@@ -87,7 +87,7 @@ public UnmanagedMemoryBlock(GCHandle handle, long count)
/// The length in objects of and not in bytes.
///
/// Does claim ownership.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public UnmanagedMemoryBlock(GCHandle handle, long count, Action dispose)
{
Count = count;
@@ -101,7 +101,7 @@ public UnmanagedMemoryBlock(GCHandle handle, long count, Action dispose)
///
/// The length in objects of and not in bytes.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public UnmanagedMemoryBlock(long count, T fill) : this(count)
{
Fill(fill, 0, count);
@@ -111,13 +111,13 @@ public UnmanagedMemoryBlock(long count, T fill) : this(count)
#region FromArray
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[] arr, bool copy)
{
if (!copy)
@@ -132,13 +132,13 @@ public static UnmanagedMemoryBlock FromArray(T[] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,] arr, bool copy)
{
if (!copy)
@@ -153,13 +153,13 @@ public static UnmanagedMemoryBlock FromArray(T[,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,] arr, bool copy)
{
if (!copy)
@@ -174,13 +174,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,] arr, bool copy)
{
if (!copy)
@@ -195,13 +195,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,] arr, bool copy)
{
if (!copy)
@@ -216,13 +216,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,] arr, bool copy)
{
if (!copy)
@@ -237,13 +237,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,] arr, bool copy)
{
if (!copy)
@@ -258,13 +258,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -279,13 +279,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -300,13 +300,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -321,13 +321,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -342,13 +342,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -363,13 +363,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -385,13 +385,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,] arr, bool copy)
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -406,13 +406,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,] arr, bool copy)
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -427,13 +427,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,] arr, bool copy
return ret;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,,] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,,] arr, bool copy)
{
if (!copy)
@@ -450,19 +450,19 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,,] arr, bool cop
#endregion
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromBuffer(byte[] arr)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length / InfoOf.Size);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromBuffer(byte[] arr, bool copy)
{
return new UnmanagedMemoryBlock(GCHandle.Alloc(copy ? arr.Clone() : arr, GCHandleType.Pinned), arr.Length / InfoOf.Size);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock FromPool(StackedMemoryPool manager)
{
Debug.Assert(manager.SingleSize / InfoOf.Size > 0);
@@ -470,7 +470,7 @@ public static UnmanagedMemoryBlock FromPool(StackedMemoryPool manager)
return new UnmanagedMemoryBlock((T*)buffer, 1, () => manager.Return(buffer));
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock Copy(UnmanagedMemoryBlock source)
{
var itemCount = source.Count;
@@ -487,7 +487,7 @@ public static UnmanagedMemoryBlock Copy(UnmanagedMemoryBlock source)
/// The address of the first
/// How many to copy, not how many bytes.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock Copy(void* address, int count)
{
var len = count * InfoOf.Size;
@@ -503,7 +503,7 @@ public static UnmanagedMemoryBlock Copy(void* address, int count)
///
/// How many to copy, not how many bytes.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock Copy(IntPtr address, int count)
{
return Copy((void*)address, count);
@@ -515,7 +515,7 @@ public static UnmanagedMemoryBlock Copy(IntPtr address, int count)
/// The address of the first
/// How many to copy, not how many bytes.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static UnmanagedMemoryBlock Copy(T* address, int count)
{
return Copy((void*)address, count);
@@ -525,11 +525,11 @@ public static UnmanagedMemoryBlock Copy(T* address, int count)
public T this[int index]
{
- [MethodImpl((MethodImplOptions)768)] get => *(Address + index);
- [MethodImpl((MethodImplOptions)768)] set => *(Address + index) = value;
+ [MethodImpl(OptimizeAndInline)] get => *(Address + index);
+ [MethodImpl(OptimizeAndInline)] set => *(Address + index) = value;
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void Reallocate(long length, bool copyOldValues = false)
{
if (copyOldValues)
@@ -548,7 +548,7 @@ public void Reallocate(long length, bool copyOldValues = false)
}
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void Reallocate(long length, T fill, bool copyOldValues = false)
{
if (copyOldValues)
@@ -576,7 +576,7 @@ public void Reallocate(long length, T fill, bool copyOldValues = false)
///
/// Fills the contents of this span with the given value.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void Fill(T value)
{
if (Count == 0)
@@ -631,7 +631,7 @@ public void Fill(T value)
///
/// Fills the contents of this span with the given value.
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void Fill(T value, long offset, long count)
{
if (Count == 0 || count == 0)
@@ -686,74 +686,74 @@ public void Fill(T value, long offset, long count)
}
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public T GetIndex(int index)
{
return *(Address + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public ref T GetRefTo(int index)
{
return ref *(Address + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void SetIndex(int index, ref T value)
{
*(Address + index) = value;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void SetIndex(int index, T value)
{
*(Address + index) = value;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public T GetIndex(long index)
{
return *(Address + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public ref T GetRefTo(long index)
{
return ref *(Address + index);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void SetIndex(long index, ref T value)
{
*(Address + index) = value;
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void SetIndex(long index, T value)
{
*(Address + index) = value;
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void Free()
{
_disposer.Dispose();
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public IEnumerator GetEnumerator()
{
for (var i = 0; i < Count; i++) yield return GetIndex(i);
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public bool Contains(T item)
{
long len = Count;
@@ -765,7 +765,7 @@ public bool Contains(T item)
return false;
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void CopyTo(T[] array, int arrayIndex)
{
long len = Count;
@@ -775,14 +775,14 @@ public void CopyTo(T[] array, int arrayIndex)
}
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void CopyTo(UnmanagedMemoryBlock memoryBlock, long arrayIndex)
{
//TODO! at netcore 3, AsSpan.CopyTo might be faster.
Buffer.MemoryCopy(Address + arrayIndex, memoryBlock.Address, InfoOf.Size * memoryBlock.Count, InfoOf.Size * (Count - arrayIndex));
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void CopyTo(T* array, long arrayIndex, long lengthToCopy)
{
//TODO! at netcore 3, AsSpan.CopyTo might be faster.
@@ -799,7 +799,7 @@ public void CopyTo(T* array, long arrayIndex, long lengthToCopy)
/// is less than zero.
///
/// is multidimensional.-or- The number of elements in the source is greater than the available space from to the end of the destination .-or-The type of the source cannot be cast automatically to the type of the destination .
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public void CopyTo(Array array, int arrayIndex)
{
if (!(array is T[] arr))
@@ -874,7 +874,7 @@ object ICloneable.Clone()
/// An object to compare with this object.
///
/// if the current object is equal to the parameter; otherwise, .
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public bool Equals(UnmanagedMemoryBlock other)
{
return Count == other.Count && Address == other.Address;
@@ -884,7 +884,7 @@ public bool Equals(UnmanagedMemoryBlock other)
/// The object to compare with the current instance.
///
/// if and this instance are the same type and represent the same value; otherwise, .
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public override bool Equals(object obj)
{
return obj is UnmanagedMemoryBlock other && Equals(other);
@@ -892,7 +892,7 @@ public override bool Equals(object obj)
/// Returns the hash code for this instance.
/// A 32-bit signed integer that is the hash code for this instance.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public override int GetHashCode()
{
unchecked
@@ -905,7 +905,7 @@ public override int GetHashCode()
/// The first value to compare.
/// The second value to compare.
/// true if the and parameters have the same value; otherwise, false.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static bool operator ==(UnmanagedMemoryBlock left, UnmanagedMemoryBlock right)
{
return left.Equals(right);
@@ -915,7 +915,7 @@ public override int GetHashCode()
/// The first value to compare.
/// The second value to compare.
/// true if and are not equal; otherwise, false.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static bool operator !=(UnmanagedMemoryBlock left, UnmanagedMemoryBlock right)
{
return !left.Equals(right);
@@ -981,7 +981,7 @@ private Disposer()
_type = AllocationType.Wrap;
}
- [MethodImpl((MethodImplOptions)768), SuppressMessage("ReSharper", "PossibleInvalidOperationException")]
+ [MethodImpl(OptimizeAndInline), SuppressMessage("ReSharper", "PossibleInvalidOperationException")]
private void ReleaseUnmanagedResources()
{
if (Disposed)
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs
index e0188911..e5ee978d 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs
@@ -76,7 +76,7 @@ public unsafe ValueType GetAtIndex(int index)
#endif
}
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public unsafe T GetAtIndex(int index) where T : unmanaged => *((T*)Address + _shape.TransformOffset(index));
///
@@ -111,7 +111,7 @@ public unsafe ValueType GetAtIndex(int index)
///
///
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public UnmanagedStorage GetData(params int[] indices)
{
var this_shape = Shape;
@@ -173,7 +173,7 @@ public UnmanagedStorage GetData(params int[] indices)
///
///
///
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public unsafe UnmanagedStorage GetData(int* dims, int ndims)
{
var this_shape = Shape;
@@ -253,7 +253,7 @@ public T GetValue(params int[] indices) where T : unmanaged
/// Get reference to internal data storage
///
/// reference to internal storage as System.Array
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public IArraySlice GetData() => InternalArray;
#if _REGEN
#region Direct Getters
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs
index 5a078cc4..5d8f1229 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs
@@ -51,7 +51,7 @@ public void Reshape(int[] dimensions, bool @unsafe)
///
/// If shape's size mismatches current shape size.
/// If 's size == 0
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void Reshape(Shape newShape, bool @unsafe = false)
{
Reshape(ref newShape, @unsafe);
@@ -62,7 +62,7 @@ public void Reshape(Shape newShape, bool @unsafe = false)
///
/// If shape's size mismatches current shape size.
/// If 's size == 0
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public void Reshape(ref Shape newShape, bool @unsafe = false)
{
// NumPy behavior: non-contiguous arrays require a copy when reshaping
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs
index 55cd7852..368dfb8b 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs
@@ -15,7 +15,7 @@ public partial class UnmanagedStorage
/// Throws if the underlying shape is not writeable (e.g., broadcast arrays).
/// NumPy raises: ValueError: assignment destination is read-only
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
private void ThrowIfNotWriteable()
{
NumSharpException.ThrowIfNotWriteable(_shape);
@@ -325,7 +325,7 @@ public void SetData(IArraySlice value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void Set#1(#2 value, params int[] indices)
{
unsafe {
@@ -340,7 +340,7 @@ public void SetData(IArraySlice value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetBoolean(bool value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -355,7 +355,7 @@ public void SetBoolean(bool value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetByte(byte value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -370,7 +370,7 @@ public void SetByte(byte value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetInt16(short value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -385,7 +385,7 @@ public void SetInt16(short value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetUInt16(ushort value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -400,7 +400,7 @@ public void SetUInt16(ushort value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetInt32(int value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -415,7 +415,7 @@ public void SetInt32(int value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetUInt32(uint value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -430,7 +430,7 @@ public void SetUInt32(uint value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetInt64(long value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -445,7 +445,7 @@ public void SetInt64(long value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetUInt64(ulong value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -460,7 +460,7 @@ public void SetUInt64(ulong value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetChar(char value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -475,7 +475,7 @@ public void SetChar(char value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetDouble(double value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -490,7 +490,7 @@ public void SetDouble(double value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetSingle(float value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -505,7 +505,7 @@ public void SetSingle(float value, params int[] indices)
///
/// The values to assign
/// The coordinates to set at.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void SetDecimal(decimal value, params int[] indices)
{
ThrowIfNotWriteable();
@@ -523,7 +523,7 @@ public void SetDecimal(decimal value, params int[] indices)
///
///
/// Copies values only if type does not match and doesn't change shape.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void ReplaceData(Array values)
{
if (values == null)
@@ -637,7 +637,7 @@ public void ReplaceData(NDArray nd)
///
/// The shape to set in this storage. (without checking if shape matches storage)
/// Copies values only if type does not match and doesn't change shape. Doesn't check if shape size matches.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public void ReplaceData(Array values, Shape shape)
{
if (values == null)
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs
index d6b73a30..45701506 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs
@@ -11,10 +11,10 @@ public partial class UnmanagedStorage
{
#region Slicing
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public UnmanagedStorage GetView(string slicing_notation) => GetView(Slice.ParseSlices(slicing_notation));
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public UnmanagedStorage GetView(params Slice[] slices)
{
if (slices == null)
@@ -57,7 +57,7 @@ public UnmanagedStorage GetView(params Slice[] slices)
return GetViewInternal(slices);
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
[SuppressMessage("ReSharper", "PossibleInvalidOperationException")]
private UnmanagedStorage GetViewInternal(params Slice[] slices)
{
diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs
index 2e9b6e6d..e41b1447 100644
--- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs
+++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs
@@ -1455,7 +1455,7 @@ public unsafe void CopyTo(T[] array) where T : unmanaged
}
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public unsafe T[] ToArray() where T : unmanaged
{
if (typeof(T).GetTypeCode() != InternalArray.TypeCode)
diff --git a/src/NumSharp.Core/Creation/NdArray.Scalar.cs b/src/NumSharp.Core/Creation/NdArray.Scalar.cs
index d8930fda..8f669688 100644
--- a/src/NumSharp.Core/Creation/NdArray.Scalar.cs
+++ b/src/NumSharp.Core/Creation/NdArray.Scalar.cs
@@ -14,7 +14,7 @@ public partial class NDArray
/// The type of the scalar.
///
/// In case when is not , will be called.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray Scalar(object value, Type dtype)
{
return new NDArray(UnmanagedStorage.Scalar(Converts.ChangeType(value, dtype.GetTypeCode())));
@@ -26,7 +26,7 @@ public static NDArray Scalar(object value, Type dtype)
/// The value of the scalar
///
/// In case when is not , will be called.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray Scalar(object value)
{
return new NDArray(UnmanagedStorage.Scalar(value));
@@ -38,7 +38,7 @@ public static NDArray Scalar(object value)
/// The value of the scalar
///
/// In case when is not , will be called.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray Scalar(ValueType value)
{
return new NDArray(UnmanagedStorage.Scalar(value));
@@ -50,7 +50,7 @@ public static NDArray Scalar(ValueType value)
/// The value of the scalar
///
/// In case when is not , will be called.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray Scalar(T value) where T : unmanaged
{
return new NDArray(UnmanagedStorage.Scalar(value));
@@ -62,7 +62,7 @@ public static NDArray Scalar(T value) where T : unmanaged
/// The value of the scalar, attempt to convert will be performed
///
/// In case when is not , will be called.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray Scalar(object value) where T : unmanaged
{
return new NDArray(UnmanagedStorage.Scalar(value as T? ?? Converts.ChangeType(value)));
@@ -75,7 +75,7 @@ public static NDArray Scalar(object value) where T : unmanaged
/// The type code of the scalar.
///
/// In case when is not , will be called.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray Scalar(object value, NPTypeCode typeCode)
{
return new NDArray(UnmanagedStorage.Scalar(value, typeCode));
diff --git a/src/NumSharp.Core/Creation/np.array.cs b/src/NumSharp.Core/Creation/np.array.cs
index 99a5d664..2306487e 100644
--- a/src/NumSharp.Core/Creation/np.array.cs
+++ b/src/NumSharp.Core/Creation/np.array.cs
@@ -20,7 +20,7 @@ public static partial class np
///
///
/// If is true then returns a clone.
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
public static NDArray array(NDArray nd, bool copy = false) => copy ? new NDArray(nd.Storage.Clone()) : new NDArray(nd.Storage);
///
@@ -30,7 +30,7 @@ public static partial class np
/// Always copies if the array is larger than 1-d.
/// Not used.
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
[SuppressMessage("ReSharper", "InvalidXmlDocComment")]
public static NDArray array(Array array, Type dtype = null, int ndmin = 1, bool copy = true, char order = 'C')
{
@@ -127,7 +127,7 @@ public static NDArray array(IEnumerable data, int size) where T : unmanage
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray array(string chars)
{
if (chars == null)
@@ -159,7 +159,7 @@ public static NDArray array(string chars)
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html
Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public static NDArray array(T[][] data) where T : unmanaged
{
unsafe
@@ -197,7 +197,7 @@ public static NDArray array(T[][] data) where T : unmanaged
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html
Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public static NDArray array(T[][][] data) where T : unmanaged
{
unsafe
@@ -242,7 +242,7 @@ public static NDArray array(T[][][] data) where T : unmanaged
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html
Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public static NDArray array(T[][][][] data) where T : unmanaged
{
unsafe
@@ -294,7 +294,7 @@ public static NDArray array(T[][][][] data) where T : unmanaged
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html
Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public static NDArray array(T[][][][][] data) where T : unmanaged
{
unsafe
diff --git a/src/NumSharp.Core/Creation/np.array.string.cs b/src/NumSharp.Core/Creation/np.array.string.cs
index c2c54b09..5f8d43fc 100644
--- a/src/NumSharp.Core/Creation/np.array.string.cs
+++ b/src/NumSharp.Core/Creation/np.array.string.cs
@@ -17,7 +17,7 @@ public static partial class np
///
///
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static NDArray array(string[] strArray)
{
if (strArray == null)
diff --git a/src/NumSharp.Core/Exceptions/NumSharpException.cs b/src/NumSharp.Core/Exceptions/NumSharpException.cs
index ecc1f58e..f46df0c1 100644
--- a/src/NumSharp.Core/Exceptions/NumSharpException.cs
+++ b/src/NumSharp.Core/Exceptions/NumSharpException.cs
@@ -34,7 +34,7 @@ public NumSharpException(string message, Exception innerException) : base(messag
/// NumPy raises: ValueError: assignment destination is read-only
/// NumSharp raises: NumSharpException: assignment destination is read-only
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static void ThrowIfNotWriteable(in Shape shape, string name = "assignment destination")
{
if (!shape.IsWriteable)
diff --git a/src/NumSharp.Core/Generics/NDArray`1.cs b/src/NumSharp.Core/Generics/NDArray`1.cs
index cb9b14a1..98f18d50 100644
--- a/src/NumSharp.Core/Generics/NDArray`1.cs
+++ b/src/NumSharp.Core/Generics/NDArray`1.cs
@@ -146,9 +146,9 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh
///
protected internal new ArraySlice Array
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => Storage.GetData();
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
set => Storage.ReplaceData(value);
}
@@ -157,13 +157,13 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh
///
protected internal new unsafe TDType* Address
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => (TDType*)Storage.Address;
}
public new TDType this[params int[] indices]
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get
{
if (Shape.IsScalar && indices.Length != 1 || !Shape.IsScalar && indices.Length != ndim)
@@ -171,7 +171,7 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh
return Storage.GetValue(indices);
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
set
{
if (Shape.IsScalar && indices.Length != 1 || !Shape.IsScalar && indices.Length != ndim)
@@ -187,13 +187,13 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh
///
public new NDArray this[string slice]
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get
{
return base[slice].MakeGeneric();
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
set
{
base[slice] = value;
@@ -206,10 +206,10 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh
///
public new NDArray this[params Slice[] slices]
{
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
get => base[slices].MakeGeneric();
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
set => base[slices] = value;
}
@@ -248,10 +248,10 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static implicit operator ArraySlice(NDArray nd) => nd.Array;
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
public static explicit operator NDArray(TDType[] tArray) => new NDArray(tArray).MakeGeneric();
}
diff --git a/src/NumSharp.Core/GlobalUsings.cs b/src/NumSharp.Core/GlobalUsings.cs
new file mode 100644
index 00000000..ff1cbf9a
--- /dev/null
+++ b/src/NumSharp.Core/GlobalUsings.cs
@@ -0,0 +1 @@
+global using static NumSharp.MethodImplOptionsConstants;
diff --git a/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs b/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs
index fa324404..ef077cfc 100644
--- a/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs
+++ b/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs
@@ -1,222 +1,222 @@
-using System;
-using System.Numerics;
-using NumSharp.Utilities;
-
-namespace NumSharp
-{
- public static partial class np
- {
- public static partial class linalg
- {
- ///
- /// Matrix or vector norm.
- /// This function is able to return one of seven different matrix norms,
- /// or one of an infinite number of vector norms(described below), depending
- /// on the value of the ``ord`` parameter.
- ///
- /// Input array. If `axis` is None, `x` must be 1-D or 2-D.
- /// non-zero int, "inf", "-inf" or "fro", optional
- /// Order of the norm(see table under ``Notes``).
- /// int, 2-tuple of ints int[], null}, optional
- /// If `axis` is an integer, it specifies the axis of `x` along which to
- /// compute the vector norms.If `axis` is a 2-tuple, it specifies the
- /// axes that hold 2-D matrices, and the matrix norms of these matrices
- /// are computed.If `axis` is None then either a vector norm (when `x`
- /// is 1-D) or a matrix norm(when `x` is 2-D) is returned.
- ///
- /// Norm of the matrix or vector(s) as double or NDArray.
- ///
- ///
- /// Notes:
- /// -----
- /// For values of ``ord <= 0``, the result is, strictly speaking, not a
- /// mathematical 'norm', but it may still be useful for various numerical
- /// purposes.
- /// The following norms can be calculated:
- /// ===== ============================ ==========================
- /// ord norm for matrices norm for vectors
- /// ===== ============================ ==========================
- /// None Frobenius norm 2-norm
- /// 'fro' Frobenius norm --
- /// inf max(sum(abs(x), axis= 1)) max(abs(x))
- /// -inf min(sum(abs(x), axis= 1)) min(abs(x))
- /// 0 -- sum(x != 0)
- /// 1 max(sum(abs(x), axis= 0)) as below
- /// -1 min(sum(abs(x), axis= 0)) as below
- /// 2 2-norm(largest sing. value) as below
- /// -2 smallest singular value as below
- /// other -- sum(abs(x) ** ord)**(1./ord)
- /// ===== ============================ ==========================
- /// The Frobenius norm is given by[1]_:
- /// :math:`||A||_F = [\\sum_{i, j}
- /// abs(a_{ i,j})^2]^{1/2}`
- /// References
- /// ----------
- /// .. [1] G.H.Golub and C.F.Van Loan, *Matrix Computations*,
- /// Baltimore, MD, Johns Hopkins University Press, 1985, pg. 15
- ///
- private static object norm(NDArray x, object ord = null, object axis_obj = null)
- {
- // Check the default case first and handle it immediately.
- if (ord == null && axis_obj == null)
- {
- x = x.ravel(); // order = 'K'
- NDArray sqnorm = null;
- if (x.dtype == typeof(Complex))
- // Python: sqnorm = dot(x.real, x.real) + dot(x.imag, x.imag)
- throw new NotImplementedException("Complex is not implemented yet");
- else
- sqnorm = dot(x, x);
- return sqrt(sqnorm);
- }
-
- // Normalize the `axis` argument to a tuple.
- var dim = x.ndim;
- int[] axis = null;
- if (axis_obj == null)
- axis = py.range(dim);
- else if (axis_obj is int)
- axis = new int[] {(int)axis_obj};
- else if (axis_obj is int[])
- axis = (int[])axis_obj;
- else
- throw new ArgumentException($"Invalid axis type: {axis_obj}");
-// if (axis.Length == 1)
-// {
-// if ((string)ord == "inf")
-// return abs(x).max(axis = axis);
-// elif ord == -Inf:
-// return abs(x).min(axis = axis)
-// elif ord == 0:
-// # Zero norm
-// return (x != 0).sum(axis = axis)
-// elif ord == 1:
-// # special case for speedup
-// return add.reduce(abs(x), axis = axis)
-// elif ord is None or ord == 2:
-// # special case for speedup
-// s = (x.conj() * x).real
-// return sqrt(add.reduce(s, axis = axis))
-// else:
-// try:
-// ord + 1
-// except TypeError:
-// raise ValueError("Invalid norm order for vectors.")
-// if x.dtype.type is longdouble:
-// # Convert to a float type, so integer arrays give
-// # float results. Don't apply asfarray to longdouble arrays,
-// # because it will downcast to float64.
-// absx = abs(x)
-// else:
-// absx = x if isComplexType(x.dtype.type) else asfarray(x)
-// if absx.dtype is x.dtype:
-// absx = abs(absx)
-// else:
-// #if the type changed, we can safely overwrite absx
-// abs(absx, out=absx)
-// absx **= ord
-// return add.reduce(absx, axis=axis) ** (1.0 / ord)
-
-// }
-//elif len(axis) == 2:
-// row_axis, col_axis = axis
-// if not (-nd <= row_axis < nd and -nd <= col_axis < nd):
-// raise ValueError('Invalid axis %r for an array with shape %r' %
-// (axis, x.shape))
-// if row_axis % nd == col_axis % nd:
-// raise ValueError('Duplicate axes given.')
-// if ord == 2:
-// return _multi_svd_norm(x, row_axis, col_axis, amax)
-// elif ord == -2:
-// return _multi_svd_norm(x, row_axis, col_axis, amin)
-// elif ord == 1:
-// if col_axis > row_axis:
-// col_axis -= 1
-// return add.reduce(abs(x), axis=row_axis).max(axis=col_axis)
-// elif ord == Inf:
-// if row_axis > col_axis:
-// row_axis -= 1
-// return add.reduce(abs(x), axis=col_axis).max(axis=row_axis)
-// elif ord == -1:
-// if col_axis > row_axis:
-// col_axis -= 1
-// return add.reduce(abs(x), axis=row_axis).min(axis=col_axis)
-// elif ord == -Inf:
-// if row_axis > col_axis:
-// row_axis -= 1
-// return add.reduce(abs(x), axis=col_axis).min(axis=row_axis)
-// elif ord in [None, 'fro', 'f']:
-// return sqrt(add.reduce((x.conj() * x).real, axis=axis))
-// else:
-// raise ValueError("Invalid norm order for matrices.")
-//else:
-// raise ValueError("Improper number of dimensions to norm.")
- throw new NotImplementedException();
- }
-
- /*
- >>> from numpy import linalg as LA
- >>> a = np.arange(9) - 4
- >>> a
- array([-4, -3, -2, -1, 0, 1, 2, 3, 4])
- >>> b = a.reshape((3, 3))
- >>> b
- array([[-4, -3, -2],
- [-1, 0, 1],
- [ 2, 3, 4]])
- >>> LA.norm(a)
- 7.745966692414834
- >>> LA.norm(b)
- 7.745966692414834
- >>> LA.norm(b, 'fro')
- 7.745966692414834
- >>> LA.norm(a, np.inf)
- 4
- >>> LA.norm(b, np.inf)
- 9
- >>> LA.norm(a, -np.inf)
- 0
- >>> LA.norm(b, -np.inf)
- 2
- >>> LA.norm(a, 1)
- 20
- >>> LA.norm(b, 1)
- 7
- >>> LA.norm(a, -1)
- -4.6566128774142013e-010
- >>> LA.norm(b, -1)
- 6
- >>> LA.norm(a, 2)
- 7.745966692414834
- >>> LA.norm(b, 2)
- 7.3484692283495345
- >>> LA.norm(a, -2)
- nan
- >>> LA.norm(b, -2)
- 1.8570331885190563e-016
- >>> LA.norm(a, 3)
- 5.8480354764257312
- >>> LA.norm(a, -3)
- nan
- Using the `axis` argument to compute vector norms:
- >>> c = np.array([[1, 2, 3],
- ... [-1, 1, 4]])
- >>> LA.norm(c, axis=0)
- array([ 1.41421356, 2.23606798, 5. ])
- >>> LA.norm(c, axis=1)
- array([ 3.74165739, 4.24264069])
- >>> LA.norm(c, ord=1, axis=1)
- array([6, 6])
- Using the `axis` argument to compute matrix norms:
- >>> m = np.arange(8).reshape(2,2,2)
- >>> LA.norm(m, axis=(1,2))
- array([ 3.74165739, 11.22497216])
- >>> LA.norm(m[0, :, :]), LA.norm(m[1, :, :])
- (3.7416573867739413, 11.224972160321824)
- """
-
-
- */
- }
- }
-}
+using System;
+using System.Numerics;
+using NumSharp.Utilities;
+
+namespace NumSharp
+{
+ public static partial class np
+ {
+ public static partial class linalg
+ {
+ ///
+ /// Matrix or vector norm.
+ /// This function is able to return one of seven different matrix norms,
+ /// or one of an infinite number of vector norms(described below), depending
+ /// on the value of the ``ord`` parameter.
+ ///
+ /// Input array. If `axis` is None, `x` must be 1-D or 2-D.
+ /// non-zero int, "inf", "-inf" or "fro", optional
+ /// Order of the norm(see table under ``Notes``).
+ /// int, 2-tuple of ints int[], null}, optional
+ /// If `axis` is an integer, it specifies the axis of `x` along which to
+ /// compute the vector norms.If `axis` is a 2-tuple, it specifies the
+ /// axes that hold 2-D matrices, and the matrix norms of these matrices
+ /// are computed.If `axis` is None then either a vector norm (when `x`
+ /// is 1-D) or a matrix norm(when `x` is 2-D) is returned.
+ ///
+ /// Norm of the matrix or vector(s) as double or NDArray.
+ ///
+ ///
+ /// Notes:
+ /// -----
+ /// For values of ``ord <= 0``, the result is, strictly speaking, not a
+ /// mathematical 'norm', but it may still be useful for various numerical
+ /// purposes.
+ /// The following norms can be calculated:
+ /// ===== ============================ ==========================
+ /// ord norm for matrices norm for vectors
+ /// ===== ============================ ==========================
+ /// None Frobenius norm 2-norm
+ /// 'fro' Frobenius norm --
+ /// inf max(sum(abs(x), axis= 1)) max(abs(x))
+ /// -inf min(sum(abs(x), axis= 1)) min(abs(x))
+ /// 0 -- sum(x != 0)
+ /// 1 max(sum(abs(x), axis= 0)) as below
+ /// -1 min(sum(abs(x), axis= 0)) as below
+ /// 2 2-norm(largest sing. value) as below
+ /// -2 smallest singular value as below
+ /// other -- sum(abs(x) ** ord)**(1./ord)
+ /// ===== ============================ ==========================
+ /// The Frobenius norm is given by[1]_:
+ /// :math:`||A||_F = [\\sum_{i, j}
+ /// abs(a_{ i,j})^2]^{1/2}`
+ /// References
+ /// ----------
+ /// .. [1] G.H.Golub and C.F.Van Loan, *Matrix Computations*,
+ /// Baltimore, MD, Johns Hopkins University Press, 1985, pg. 15
+ ///
+ private static object norm(NDArray x, object ord = null, object axis_obj = null)
+ {
+ // Check the default case first and handle it immediately.
+ if (ord == null && axis_obj == null)
+ {
+ x = x.ravel(); // order = 'K'
+ NDArray sqnorm = null;
+ if (x.dtype == typeof(Complex))
+ // Python: sqnorm = dot(x.real, x.real) + dot(x.imag, x.imag)
+ throw new NotImplementedException("Complex is not implemented yet");
+ else
+ sqnorm = dot(x, x);
+ return sqrt(sqnorm);
+ }
+
+ // Normalize the `axis` argument to a tuple.
+ var dim = x.ndim;
+ int[] axis = null;
+ if (axis_obj == null)
+ axis = py.range(dim);
+ else if (axis_obj is int)
+ axis = new int[] {(int)axis_obj};
+ else if (axis_obj is int[])
+ axis = (int[])axis_obj;
+ else
+ throw new ArgumentException($"Invalid axis type: {axis_obj}");
+// if (axis.Length == 1)
+// {
+// if ((string)ord == "inf")
+// return abs(x).max(axis = axis);
+// elif ord == -Inf:
+// return abs(x).min(axis = axis)
+// elif ord == 0:
+// # Zero norm
+// return (x != 0).sum(axis = axis)
+// elif ord == 1:
+// # special case for speedup
+// return add.reduce(abs(x), axis = axis)
+// elif ord is None or ord == 2:
+// # special case for speedup
+// s = (x.conj() * x).real
+// return sqrt(add.reduce(s, axis = axis))
+// else:
+// try:
+// ord + 1
+// except TypeError:
+// raise ValueError("Invalid norm order for vectors.")
+// if x.dtype.type is longdouble:
+// # Convert to a float type, so integer arrays give
+// # float results. Don't apply asfarray to longdouble arrays,
+// # because it will downcast to float64.
+// absx = abs(x)
+// else:
+// absx = x if isComplexType(x.dtype.type) else asfarray(x)
+// if absx.dtype is x.dtype:
+// absx = abs(absx)
+// else:
+// #if the type changed, we can safely overwrite absx
+// abs(absx, out=absx)
+// absx **= ord
+// return add.reduce(absx, axis=axis) ** (1.0 / ord)
+
+// }
+//elif len(axis) == 2:
+// row_axis, col_axis = axis
+// if not (-nd <= row_axis < nd and -nd <= col_axis < nd):
+// raise ValueError('Invalid axis %r for an array with shape %r' %
+// (axis, x.shape))
+// if row_axis % nd == col_axis % nd:
+// raise ValueError('Duplicate axes given.')
+// if ord == 2:
+// return _multi_svd_norm(x, row_axis, col_axis, amax)
+// elif ord == -2:
+// return _multi_svd_norm(x, row_axis, col_axis, amin)
+// elif ord == 1:
+// if col_axis > row_axis:
+// col_axis -= 1
+// return add.reduce(abs(x), axis=row_axis).max(axis=col_axis)
+// elif ord == Inf:
+// if row_axis > col_axis:
+// row_axis -= 1
+// return add.reduce(abs(x), axis=col_axis).max(axis=row_axis)
+// elif ord == -1:
+// if col_axis > row_axis:
+// col_axis -= 1
+// return add.reduce(abs(x), axis=row_axis).min(axis=col_axis)
+// elif ord == -Inf:
+// if row_axis > col_axis:
+// row_axis -= 1
+// return add.reduce(abs(x), axis=col_axis).min(axis=row_axis)
+// elif ord in [None, 'fro', 'f']:
+// return sqrt(add.reduce((x.conj() * x).real, axis=axis))
+// else:
+// raise ValueError("Invalid norm order for matrices.")
+//else:
+// raise ValueError("Improper number of dimensions to norm.")
+ throw new NotImplementedException();
+ }
+
+ /*
+ >>> from numpy import linalg as LA
+ >>> a = np.arange(9) - 4
+ >>> a
+ array([-4, -3, -2, -1, 0, 1, 2, 3, 4])
+ >>> b = a.reshape((3, 3))
+ >>> b
+ array([[-4, -3, -2],
+ [-1, 0, 1],
+ [ 2, 3, 4]])
+ >>> LA.norm(a)
+ 7.745966692414834
+ >>> LA.norm(b)
+ 7.745966692414834
+ >>> LA.norm(b, 'fro')
+ 7.745966692414834
+ >>> LA.norm(a, np.inf)
+ 4
+ >>> LA.norm(b, np.inf)
+ 9
+ >>> LA.norm(a, -np.inf)
+ 0
+ >>> LA.norm(b, -np.inf)
+ 2
+ >>> LA.norm(a, 1)
+ 20
+ >>> LA.norm(b, 1)
+ 7
+ >>> LA.norm(a, -1)
+ -4.6566128774142013e-010
+ >>> LA.norm(b, -1)
+ 6
+ >>> LA.norm(a, 2)
+ 7.745966692414834
+ >>> LA.norm(b, 2)
+ 7.3484692283495345
+ >>> LA.norm(a, -2)
+ nan
+ >>> LA.norm(b, -2)
+ 1.8570331885190563e-016
+ >>> LA.norm(a, 3)
+ 5.8480354764257312
+ >>> LA.norm(a, -3)
+ nan
+ Using the `axis` argument to compute vector norms:
+ >>> c = np.array([[1, 2, 3],
+ ... [-1, 1, 4]])
+ >>> LA.norm(c, axis=0)
+ array([ 1.41421356, 2.23606798, 5. ])
+ >>> LA.norm(c, axis=1)
+ array([ 3.74165739, 4.24264069])
+ >>> LA.norm(c, ord=1, axis=1)
+ array([6, 6])
+ Using the `axis` argument to compute matrix norms:
+ >>> m = np.arange(8).reshape(2,2,2)
+ >>> LA.norm(m, axis=(1,2))
+ array([ 3.74165739, 11.22497216])
+ >>> LA.norm(m[0, :, :]), LA.norm(m[1, :, :])
+ (3.7416573867739413, 11.224972160321824)
+ """
+
+
+ */
+ }
+ }
+}
diff --git a/src/NumSharp.Core/Logic/np.find_common_type.cs b/src/NumSharp.Core/Logic/np.find_common_type.cs
index ebd3f380..5616cc2c 100644
--- a/src/NumSharp.Core/Logic/np.find_common_type.cs
+++ b/src/NumSharp.Core/Logic/np.find_common_type.cs
@@ -600,7 +600,7 @@ internal static NPTypeCode _FindCommonArrayScalarType(Type dtypeArray, Type dtyp
/// Resolves to which type should the output be.
///
/// This function relys on being ordered numerically by size.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
internal static NPTypeCode _FindCommonType(NPTypeCode[] array_types, NPTypeCode[] scalar_types)
{
NPTypeCode maxa = _can_coerce_all(array_types);
@@ -634,7 +634,7 @@ internal static NPTypeCode _FindCommonType(NPTypeCode[] array_types, NPTypeCode[
/// Resolves to which type should the output be.
///
/// This function relys on being ordered numerically by size.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
internal static NPTypeCode _FindCommonType(List array_types, List scalar_types)
{
NPTypeCode maxa = _can_coerce_all(array_types);
@@ -668,7 +668,7 @@ internal static NPTypeCode _FindCommonType(List array_types, List
/// This function relys on being ordered numerically by size.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
internal static NPTypeCode _FindCommonType_Scalar(params NPTypeCode[] scalar_types)
{
return _can_coerce_all(scalar_types);
@@ -678,7 +678,7 @@ internal static NPTypeCode _FindCommonType_Scalar(params NPTypeCode[] scalar_typ
/// Resolves to which type should the output be.
///
/// This function relys on being ordered numerically by size.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
internal static NPTypeCode _FindCommonType_Array(params NPTypeCode[] array_types)
{
return _can_coerce_all(array_types);
@@ -688,7 +688,7 @@ internal static NPTypeCode _FindCommonType_Array(params NPTypeCode[] array_types
/// Resolves to which type should the output be.
///
/// This function relys on being ordered numerically by size.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
internal static NPTypeCode _FindCommonType(params NDArray[] involvedArrays)
{
List scalar = new List(involvedArrays.Length);
@@ -707,7 +707,7 @@ internal static NPTypeCode _FindCommonType(params NDArray[] involvedArrays)
///
/// Resolves to which type should the output be.
///
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
public static NPTypeCode find_common_type(params string[] involvedTypes)
{
return _can_coerce_all(involvedTypes.Select(s => dtype(s).typecode).ToArray());
@@ -717,7 +717,7 @@ public static NPTypeCode find_common_type(params string[] involvedTypes)
/// Resolves to which type should the output be.
///
/// This function relys on being ordered numerically by size.
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
internal static NPTypeCode _FindCommonType(NDArray firstNDArray, NDArray secondNDArray)
{
var lscalar = firstNDArray.Shape.IsScalar;
@@ -737,7 +737,7 @@ internal static NPTypeCode _FindCommonType(NDArray firstNDArray, NDArray secondN
#region Private of find_common_type
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist)
{
int N = dtypelist.Length;
@@ -761,7 +761,7 @@ private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist)
return ret;
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
private static NPTypeCode _can_coerce_all(List dtypelist)
{
int N = dtypelist.Count;
@@ -786,7 +786,7 @@ private static NPTypeCode _can_coerce_all(List dtypelist)
return ret;
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist, int start)
{
int N = dtypelist.Length;
@@ -818,7 +818,7 @@ private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist, int start)
return ret;
}
- [MethodImpl((MethodImplOptions)512)]
+ [MethodImpl(Optimize)]
private static NPTypeCode _can_coerce_all(List dtypelist, int start)
{
int N = dtypelist.Count;
diff --git a/src/NumSharp.Core/Manipulation/np.squeeze.cs b/src/NumSharp.Core/Manipulation/np.squeeze.cs
index ad57c1f6..f403fe2b 100644
--- a/src/NumSharp.Core/Manipulation/np.squeeze.cs
+++ b/src/NumSharp.Core/Manipulation/np.squeeze.cs
@@ -60,7 +60,7 @@ public static Shape squeeze(Shape shape)
/// The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a.
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html
/// If axis is not None, and an axis being squeezed is not of length 1
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
internal static NDArray squeeze_fast(NDArray a, int axis)
{
return a.reshape(squeeze_fast(a.Shape, axis));
@@ -74,7 +74,7 @@ internal static NDArray squeeze_fast(NDArray a, int axis)
/// The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a.
/// https://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html
/// If axis is not None, and an axis being squeezed is not of length 1
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ [MethodImpl(Inline)]
internal static Shape squeeze_fast(Shape a, int axis)
{
var r = a.dimensions.RemoveAt(axis);
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs
index b047625b..2907841b 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsBoolean(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs
index f9371e9c..d856fec7 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsByte(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs
index b827c0a6..0dd8b978 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsChar(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs
index 98678c79..fc01a829 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsDecimal(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs
index a4753598..249abdd8 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsDouble(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs
index 77e959ed..350688ef 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs
index f1a9ce6a..96cd351d 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs
index 81f73926..52989de6 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs
index 752ceb5f..21acc01b 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsSingle(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs
index 35ac4b31..19fbd270 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsUInt16(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs
index 8cddd956..284f134d 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsUInt32(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs
index ca168498..dab08961 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs
@@ -11,7 +11,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray EqualsUInt64(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs
index 09f465ba..60509271 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs
@@ -21,7 +21,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray Equals__1__(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs
index a6186add..288a503c 100644
--- a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs
+++ b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs
@@ -20,7 +20,7 @@ namespace NumSharp.Backends
{
public partial class DefaultEngine
{
- [MethodImpl((MethodImplOptions)768)]
+ [MethodImpl(OptimizeAndInline)]
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
[SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")]
public unsafe NDArray Equals__1__(in NDArray lhs, in NDArray rhs)
diff --git a/src/NumSharp.Core/RandomSampling/np.random.poisson.cs b/src/NumSharp.Core/RandomSampling/np.random.poisson.cs
index 82fe1fde..585b2714 100644
--- a/src/NumSharp.Core/RandomSampling/np.random.poisson.cs
+++ b/src/NumSharp.Core/RandomSampling/np.random.poisson.cs
@@ -43,7 +43,7 @@ public NDArray poisson(double lam, params int[] dims)
return result;
}
- [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)]
+ [MethodImpl(OptimizeAndInline)]
private int knuth(double lambda)
{
// Knuth, 1969.
diff --git a/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs b/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs
index bc6838b3..0c2b7d51 100644
--- a/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs
+++ b/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs
@@ -40,7 +40,7 @@ protected static IEnumerable