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-vulkan/vulkan-shaders/sub.comp # 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-vulkan / vulkan-shaders / sub.comp` 29 lines ยท 826 bytes Raw Blame History 1 #version 450 2 3 #extension GL_EXT_shader_16bit_storage : require 4 5 #include "types.glsl" 6 #include "generic_binary_head.glsl" 7 8 const uint num_threads = 256; 9 10 layout(local_size_x = num_threads, local_size_y = 1, local_size_z = 1) in; 11 12 void main() { 13 uint idx = get_idx(); 14 15 // num_threads * num_iter must equal 512, to match the wg_denoms and get_idx calculation 16 const uint num_iter = 2; 17 18 [[unroll]] for (uint i = 0; i < num_iter; ++i) { 19 if (idx >= p.ne) { 20 continue; 21 } 22 uint i00, i01, i02, i03; 23 get_indices(idx, i00, i01, i02, i03); 24 25 data_d[get_doffset() + dst_idx(i00, i01, i02, i03)] = D_TYPE(FLOAT_TYPE(data_a[get_aoffset() + src0_idx(i00, i01, i02, i03)]) - FLOAT_TYPE(data_b[get_boffset() + src1_idx(i00, i01, i02, i03)])); 26 27 idx += num_threads; 28 } 29 }