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/scale.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 / scale.comp` 24 lines ยท 625 bytes Raw Blame History 1 #version 450 2 3 #include "types.glsl" 4 #include "generic_unary_head.glsl" 5 6 const uint num_threads = 128; 7 8 layout(local_size_x = num_threads, local_size_y = 1, local_size_z = 1) in; 9 10 void main() { 11 uint idx = get_idx(); 12 13 // num_threads * num_iter must equal 512, to match the wg_denoms and get_idx calculation 14 const uint num_iter = 4; 15 16 [[unroll]] for (uint i = 0; i < num_iter; ++i) { 17 if (idx >= p.ne) { 18 continue; 19 } 20 21 data_d[get_doffset() + idx] = D_TYPE(FLOAT_TYPE(data_a[get_aoffset() + idx]) * FLOAT_TYPE(p.param1) + FLOAT_TYPE(p.param2)); 22 idx += num_threads; 23 } 24 }