matrix mul matrix is full function
This commit is contained in:
@@ -26,9 +26,17 @@
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.HighPerformance;
|
||||
<<<<<<< HEAD
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
=======
|
||||
using StgSharp.Internal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -37,6 +45,7 @@ namespace StgSharp.Mathematics.Numeric
|
||||
public partial class MatrixCompute
|
||||
{
|
||||
|
||||
<<<<<<< HEAD
|
||||
private static unsafe void ComputeFmaPanelF32(
|
||||
MatrixKernel* left,
|
||||
MatrixKernel* right,
|
||||
@@ -48,6 +57,47 @@ namespace StgSharp.Mathematics.Numeric
|
||||
int row = scalar->Data<int>(1);
|
||||
int k =
|
||||
|
||||
=======
|
||||
internal static unsafe void ComputeFmaPanelF32(MatrixParallelTaskPackage* p)
|
||||
{
|
||||
int size = p->ElementSize;
|
||||
MatrixKernel* leftBuffer = (MatrixKernel*)p->Left;
|
||||
MatrixKernel* rightBuffer = (MatrixKernel*)p->Right;
|
||||
MatrixKernel* ansBuffer = (MatrixKernel*)p->Answer;
|
||||
MatrixPanel<float>* leftPanel = MatrixPanel.Create<float>();
|
||||
MatrixPanel<float>* rightPanel = MatrixPanel.Create<float>();
|
||||
MatrixPanel<float>* ansPanel = MatrixPanel.Create<float>();
|
||||
ref long offsetRef = ref Unsafe.As<int, long>(ref p->PrimTileOffset);
|
||||
ref long lengthRef = ref Unsafe.As<int, long>(ref p->PrimCount);
|
||||
int ansWidth = p-> AnsPrimOffset;
|
||||
int ansHeight = p->AnsSecOffset;
|
||||
int commonK = p->LeftPrimOffset;
|
||||
int blocksPerRow = ansWidth / size;
|
||||
|
||||
for (long c = offsetRef; c < offsetRef + lengthRef; c++)
|
||||
{
|
||||
int i = (int)(c / blocksPerRow) * size;
|
||||
int j = (int)(c % blocksPerRow) * size;
|
||||
NativeIntrinsic.Intrinsic.f32_clear_panel((MatrixPanel*)ansPanel);
|
||||
for (int k = 0; k < commonK; k += size)
|
||||
{
|
||||
NativeIntrinsic.Intrinsic
|
||||
.f32_build_panel((MatrixPanel*)leftPanel, leftBuffer, commonK,
|
||||
ansHeight, k, i);
|
||||
NativeIntrinsic.Intrinsic
|
||||
.f32_build_panel((MatrixPanel*)rightPanel, rightBuffer, ansWidth,
|
||||
commonK, j, k);
|
||||
NativeIntrinsic.Intrinsic
|
||||
.f32_panel_fma((MatrixPanel*)leftPanel, (MatrixPanel*)rightPanel, (MatrixPanel*)ansPanel);
|
||||
}
|
||||
NativeIntrinsic.Intrinsic
|
||||
.f32_store_panel((MatrixPanel*)ansPanel, ansBuffer, ansWidth,
|
||||
ansHeight, j, i);
|
||||
}
|
||||
MatrixPanel.Destroy(leftPanel);
|
||||
MatrixPanel.Destroy(rightPanel);
|
||||
MatrixPanel.Destroy(ansPanel);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user