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-opencl/kernels/transpose_activation_q8.cl # 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-opencl / kernels / transpose_activation_q8.cl` 35 lines ยท 1105 bytes Raw Blame History 1 #pragma OPENCL EXTENSION cl_khr_fp16 : enable 2 #pragma OPENCL EXTENSION cl_khr_subgroups : enable 3 4 #define tile_size 32 5 6 kernel void kernel_transpose_activation_q8( 7 __global uint * src1_qa, 8 __global uint * src1_qa_trans, 9 __global half * src1_sa, 10 __global float * src1_sa_trans, 11 __global const int * total_tiles, 12 uint K 13 ) { 14 uint row_in_tile = get_global_id(0); 15 uint blk_k = get_group_id(1); 16 uint col_in_tile = get_local_id(1); 17 uint tile_n = get_global_id(2); 18 19 if (blk_k >= (K / tile_size) || tile_n >= (uint)total_tiles[0]) { 20 return; 21 } 22 23 uint src_idx = (tile_n * tile_size + row_in_tile) * K / 4 + blk_k * 8 + col_in_tile; 24 uint dst_idx = tile_n * tile_size * K / 4 + (blk_k * 8 + col_in_tile) * tile_size + row_in_tile; 25 26 src1_qa_trans[dst_idx] = src1_qa[src_idx]; 27 28 if (col_in_tile == 0) { 29 src_idx = (tile_n * tile_size + row_in_tile) * K / 32 + blk_k; 30 dst_idx = tile_n * tile_size * K / 32 + blk_k * tile_size + row_in_tile; 31 32 src1_sa_trans[dst_idx] = (float)(src1_sa[src_idx]); 33 } 34 35 }