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 / repeat.comp
| 1 | #version 450 |
| 2 | |
| 3 | #include "types.glsl" |
| 4 | #include "generic_unary_head.glsl" |
| 5 | |
| 6 | layout(local_size_x = 512, local_size_y = 1, local_size_z = 1) in; |
| 7 | |
| 8 | uint src0_idx_mod(uint idx) { |
| 9 | const uint i13 = idx / (p.ne12*p.ne11*p.ne10); |
| 10 | const uint i13_offset = i13 * p.ne12*p.ne11*p.ne10; |
| 11 | const uint i12 = (idx - i13_offset) / (p.ne11*p.ne10); |
| 12 | const uint i12_offset = i12*p.ne11*p.ne10; |
| 13 | const uint i11 = (idx - i13_offset - i12_offset) / p.ne10; |
| 14 | const uint i10 = idx - i13_offset - i12_offset - i11*p.ne10; |
| 15 | return (i13 % p.ne03)*p.nb03 + (i12 % p.ne02)*p.nb02 + (i11 % p.ne01)*p.nb01 + (i10 % p.ne00)*p.nb00; |
| 16 | } |
| 17 | |
| 18 | void main() { |
| 19 | const uint idx = get_idx(); |
| 20 | |
| 21 | if (idx >= p.ne) { |
| 22 | return; |
| 23 | } |
| 24 | |
| 25 | data_d[get_doffset() + dst_idx(idx)] = D_TYPE(data_a[get_aoffset() + src0_idx_mod(idx)]); |
| 26 | } |