#include "bf16_utils.h"#include "checked_parallel.h"#include <float.h>#include <math.h>#include <stdatomic.h>#include <string.h>Go to the source code of this file.
Functions | |
| static void | attend_lanes (size_t begin, size_t end, void *ctx) |
| static int | attend_rows (const struct spatial_attention *a, size_t begin, size_t end, float *scores) |
| int | ck_attention_spatial_terms_bf16_checked (const uint16_t *query, const uint16_t *key, const uint16_t *value, const uint16_t *terms, uint16_t *output, float *scores, uint16_t *staged, size_t qkv_elements, size_t term_elements, size_t score_elements, size_t planes, size_t height, size_t width, size_t channels) |
| static double | dot (const uint16_t *q, const uint16_t *k, size_t channels) |
| static int | overlaps (const void *a, size_t na, const void *b, size_t nb) |
| static int | valid_region (const void *p, size_t n, size_t width) |
|
static |
Definition at line 76 of file attention_spatial_terms_checked.c.
References attend_rows(), and end.
Referenced by ck_attention_spatial_terms_bf16_checked().
|
static |
Definition at line 35 of file attention_spatial_terms_checked.c.
References bf16_to_float(), dot(), end, float_to_bf16(), and score.
Referenced by attend_lanes(), and attention_impl().
| int ck_attention_spatial_terms_bf16_checked | ( | const uint16_t * | query, |
| const uint16_t * | key, | ||
| const uint16_t * | value, | ||
| const uint16_t * | terms, | ||
| uint16_t * | output, | ||
| float * | scores, | ||
| uint16_t * | staged, | ||
| size_t | qkv_elements, | ||
| size_t | term_elements, | ||
| size_t | score_elements, | ||
| size_t | planes, | ||
| size_t | height, | ||
| size_t | width, | ||
| size_t | channels ) |
Definition at line 91 of file attention_spatial_terms_checked.c.
References attend_lanes(), ck_checked_parallel_for(), CK_THREADPOOL_MAX_THREADS, count, overlaps(), and valid_region().
|
static |
Definition at line 19 of file attention_spatial_terms_checked.c.
References bf16_to_float().
Referenced by attend_rows().
|
static |
Definition at line 14 of file attention_spatial_terms_checked.c.
Referenced by ck_attention_spatial_terms_bf16_checked().
|
static |
Definition at line 9 of file attention_spatial_terms_checked.c.
Referenced by ck_attention_spatial_terms_bf16_checked().