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 / hvx-types.h
| 1 | #ifndef HVX_TYPES_H |
| 2 | #define HVX_TYPES_H |
| 3 | |
| 4 | #include <stdbool.h> |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | #include <hexagon_types.h> |
| 8 | |
| 9 | #define SIZEOF_FP32 (4) |
| 10 | #define SIZEOF_FP16 (2) |
| 11 | #define VLEN (128) |
| 12 | #define VLEN_FP32 (VLEN / SIZEOF_FP32) |
| 13 | #define VLEN_FP16 (VLEN / SIZEOF_FP16) |
| 14 | |
| 15 | typedef union { |
| 16 | HVX_Vector v; |
| 17 | uint8_t b[VLEN]; |
| 18 | uint16_t h[VLEN_FP16]; |
| 19 | uint32_t w[VLEN_FP32]; |
| 20 | __fp16 fp16[VLEN_FP16]; |
| 21 | float fp32[VLEN_FP32]; |
| 22 | } __attribute__((aligned(VLEN), packed)) HVX_VectorAlias; |
| 23 | |
| 24 | typedef struct { |
| 25 | HVX_Vector v[2]; |
| 26 | } HVX_Vector_x2; |
| 27 | |
| 28 | typedef struct { |
| 29 | HVX_Vector v[4]; |
| 30 | } HVX_Vector_x4; |
| 31 | |
| 32 | typedef struct { |
| 33 | HVX_Vector v[8]; |
| 34 | } HVX_Vector_x8; |
| 35 | |
| 36 | #endif /* HVX_TYPES_H */ |