can create and retire matrix thread by numa infomation
This commit is contained in:
@@ -89,7 +89,7 @@ namespace StgSharp.Mathematics.Numeric.Linear
|
||||
MkProc op = (MkProc)NumericalModule.GlobalContext.
|
||||
mat_mk[elementType.IntrinsicNode].
|
||||
Get(task->ComputeHandle);
|
||||
if (count <= 256)
|
||||
if ((count <= 256) || !MatrixParallel.IsParallelMeaningful)
|
||||
{
|
||||
op(task);
|
||||
return;
|
||||
@@ -101,43 +101,10 @@ namespace StgSharp.Mathematics.Numeric.Linear
|
||||
return;
|
||||
}
|
||||
pool = MatrixParallel.LeadParallel(count / 1024);
|
||||
MatrixParallelWrap taskGroup = MatrixParallel.ScheduleTask<SequentialPredictor>(pool, task);
|
||||
MatrixParallelWrap taskGroup = MatrixParallel.ScheduleTask<BufferSequentialPredictor>(pool, task);
|
||||
taskGroup.LaunchParallel(SleepMode.DeepSleep);
|
||||
taskGroup.Dispose();
|
||||
}
|
||||
|
||||
private struct SequentialPredictor : IMatrixPredictor<SequentialPredictor>
|
||||
{
|
||||
|
||||
public static PredictPolicy Policy => PredictPolicy.Sequential;
|
||||
|
||||
public PredictResult Predict(
|
||||
Span<CacheLinePrediction> node,
|
||||
out int count
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Prefetch(
|
||||
nuint origin,
|
||||
ulong policy,
|
||||
Span<byte> cache
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void WriteBack(
|
||||
nuint origin,
|
||||
ulong policy,
|
||||
ReadOnlySpan<byte> cache
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user