Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-hexagon/htp/dsv4-hc-ops.h # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-hexagon / htp / dsv4-hc-ops.h` 77 lines ยท 2174 bytes Raw Blame History 1 #ifndef HTP_DSV4_HC_OPS_H 2 #define HTP_DSV4_HC_OPS_H 3 4 #include 5 6 #include "hex-fastdiv.h" 7 #include "htp-ops.h" 8 9 #define HTP_DSV4_HC_CHUNK_ELEMS 32 10 #define HTP_DSV4_HC_MAX_CHUNKS 128 11 #define HTP_DSV4_HC_PRE_GATED_ROWS 9 12 #define HTP_DSV4_HC_PRE_PLAIN_ROWS 6 13 14 enum htp_dsv4_hc_pre_kernel_type { 15 HTP_DSV4_HC_PRE_KERNEL_PLAIN = 0, 16 HTP_DSV4_HC_PRE_KERNEL_GATED = 1, 17 }; 18 19 struct htp_dsv4_hc_pre_kernel_params { 20 uint32_t kernel_type; 21 uint32_t n_threads; 22 uint32_t n_chunks; 23 uint32_t total_jobs; 24 uint32_t jobs_per_thread; 25 26 uint32_t dma_block_chunks; 27 uint32_t dma_row_stride; 28 uint32_t dma_buffer_size; 29 uint32_t vtcm_size; 30 31 struct fastdiv_values div_n_chunks; 32 struct fastdiv_values div_n_threads; 33 }; 34 35 #if defined(__cplusplus) 36 static_assert(sizeof(struct htp_dsv4_hc_pre_kernel_params) <= 128, "htp_dsv4_hc_pre_kernel_params is too large for kernel_params blob"); 37 #else 38 _Static_assert(sizeof(struct htp_dsv4_hc_pre_kernel_params) <= 128, "htp_dsv4_hc_pre_kernel_params is too large for kernel_params blob"); 39 #endif 40 41 // dma buffer holds residual rows 0..3, x at row 4, dst rows 5..8, post/comb at row 9 42 #define HTP_DSV4_HC_POST_ROWS 10 43 44 enum htp_dsv4_hc_post_kernel_type { 45 HTP_DSV4_HC_POST_KERNEL_IDENTITY = 0, 46 HTP_DSV4_HC_POST_KERNEL_COMB = 1, 47 }; 48 49 struct htp_dsv4_hc_post_kernel_params { 50 uint32_t kernel_type; 51 uint32_t n_threads; 52 uint32_t n_chunks; 53 uint32_t total_jobs; 54 uint32_t jobs_per_thread; 55 uint32_t has_comb; 56 57 uint32_t dma_block_chunks; 58 uint32_t dma_row_stride; 59 uint32_t dma_buffer_size; 60 uint32_t vtcm_size; 61 62 struct fastdiv_values div_n_chunks; 63 struct fastdiv_values div_n_threads; 64 }; 65 66 #if defined(__cplusplus) 67 static_assert(sizeof(struct htp_dsv4_hc_post_kernel_params) <= 128, "htp_dsv4_hc_post_kernel_params is too large for kernel_params blob"); 68 #else 69 _Static_assert(sizeof(struct htp_dsv4_hc_post_kernel_params) <= 128, "htp_dsv4_hc_post_kernel_params is too large for kernel_params blob"); 70 #endif 71 72 struct htp_ops_context; 73 74 int op_dsv4_hc_pre(struct htp_ops_context * octx); 75 int op_dsv4_hc_post(struct htp_ops_context * octx); 76 77 #endif // HTP_DSV4_HC_OPS_H