add scheduler method; fixing buffer parallel errors
This commit is contained in:
@@ -34,31 +34,33 @@ namespace StgSharp.Mathematics.Numeric
|
||||
internal static class MatrixComputeModel
|
||||
{
|
||||
|
||||
internal static unsafe void BufferComputeBinary(MatrixParallelTaskPackageNonGeneric* p)
|
||||
internal static unsafe void BufferComputeBinary(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int size = p->ElementSize * 16;
|
||||
int count = p->PrimCount * p->SecCount;
|
||||
int offset = p->LeftPrimOffset * p->SecCount;
|
||||
long count = Unsafe.As<int, long>(ref p->PrimCount);
|
||||
long offset = Unsafe.As<int, long>(ref p->PrimTileOffset) * size;
|
||||
|
||||
((delegate* unmanaged[Cdecl]<void*, void*, void*, int, void>)p->ComputeHandle)((void*)(p->Left + offset * size),
|
||||
(void*)(p->Right + offset * size),
|
||||
(void*)(p->Result + offset * size),
|
||||
count);
|
||||
((delegate* unmanaged[Cdecl]<void*, void*, void*, long, void>)p->ComputeHandle)((void*)(p->Left + offset),
|
||||
(void*)(p->Right + offset),
|
||||
(void*)(p->Result + offset),
|
||||
count);
|
||||
MatrixParallelFactory.Release(p);
|
||||
}
|
||||
|
||||
internal static unsafe void BufferComputeUnaryScalar(MatrixParallelTaskPackageNonGeneric* p)
|
||||
internal static unsafe void BufferComputeUnaryScalar(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int size = p->ElementSize * 16;
|
||||
int count = p->PrimCount * p->SecCount;
|
||||
int offset = p->LeftPrimOffset * p->SecCount;
|
||||
long count = Unsafe.As<int, long>(ref p->PrimCount);
|
||||
long offset = Unsafe.As<int, long>(ref p->PrimTileOffset) * size;
|
||||
|
||||
((delegate* unmanaged[Cdecl]<void*, void*, int, void>)p->ComputeHandle)((void*)(p->Right + offset * size),
|
||||
(void*)(p->Result + offset * size),
|
||||
((delegate* unmanaged[Cdecl]<void*, void*, long, void>)p->ComputeHandle)((void*)(p->Right + offset),
|
||||
(void*)(p->Result + offset),
|
||||
count);
|
||||
MatrixParallelFactory.Release(p);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static unsafe void Compute_Binary(MatrixParallelTaskPackageNonGeneric* p)
|
||||
internal static unsafe void Compute_Binary(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int eSize = p->ElementSize;
|
||||
|
||||
@@ -106,10 +108,11 @@ namespace StgSharp.Mathematics.Numeric
|
||||
op(left + (nint)lc, right + (nint)rc, ans + (nint)ac);
|
||||
}
|
||||
}
|
||||
MatrixParallelFactory.Release(p);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static unsafe void Compute_BinaryScalar(MatrixParallelTaskPackageNonGeneric* p)
|
||||
internal static unsafe void Compute_BinaryScalar(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int eSize = p->ElementSize;
|
||||
|
||||
@@ -157,10 +160,11 @@ namespace StgSharp.Mathematics.Numeric
|
||||
op(left + (nint)lc, right + (nint)rc, ans + (nint)ac, p->Scalar);
|
||||
}
|
||||
}
|
||||
MatrixParallelFactory.Release(p);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static unsafe void Compute_Unary(MatrixParallelTaskPackageNonGeneric* p)
|
||||
internal static unsafe void Compute_Unary(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int eSize = p->ElementSize;
|
||||
|
||||
@@ -201,10 +205,11 @@ namespace StgSharp.Mathematics.Numeric
|
||||
op(right + (nint)rc, ans + (nint)ac);
|
||||
}
|
||||
}
|
||||
MatrixParallelFactory.Release(p);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static unsafe void Compute_UnaryScalar(MatrixParallelTaskPackageNonGeneric* p)
|
||||
internal static unsafe void Compute_UnaryScalar(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int eSize = p->ElementSize;
|
||||
|
||||
@@ -245,6 +250,7 @@ namespace StgSharp.Mathematics.Numeric
|
||||
op(right + (nint)rc, ans + (nint)ac, p->Scalar);
|
||||
}
|
||||
}
|
||||
MatrixParallelFactory.Release(p);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user