char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Max Krasnyanskyhexagon: L2 cache handling rework (dirty bit tracking with lazy flushing) and more MUL_MAT updates (#25762)b2dd28a3b

char/aliceai-t5-moe
634 B24 linesraw
1#ifndef HEX_BITMAP_H
2#define HEX_BITMAP_H
3
4#include <stdint.h>
5#include <stdbool.h>
6#include <string.h>
7
8static inline void bitmap_set(uint32_t * bitmap, uint32_t idx) {
9    bitmap[idx / 32] |= (1U << (idx % 32));
10}
11
12static inline void bitmap_clear(uint32_t * bitmap, uint32_t idx) {
13    bitmap[idx / 32] &= ~(1U << (idx % 32));
14}
15
16static inline bool bitmap_test(const uint32_t * bitmap, uint32_t idx) {
17    return (bitmap[idx / 32] & (1U << (idx % 32))) != 0;
18}
19
20static inline void bitmap_reset(uint32_t * bitmap, size_t size_in_bits) {
21    memset(bitmap, 0, ((size_in_bits + 31) / 32) * sizeof(uint32_t));
22}
23
24#endif // HEX_BITMAP_H