working on dynamic wrapping, a good awaiting is on way

This commit is contained in:
Youmu Liu
2025-11-07 18:22:50 +08:00
parent ec1b8dbd51
commit f959339e18
16 changed files with 447 additions and 355 deletions
@@ -42,10 +42,12 @@ namespace StgSharp.Mathematics.Numeric
private readonly MatrixParallelThread[] _threads;
private int _begin;
internal MatrixParallelWrap(MatrixParallelThread[] threads)
internal MatrixParallelWrap(MatrixParallelThread[] threads, int begin, int count)
{
_threads = threads;
_begin = begin;
Count = threads.Length;
_threads[_begin].Role = 1;
}
public MatrixParallelWrap()
@@ -90,7 +92,7 @@ namespace StgSharp.Mathematics.Numeric
int primAverage = primCount / Count;
int secAverage = secCount / Count;
bool shouldSliceSec = secAverage > 512;
for (int i = 0; i < Count; i++)
for (int i = _begin; i < _begin + Count; i++)
{
Queue<IntPtr> tasks = _threads[i].Tasks;
MatrixParallelTaskPackageNonGeneric* subTask = MatrixParallelFactory.FromExistPackage(taskPackage);