Better FMA
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="NumericalModule"
|
||||
// Project: StgSharp
|
||||
@@ -25,9 +25,11 @@
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.Mathematics.Internal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -36,12 +38,53 @@ namespace StgSharp.Mathematics.Numeric
|
||||
public class NumericalModule : IStaticModule
|
||||
{
|
||||
|
||||
public static unsafe int DefaultSIMDAlignment
|
||||
{
|
||||
get
|
||||
{
|
||||
SIMDID id = GlobalIntrinsicMask;
|
||||
return (id.MaskByte[0] & 0b_00001111) switch
|
||||
{
|
||||
1 => id.MaskByte[1] switch
|
||||
{
|
||||
1 => 16,
|
||||
2 => 32,
|
||||
3 => 64,
|
||||
4 => 64,
|
||||
5 => 64,
|
||||
_ => 8,
|
||||
},
|
||||
_ => 8,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public string ModuleName => "Math.Numerical";
|
||||
|
||||
internal static IntrinsicContext GlobalContext
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get;
|
||||
} = new();
|
||||
|
||||
internal static SIMDID GlobalIntrinsicMask { get; set; }
|
||||
|
||||
public void InitializeModule()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InitializeModule(
|
||||
IModuleInitializeProfile profile
|
||||
)
|
||||
{
|
||||
MatrixParallel.Init();
|
||||
}
|
||||
|
||||
public void UninitializeModule()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user