back to matrix

This commit is contained in:
Youmu Liu
2026-03-23 20:11:08 +08:00
parent 0ac7b2b71f
commit eee88e1098
10 changed files with 100 additions and 179 deletions
@@ -2,8 +2,8 @@
// -----------------------------------------------------------------------
// file="MatrixParallel.Publish"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -48,8 +48,10 @@ namespace StgSharp.Mathematics.Numeric
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe MatrixParallelWrap ScheduleTask<TTask>(nuint computeHandle, MatrixParallelTask* package)
where TTask: IPrefetchPredict
internal static unsafe MatrixParallelWrap ScheduleTask<TTask>(
MatrixParallelThread[] workers,
MatrixParallelTask* package
) where TTask : IPrefetchPredict
{
/*
int primCount = package->PrimCount;
@@ -59,13 +61,10 @@ namespace StgSharp.Mathematics.Numeric
// Console.WriteLine($"amount of kernels is {count}");
long recommendCount = /*count / /**/ 1024;
MatrixParallelThread[] pool = LeadParallel((int)recommendCount);
MatrixParallelWrap wrap = new(pool)
return new(workers)
{
TaskQueue = MatrixParallelQueue.Rent(package)
};
return wrap;
}
}