add multi predictor support to l4, working for ver 5 of mat parallel
This commit is contained in:
@@ -36,14 +36,15 @@ namespace StgSharp.HighPerformance.Memory
|
||||
|
||||
private partial void Prefetch()
|
||||
{
|
||||
if (PrefetchPredict is null) {
|
||||
if (CurrentPredict is null) {
|
||||
return;
|
||||
}
|
||||
if (_activeCount > MaxActivateCacheLineCount) {
|
||||
throw new OverflowException("Too many activated cache line in external reference.");
|
||||
}
|
||||
Span<CacheLinePrediction> span = new(_prediction, PredictionCount);
|
||||
if (!PrefetchPredict.Predict(span, out int actualCount) && (actualCount <= 0))
|
||||
PredictResult result = PrefetchPredict.Predict(span, out int actualCount);
|
||||
if ((result == PredictResult.Exhausted) && (actualCount <= 0))
|
||||
{
|
||||
_exhausted = true;
|
||||
return;
|
||||
@@ -87,7 +88,7 @@ namespace StgSharp.HighPerformance.Memory
|
||||
head->_origin = address;
|
||||
head->_profile = handle.MapPolicy;
|
||||
head->_refCount = 0;
|
||||
head->_address = nuint & _data[index];
|
||||
head->_address = (nuint)(_data + index);
|
||||
|
||||
// pre fetch them here
|
||||
PrefetchPredict.Prefetch(head->_origin, head->_profile, new Span<byte>((byte*)head->_address, Unsafe.SizeOf<CacheLineData>()));
|
||||
|
||||
Reference in New Issue
Block a user