Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-opencl/kernels/silu.cl # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-opencl / kernels / silu.cl` 30 lines ยท 897 bytes Raw Blame History 1 #pragma OPENCL EXTENSION cl_khr_fp16 : enable 2 3 //------------------------------------------------------------------------------ 4 // silu 5 //------------------------------------------------------------------------------ 6 kernel void kernel_silu( 7 global float * src0, 8 ulong offset0, 9 global float * dst, 10 ulong offsetd 11 ) { 12 src0 = (global float*)((global char*)src0 + offset0); 13 dst = (global float*)((global char*)dst + offsetd); 14 15 float x = src0[get_global_id(0)]; 16 dst[get_global_id(0)] = x / (1.0f + exp(-x)); 17 } 18 19 kernel void kernel_silu_4( 20 global float4 * src0, 21 ulong offset0, 22 global float4 * dst, 23 ulong offsetd 24 ) { 25 src0 = (global float4*)((global char*)src0 + offset0); 26 dst = (global float4*)((global char*)dst + offsetd); 27 28 float4 x = src0[get_global_id(0)]; 29 dst[get_global_id(0)] = x / (1.0f + exp(-x)); 30 }