back to matrix, but trouble in combining L4 predict with matrixparallelqueue

This commit is contained in:
Youmu Liu
2026-03-20 20:04:45 +08:00
parent 48c308ae3c
commit 0ac7b2b71f
5 changed files with 113 additions and 15 deletions
@@ -2,8 +2,8 @@
// -----------------------------------------------------------------------
// file="MatrixParallelThread"
// 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
@@ -53,7 +53,9 @@ namespace StgSharp.Mathematics.Numeric
private readonly ManualResetEventSlim _resetEvent;
private readonly Thread _managedThread;
internal MatrixParallelThread(int poolId)
internal MatrixParallelThread(
int poolId
)
{
_resetEvent = new ManualResetEventSlim(false);
_managedThread = new Thread(MatrixParallelWorkLoad);
@@ -95,9 +97,13 @@ namespace StgSharp.Mathematics.Numeric
[LibraryImport(Native.LibName, EntryPoint = "sn_set_thread_affinity")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
internal static partial void SetThreadAffinity(int coreId);
internal static partial void SetThreadAffinity(
int coreId
);
protected virtual void Dispose(bool disposing)
protected virtual void Dispose(
bool disposing
)
{
if (!_disposed)
{
@@ -143,7 +149,7 @@ namespace StgSharp.Mathematics.Numeric
} else
{
MatrixParallelQueue taskQueue = BindedWrap.TaskQueue;
MatrixParallelTask* p = taskQueue.Package;
MatrixParallelTask* p = taskQueue.BaseTask;
/*
if (0 > (int)p ->ComputeHandle) {
SpecialBufferCompute(p);