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 / htp-vtcm.h
| 1 | #ifndef HTP_VTCM_H |
| 2 | #define HTP_VTCM_H |
| 3 | |
| 4 | #include <stddef.h> |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | static inline uint8_t *vtcm_seq_alloc(uint8_t **vtcm_ptr, size_t size) { |
| 8 | uint8_t *p = *vtcm_ptr; |
| 9 | *vtcm_ptr += size; |
| 10 | return p; |
| 11 | } |
| 12 | |
| 13 | #define VTCM_LAYOUT_ALLOC(off, field, sz) do { (L)->field = (off); (off) += (sz); } while (0) |
| 14 | #define VTCM_LAYOUT_ALLOC_OPTIONAL(off, field, sz, cond) do { if (cond) { VTCM_LAYOUT_ALLOC(off, field, sz); } else { (L)->field = 0; } } while (0) |
| 15 | |
| 16 | #define VTCM_LAYOUT_PTR(type, base, offset) ((type *)((uint8_t *)(base) + (offset))) |
| 17 | #define VTCM_LAYOUT_PTR_OPTIONAL(type, base, offset, cond) ((cond) ? VTCM_LAYOUT_PTR(type, base, offset) : NULL) |
| 18 | |
| 19 | #endif // HTP_VTCM_H |