SPMD SIMD math library & lock-free job system integration
- Add new SPMD SIMD math project with scalar/vector lanes - Integrate SPMD jobs and scheduling into job system - Implement lock-free job dependency management - Update math functions for .NET 10 and SIMD performance - Add SPMD benchmarks, compress-store tests, and race tests - Introduce generic Result<T> error handling utilities - Solution/project file updates and code cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace Misaki.HighPerformance.Jobs;
|
||||
namespace Misaki.HighPerformance.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a job that performs a single unit of work.
|
||||
@@ -23,4 +23,25 @@ public interface IJobParallelFor
|
||||
/// <param name="loopIndex">The index of the item to process.</param>
|
||||
/// <param name="threadIndex">The index of the thread executing the job, useful for thread-specific operations.</param>
|
||||
void Execute(int loopIndex, int threadIndex);
|
||||
}
|
||||
|
||||
public static class IJobExtensions
|
||||
{
|
||||
public static void Run<T>(this ref T job, int threadIndex)
|
||||
where T : unmanaged, IJob
|
||||
{
|
||||
job.Execute(threadIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public static class IJobParallelForExtensions
|
||||
{
|
||||
public static void Run<T>(this ref T job, int totalIterations, int threadIndex)
|
||||
where T : unmanaged, IJobParallelFor
|
||||
{
|
||||
for (var i = 0; i < totalIterations; i++)
|
||||
{
|
||||
job.Execute(i, threadIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user