char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
91ea44e89
char/aliceai-t5-moe
1kernel void kernel_repeat_f32 ( 2global const char * src0 , 3ulong offset0 , 4global char * dst , 5ulong offsetd , 6int ne00 , 7int ne01 , 8int ne02 , 9int ne03 , 10ulong nb00 , 11ulong nb01 , 12ulong nb02 , 13ulong nb03 , 14int ne0 , 15ulong nb0 , 16ulong nb1 , 17ulong nb2 , 18ulong nb3 19) { 20 src0 = src0 + offset0; 21 dst = dst + offsetd; 22 23 const int i3 = get_group_id(2); 24 const int i2 = get_group_id(1); 25 const int i1 = get_group_id(0); 26 27 const int i03 = i3%ne03; 28 const int i02 = i2%ne02; 29 const int i01 = i1%ne01; 30 31 global const char * src0_ptr = src0 + i03*nb03 + i02*nb02 + i01*nb01; 32 global char * dst_ptr = dst + i3*nb3 + i2*nb2 + i1*nb1; 33 34 for (int i0 = get_local_id(0); i0 < ne0; i0 += get_local_size(0)) { 35 const int i00 = i0%ne00; 36 *((global float *)(dst_ptr + i0*nb0)) = *((global float *)(src0_ptr + i00*nb00)); 37 } 38}