L4 completely add support for multi predictor, working on ver 5 mat para

This commit is contained in:
Youmu Liu
2026-04-10 18:06:08 +08:00
parent 8a66c1697a
commit 9aa096dc63
2 changed files with 11 additions and 1 deletions
@@ -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<CacheLinePrediction> 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>((byte*)head->_address, Unsafe.SizeOf<CacheLineData>()));