ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-opencl / kernels / mul_mat_id_utils.cl
| 1 | kernel void kernel_moe_zero_dst( |
| 2 | global const char * ids, |
| 3 | ulong offset_ids, |
| 4 | ulong nb_ids1, |
| 5 | global char * dst, |
| 6 | ulong offset_dst, |
| 7 | ulong nb1, |
| 8 | ulong nb2, |
| 9 | int ne0 |
| 10 | ) { |
| 11 | const size_t i1 = get_group_id(0); |
| 12 | const size_t i2 = get_group_id(1); |
| 13 | const int expert = *((global const int *)(ids + offset_ids + i1*sizeof(int) + i2*nb_ids1)); |
| 14 | if (expert != -1) { |
| 15 | return; |
| 16 | } |
| 17 | |
| 18 | global float * row = (global float *)(dst + offset_dst + i1*nb1 + i2*nb2); |
| 19 | for (size_t i0 = get_local_id(2); i0 < (size_t)ne0; i0 += get_local_size(2)) { |
| 20 | row[i0] = 0.0f; |
| 21 | } |
| 22 | } |