HLSf use nuint rather than long, L4 now uses hlsf rather than array to alloc cache line.

This commit is contained in:
Youmu Liu
2026-04-20 18:10:14 +08:00
parent 1b7c929be4
commit 2e2d64a2ce
38 changed files with 796 additions and 465 deletions
@@ -26,7 +26,7 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Collections;
using StgSharp.Common.HighPerformance.ProcessorAbstraction;
using StgSharp.HighPerformance.ProcessorAbstraction;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -86,18 +86,18 @@ namespace StgSharp.Mathematics.Numeric
// init thread on all logical cores
_numaThreads = Numa.CreateForeachThread<MatrixParallelThread>(
core => {
MatrixParallelThread thread = new(core);
SpinWait.SpinUntil(() => thread.State == MatrixThreadState.Ready);
core => {
MatrixParallelThread thread = new(core);
SpinWait.SpinUntil(() => thread.State == MatrixThreadState.Ready);
SIMDID simd = thread.Simd;
ulong mask = simd.Mask;
contextMap[mask] = contextMap.TryGetValue(mask, out int contextCount) ?
(contextCount + 1) :
1;
globalSimd = (globalSimd.Mask != 0) ? UniteSIMDID(globalSimd, simd) : simd;
return thread;
});
SIMDID simd = thread.Simd;
ulong mask = simd.Mask;
contextMap[mask] = contextMap.TryGetValue(mask, out int contextCount) ?
(contextCount + 1) :
1;
globalSimd = (globalSimd.Mask != 0) ? UniteSIMDID(globalSimd, simd) : simd;
return thread;
});
// make global simd context
IntrinsicContext globalContext = new();
@@ -26,6 +26,7 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Common.HighPerformance.ProcessorAbstraction;
using StgSharp.HighPerformance.ProcessorAbstraction;
using StgSharp.Internal;
using StgSharp.Mathematics.Numeric.Runtime;
using StgSharp.Threading;