#include <math.h>#include <stddef.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Functions | |
| int | ck_attention_decode_append_checked_f32 (const float *q, size_t q_elements, const float *k_new, size_t k_new_elements, const float *v_new, size_t v_new_elements, float *k_cache, size_t k_cache_elements, float *v_cache, size_t v_cache_elements, float *scores, size_t score_elements, float *staged_output, size_t staged_output_elements, float *output, size_t output_elements, size_t heads, size_t kv_heads, size_t cache_capacity, size_t head_dim, size_t position) |
| static int | ck_disjoint (const void *a, size_t a_elements, const void *b, size_t b_elements) |
| int | ck_kv_cache_seed_checked_f32 (const float *k, size_t k_elements, const float *v, size_t v_elements, float *k_cache, size_t k_cache_elements, float *v_cache, size_t v_cache_elements, size_t kv_heads, size_t tokens, size_t cache_capacity, size_t head_dim) |
| static int | ck_mul_size (size_t a, size_t b, size_t *result) |
| static int | ck_region (const void *pointer, size_t elements, uintptr_t *begin, uintptr_t *end) |
| int ck_attention_decode_append_checked_f32 | ( | const float * | q, |
| size_t | q_elements, | ||
| const float * | k_new, | ||
| size_t | k_new_elements, | ||
| const float * | v_new, | ||
| size_t | v_new_elements, | ||
| float * | k_cache, | ||
| size_t | k_cache_elements, | ||
| float * | v_cache, | ||
| size_t | v_cache_elements, | ||
| float * | scores, | ||
| size_t | score_elements, | ||
| float * | staged_output, | ||
| size_t | staged_output_elements, | ||
| float * | output, | ||
| size_t | output_elements, | ||
| size_t | heads, | ||
| size_t | kv_heads, | ||
| size_t | cache_capacity, | ||
| size_t | head_dim, | ||
| size_t | position ) |
Definition at line 63 of file attention_decode_append_checked.c.
References ck_disjoint(), ck_mul_size(), dot(), score, and token.
|
static |
Definition at line 25 of file attention_decode_append_checked.c.
References ck_region().
Referenced by ck_attention_decode_append_checked_f32(), and ck_kv_cache_seed_checked_f32().
| int ck_kv_cache_seed_checked_f32 | ( | const float * | k, |
| size_t | k_elements, | ||
| const float * | v, | ||
| size_t | v_elements, | ||
| float * | k_cache, | ||
| size_t | k_cache_elements, | ||
| float * | v_cache, | ||
| size_t | v_cache_elements, | ||
| size_t | kv_heads, | ||
| size_t | tokens, | ||
| size_t | cache_capacity, | ||
| size_t | head_dim ) |
Definition at line 33 of file attention_decode_append_checked.c.
References ck_disjoint(), and ck_mul_size().
|
static |
Definition at line 9 of file attention_decode_append_checked.c.
Referenced by ck_attention_decode_append_checked_f32(), ck_kv_cache_seed_checked_f32(), and ck_region().
|
static |
Definition at line 15 of file attention_decode_append_checked.c.
References ck_mul_size(), and end.
Referenced by ck_disjoint().