Better L4 and array storage design
This commit is contained in:
@@ -182,15 +182,52 @@ SN_MK_PROC_DECL_STD(double, avx, , fma);
|
||||
SN_MK_PROC_DECL_STD(double, avx, _fma, fma);
|
||||
SN_MK_PROC_DECL_STD(double, 512, , fma);
|
||||
|
||||
SN_MK_PROC_DECL_STD(float, sse, , tiled_fma);
|
||||
SN_MK_PROC_DECL_STD(float, avx, , tiled_fma);
|
||||
SN_MK_PROC_DECL_STD(float, avx, _fma, tiled_fma);
|
||||
SN_MK_PROC_DECL_STD(float, 512, , tiled_fma);
|
||||
SN_SK_PROC_DECL_STD(float, avx, , add);
|
||||
SN_SK_PROC_DECL_STD(float, 512, , add);
|
||||
|
||||
SN_MK_PROC_DECL_STD(double, sse, , tiled_fma);
|
||||
SN_MK_PROC_DECL_STD(double, avx, , tiled_fma);
|
||||
SN_MK_PROC_DECL_STD(double, avx, _fma, tiled_fma);
|
||||
SN_MK_PROC_DECL_STD(double, 512, , tiled_fma);
|
||||
SN_SK_PROC_DECL_STD(double, sse, , add);
|
||||
SN_SK_PROC_DECL_STD(double, avx, , add);
|
||||
SN_SK_PROC_DECL_STD(double, 512, , add);
|
||||
|
||||
SN_SK_PROC_DECL_STD(float, sse, , sub);
|
||||
SN_SK_PROC_DECL_STD(float, avx, , sub);
|
||||
SN_SK_PROC_DECL_STD(float, 512, , sub);
|
||||
|
||||
SN_SK_PROC_DECL_STD(double, sse, , sub);
|
||||
SN_SK_PROC_DECL_STD(double, avx, , sub);
|
||||
SN_SK_PROC_DECL_STD(double, 512, , sub);
|
||||
|
||||
SN_SK_PROC_DECL_STD(float, sse, , transpose);
|
||||
SN_SK_PROC_DECL_STD(float, avx, , transpose);
|
||||
SN_SK_PROC_DECL_STD(float, 512, , transpose);
|
||||
|
||||
SN_SK_PROC_DECL_STD(float, sse, , scalar_mul);
|
||||
SN_SK_PROC_DECL_STD(float, avx, , scalar_mul);
|
||||
SN_SK_PROC_DECL_STD(float, 512, , scalar_mul);
|
||||
|
||||
SN_SK_PROC_DECL_STD(double, sse, , scalar_mul);
|
||||
SN_SK_PROC_DECL_STD(double, avx, , scalar_mul);
|
||||
SN_SK_PROC_DECL_STD(double, 512, , scalar_mul);
|
||||
|
||||
SN_SK_PROC_DECL_STD(float, sse, , fill);
|
||||
SN_SK_PROC_DECL_STD(float, avx, , fill);
|
||||
SN_SK_PROC_DECL_STD(float, 512, , fill);
|
||||
|
||||
SN_SK_PROC_DECL_STD(double, sse, , fill);
|
||||
SN_SK_PROC_DECL_STD(double, avx, , fill);
|
||||
SN_SK_PROC_DECL_STD(double, 512, , fill);
|
||||
|
||||
SN_SK_PROC_DECL_STD(float, sse, , quality);
|
||||
|
||||
SN_SK_PROC_DECL_STD(float, sse, , fma);
|
||||
SN_SK_PROC_DECL_STD(float, avx, , fma);
|
||||
SN_SK_PROC_DECL_STD(float, avx, _fma, fma);
|
||||
SN_SK_PROC_DECL_STD(float, 512, , fma);
|
||||
|
||||
SN_SK_PROC_DECL_STD(double, sse, , fma);
|
||||
SN_SK_PROC_DECL_STD(double, avx, , fma);
|
||||
SN_SK_PROC_DECL_STD(double, avx, _fma, fma);
|
||||
SN_SK_PROC_DECL_STD(double, 512, , fma);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ static_assert(sizeof(MAT_TASK(float)) == 128, "matrix_parallel_task_package size
|
||||
#endif
|
||||
|
||||
typedef void(SN_DECL *UNI_MK_PROC)(matrix_task *task);
|
||||
typedef void(SN_DECL *UNI_SK_PROC)(mat_kernel const *left, mat_kernel const *right,
|
||||
mat_kernel *restrict ans, uint64_t scalar);
|
||||
|
||||
typedef void(SN_DECL *VECTORNORMALIZEPROC)(__m128 *source, __m128 *target);
|
||||
typedef void(SN_DECL *DOTPROC)(void *transpose, __m128 *vector, __m128 *ans);
|
||||
@@ -85,25 +87,33 @@ typedef int(SN_DECL *INDEX_PAIR)(short const *stram, uint32_t target, int length
|
||||
|
||||
#pragma endregion
|
||||
|
||||
typedef struct mat_intrinsic {
|
||||
UNI_MK_PROC buffer_add;
|
||||
UNI_MK_PROC buffer_fill;
|
||||
UNI_MK_PROC buffer_scalar_mul;
|
||||
UNI_MK_PROC buffer_sub;
|
||||
UNI_MK_PROC buffer_transpose;
|
||||
UNI_MK_PROC ker_fma;
|
||||
UNI_MK_PROC ker_tile_fma;
|
||||
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;
|
||||
} mat_mk_intrinsic;
|
||||
|
||||
} mat_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;
|
||||
} mat_sk_intrinsic;
|
||||
|
||||
// Mirrors C# IntrinsicContext field order so managed/unmanaged layouts stay in sync.
|
||||
typedef struct sn_intrinsic {
|
||||
HASH city_hash_simplify;
|
||||
FACTORIALROC factorial_simd;
|
||||
INDEX_PAIR index_pair;
|
||||
VECTORNORMALIZEPROC vec_f32_normalize_3;
|
||||
mat_intrinsic mat[4];
|
||||
mat_mk_intrinsic mat_mk[0x0a];
|
||||
mat_sk_intrinsic mat_sk[0x0a];
|
||||
} sn_intrinsic;
|
||||
|
||||
typedef enum elment_mask { F32 = 0, F64 = 1, I32 = 2, I64 = 3 } element_mask;
|
||||
|
||||
@@ -10,12 +10,18 @@
|
||||
|
||||
#define mat_task_local ((_mat_task_local const *)task)
|
||||
|
||||
#define STD_MK_PROC_NAME(T_type, T_arch, T_feature, T_op) \
|
||||
T_type##_mat_proc_##T_op##_##T_arch##_##T_feature
|
||||
#define MK_PROC_NAME_STD(T_type, T_arch, T_feature, T_op) \
|
||||
T_type##_multi_kernel_proc_##T_op##_##T_arch##_##T_feature
|
||||
#define SN_MK_PROC_DECL(T_type, P_name) INTERNAL void SN_DECL P_name(MAT_TASK(T_type) const *task)
|
||||
#define SN_MK_PROC_DECL_STD(T_type, T_arch, T_feature, T_op) \
|
||||
INTERNAL void SN_DECL STD_MK_PROC_NAME(T_type, T_arch, T_feature, \
|
||||
INTERNAL void SN_DECL MK_PROC_NAME_STD(T_type, T_arch, T_feature, \
|
||||
T_op)(MAT_TASK(T_type) const *task)
|
||||
#define SK_PROC_NAME_STD(T_type, T_arch, T_feature, T_op) \
|
||||
T_type##_single_kernel_proc_##T_op##_##T_arch##_##T_feature
|
||||
#define SN_SK_PROC_DECL_STD(T_type, T_arch, T_feature, T_op) \
|
||||
INTERNAL void SN_DECL SK_PROC_NAME_STD(T_type, T_arch, T_feature, T_op)( \
|
||||
MAT_KERNEL(T_type) const *left, MAT_KERNEL(T_type) const *right, \
|
||||
MAT_KERNEL(T_type) *restrict ans, uint64_t scalar)
|
||||
|
||||
#define _SN_STD__PROBE_0 0
|
||||
#define _SN_STD__PROBE_1 1
|
||||
|
||||
Reference in New Issue
Block a user