allow using code from ggml-phi-knc-dot_q5_K_q8_K.c

This commit is contained in:
Julia Longtin 2024-03-23 15:02:56 +00:00
parent aee550af6c
commit a015d8485e

View file

@ -4,6 +4,7 @@
#include "ggml-quants.h" #include "ggml-quants.h"
#include "ggml-impl.h" #include "ggml-impl.h"
// FIXME: why do we import this twice?
#define GGML_COMMON_IMPL_C #define GGML_COMMON_IMPL_C
#include "ggml-common.h" #include "ggml-common.h"
@ -49,6 +50,11 @@
#include <riscv_vector.h> #include <riscv_vector.h>
#endif #endif
// hand assembled replacement functions are cool.
#if defined(__k1om__)
#include <ggml-phi-knc-dot_q5_K_q8_K.h>
#endif
#undef MIN #undef MIN
#undef MAX #undef MAX
@ -7153,6 +7159,9 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * restrict s, size_t bs, const void * r
} }
#endif #endif
#if defined(__k1om__)
/* We get this from elsewhere. */
#else
#if QK_K == 256 #if QK_K == 256
void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * restrict vx, size_t bx, const void * restrict vy, size_t by, int nrc) { void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * restrict vx, size_t bx, const void * restrict vy, size_t by, int nrc) {
assert(n % QK_K == 0); assert(n % QK_K == 0);
@ -7577,7 +7586,7 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * r
#endif #endif
} }
#else #else /* QK_K != 256 */
void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * restrict vx, size_t bx, const void * restrict vy, size_t by, int nrc) { void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * restrict vx, size_t bx, const void * restrict vy, size_t by, int nrc) {
assert(n % QK_K == 0); assert(n % QK_K == 0);
@ -7846,8 +7855,9 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * r
*s = sumf; *s = sumf;
#endif #endif
} }
#endif #endif /* end QK_K != 256 */
#endif /* defined(__k1om__) */
#if QK_K == 256 #if QK_K == 256
void ggml_vec_dot_q6_K_q8_K(int n, float * restrict s, size_t bs, const void * restrict vx, size_t bx, const void * restrict vy, size_t by, int nrc) { void ggml_vec_dot_q6_K_q8_K(int n, float * restrict s, size_t bs, const void * restrict vx, size_t bx, const void * restrict vy, size_t by, int nrc) {