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 / diag_mask_inf.comp
| 1 | #version 450 |
| 2 | |
| 3 | #extension GL_EXT_shader_16bit_storage : require |
| 4 | #extension GL_EXT_control_flow_attributes : enable |
| 5 | |
| 6 | layout (push_constant) uniform parameter |
| 7 | { |
| 8 | uint ncols; |
| 9 | uint rows_per_channel; |
| 10 | uint n_past; |
| 11 | } p; |
| 12 | |
| 13 | #include "types.glsl" |
| 14 | |
| 15 | layout(local_size_x = 1, local_size_y = 512, local_size_z = 1) in; |
| 16 | |
| 17 | layout (binding = 0) readonly buffer X {A_TYPE data_a[];}; |
| 18 | layout (binding = 1) writeonly buffer D {D_TYPE data_d[];}; |
| 19 | |
| 20 | void main() { |
| 21 | const uint col = gl_GlobalInvocationID.y; |
| 22 | const uint row = gl_GlobalInvocationID.x; |
| 23 | |
| 24 | if (col >= p.ncols) { |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | const uint i = row*p.ncols + col; |
| 29 | if (col > p.n_past + row % p.rows_per_channel) { |
| 30 | data_d[i] = D_TYPE(uintBitsToFloat(0xFF800000)); |
| 31 | } else { |
| 32 | data_d[i] = D_TYPE(data_a[i]); |
| 33 | } |
| 34 | } |