From 9aa096dc637ebc72ee8c18f3270c8a0eeec0286e Mon Sep 17 00:00:00 2001 From: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:06:08 +0800 Subject: [PATCH] L4 completely add support for multi predictor, working on ver 5 mat para --- StgSharp.Common/HighPerformance/Memory/L4.Prefetch.cs | 3 ++- StgSharp.Mathematics/StgSharp.Mathematics.csproj | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/StgSharp.Common/HighPerformance/Memory/L4.Prefetch.cs b/StgSharp.Common/HighPerformance/Memory/L4.Prefetch.cs index 44f4c183..0e179118 100644 --- a/StgSharp.Common/HighPerformance/Memory/L4.Prefetch.cs +++ b/StgSharp.Common/HighPerformance/Memory/L4.Prefetch.cs @@ -43,6 +43,7 @@ namespace StgSharp.HighPerformance.Memory throw new OverflowException("Too many activated cache line in external reference."); } IL4Predict predict = CurrentPredict; + int predictIndex = CurrentPredictIndex; Span span = new(_prediction, PredictionCount); PredictResult result = predict.Predict(span, out int actualCount); if ((result & PredictResult.Exhausted) != 0) { @@ -89,7 +90,7 @@ namespace StgSharp.HighPerformance.Memory IL4Predict belong = predictorSpan[predictId]; if (predict.IsSamePolicy(head->_profile, belong)) { - head->_predictor = predictId; // wrong line + head->_predictor =predictIndex; } else { belong.WriteBack(head->_origin, head->_profile, new ReadOnlySpan((byte*)head->_address, Unsafe.SizeOf())); diff --git a/StgSharp.Mathematics/StgSharp.Mathematics.csproj b/StgSharp.Mathematics/StgSharp.Mathematics.csproj index f1848ab2..c82748a5 100644 --- a/StgSharp.Mathematics/StgSharp.Mathematics.csproj +++ b/StgSharp.Mathematics/StgSharp.Mathematics.csproj @@ -5,6 +5,15 @@ + + + + + + + + +