ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-vulkan / vulkan-shaders / scale.comp
| 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 | } |