working on dynamic wrapping

This commit is contained in:
Youmu Liu
2025-11-06 18:12:04 +08:00
parent ea0e6f3ff6
commit ec1b8dbd51
9 changed files with 145 additions and 612 deletions
@@ -49,8 +49,8 @@ namespace StgSharp.Mathematics.Numeric
long count = (long)left.KernelColumnLength * left.KernelRowLength;
if (count <= 1024)
{
CapacityFixedStack<MatrixParallelThread> pool = MatrixParallel.LeadParallel();
if (!pool.TryPop(out MatrixParallelThread thread))
ReadOnlySpan<MatrixParallelThread> pool = MatrixParallel.LeadParallel(1);
if (pool.Length == 0)
{
/*
* wait
@@ -84,8 +84,8 @@ namespace StgSharp.Mathematics.Numeric
if (count <= 1024)
{
// TODO: this is very awkward, blocking thread renting, need a better way to handle small tasks
CapacityFixedStack<MatrixParallelThread> pool = MatrixParallel.LeadParallel();
if (!pool.TryPop(out MatrixParallelThread thread))
ReadOnlySpan<MatrixParallelThread> pool = MatrixParallel.LeadParallel(1);
if (pool.Length == 0)
{
/*
* wait