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>()));
@@ -5,6 +5,15 @@
<None Remove="Numeric\MatrixParallelWrap.cs.old" />
</ItemGroup>
<ItemGroup>
<Compile Include="Numeric\Runtime\MatrixParallel.Await.old" />
<Compile Include="Numeric\Runtime\MatrixParallel.AwaitingQueue.old" />
</ItemGroup>
<ItemGroup>
<None Include="Numeric\Runtime\MatrixParallel.Publish.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StgSharp.Common\StgSharp.Common.csproj" />
</ItemGroup>