ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-hexagon / htp / hex-bitmap.h
| 1 | #ifndef HEX_BITMAP_H |
| 2 | #define HEX_BITMAP_H |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <stdbool.h> |
| 6 | #include <string.h> |
| 7 | |
| 8 | static inline void bitmap_set(uint32_t * bitmap, uint32_t idx) { |
| 9 | bitmap[idx / 32] |= (1U << (idx % 32)); |
| 10 | } |
| 11 | |
| 12 | static inline void bitmap_clear(uint32_t * bitmap, uint32_t idx) { |
| 13 | bitmap[idx / 32] &= ~(1U << (idx % 32)); |
| 14 | } |
| 15 | |
| 16 | static inline bool bitmap_test(const uint32_t * bitmap, uint32_t idx) { |
| 17 | return (bitmap[idx / 32] & (1U << (idx % 32))) != 0; |
| 18 | } |
| 19 | |
| 20 | static 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 |