char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
b2dd28a3b
char/aliceai-t5-moe
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 ) { 9bitmap [idx /32 ] |= (1U << (idx %32 )); 10} 11 12static inline void bitmap_clear (uint32_t * bitmap ,uint32_t idx ) { 13bitmap [idx /32 ] &= ~(1U << (idx %32 )); 14} 15 16static inline bool bitmap_test (const uint32_t * bitmap ,uint32_t idx ) { 17return (bitmap [idx /32 ]& (1U << (idx %32 )))!= 0 ; 18} 19 20static inline void bitmap_reset (uint32_t * bitmap ,size_t size_in_bits ) { 21memset (bitmap ,0 , ((size_in_bits + 31 ) /32 )* sizeof (uint32_t )); 22} 23 24#endif // HEX_BITMAP_H