left and right use diff pack kernel

This commit is contained in:
Youmu Liu
2026-06-12 18:25:04 +08:00
parent 06a119cc6f
commit 2741b34583
6 changed files with 390 additions and 164 deletions
@@ -175,17 +175,39 @@ SN_MK_PROC_DECL_STD(float, sse, , quality);
*
* CONVENSIONS:
*
* buffer_1 is pointer to original colum, offset_1 is the offset to the original column, count_1 is the count can be packed
* buffer_1 is pointer to original colum,
* offset_1 is the offset to the original column,
* count_1 is the count can be packed
*
* C# shceduler is responsible for calculating the offset and count based on the actual buffer size and matrix dimension,
* and make sure that count_1 will not exceeds lenght of the column
*
* scalar pack carries column length and offset data:
* [column length, offset, buffer requires, empty]
* [column length, empty, empty, empty]
*/
SN_MK_PROC_DECL_STD(float, sse, , fma_pack_left);
SN_MK_PROC_DECL_STD(float, avx, , fma_pack_left);
SN_MK_PROC_DECL_STD(float, 512, , fma_pack_left);
/*
* pack right matrix data to L4 buffer
*
* CONVENSIONS:
*
* buffer_1 is pointer to original row,
* offset_1 is the offset to the original row,
* count_1 is the count can be packed
*
* C# shceduler is responsible for calculating the offset and count based on the actual buffer size and matrix dimension,
* and make sure that count_1 will not exceeds lenght of the row
*
* scalar pack carries column length and offset data:
* [column length, empty, empty, empty]
*/
SN_MK_PROC_DECL_STD(float, sse, , fma_pack_right);
SN_MK_PROC_DECL_STD(float, avx, , fma_pack_right);
SN_MK_PROC_DECL_STD(float, 512, , fma_pack_right);
SN_MK_PROC_DECL_STD(float, sse, , fma);
SN_MK_PROC_DECL_STD(float, avx, , fma);
SN_MK_PROC_DECL_STD(float, avx, _fma, fma);
+15 -14
View File
@@ -160,23 +160,11 @@ typedef int(SN_DECL *INDEX_PAIR)(short const *stram, uint32_t target, int length
#pragma endregion
typedef struct mat_mk_intrinsic {
UNI_MK_PROC add;
UNI_MK_PROC fill;
UNI_MK_PROC scalar_mul;
UNI_MK_PROC sub;
UNI_MK_PROC transpose;
UNI_MK_PROC fma;
UNI_MK_PROC pivot;
UNI_MK_PROC proc_array[10];
} mat_mk_intrinsic;
typedef struct mat_sk_intrinsic {
UNI_SK_PROC add;
UNI_SK_PROC fill;
UNI_SK_PROC scalar_mul;
UNI_SK_PROC sub;
UNI_SK_PROC transpose;
UNI_SK_PROC fma;
UNI_SK_PROC pivot;
UNI_SK_PROC proc_array[10];
} mat_sk_intrinsic;
// Mirrors C# IntrinsicContext field order so managed/unmanaged layouts stay in sync.
@@ -188,6 +176,19 @@ typedef struct sn_intrinsic {
mat_sk_intrinsic mat_sk[0x0a];
} sn_intrinsic;
typedef enum mat_proc_index {
Add = 0,
Fill = 1,
ScalarMul = 2,
Sub = 3,
Transpose = 4,
ClearPanel = 5,
Fma = 6,
PackFmaLeft = 7,
PackFmaRight = 8,
Pivot = 9,
} mat_proc_index;
typedef enum elment_mask { F32 = 0, F64 = 1, I32 = 2, I64 = 3 } element_mask;
#endif