Update ggml.c

Prefetch data used later in the loop
This commit is contained in:
Sylvie 2023-04-04 21:50:15 +02:00 committed by GitHub
parent 53dbba7695
commit b1fa386c11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
ggml.c
View file

@ -1975,6 +1975,10 @@ static void ggml_vec_dot_q4_0(const int n, float * restrict s, const void * rest
// This loop will be unrolled by the compiler
for (int u=0;u<UNROLL_COUNT;u++) {
// Prefetch data used later in the loop
// TODO these numbers are device dependent shouldn't be hard coded derive
_mm_prefetch ( x[i+u].qs + 32*20, 1); // to-do: document what 32*20 even is
/* Compute combined scale for the block */
const __m256 scale = _mm256_mul_ps(
_mm256_broadcast_ss( &x[i+u].d ),