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/sigmoid.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 / sigmoid.cl` 29 lines ยท 876 bytes Raw Blame History 1 #pragma OPENCL EXTENSION cl_khr_fp16 : enable 2 3 //------------------------------------------------------------------------------ 4 // sigmoid 5 //------------------------------------------------------------------------------ 6 7 kernel void kernel_sigmoid_f32( 8 global float * src0, 9 ulong offset0, 10 global float * dst, 11 ulong offsetd 12 ) { 13 src0 = (global float*)((global char*)src0 + offset0); 14 dst = (global float*)((global char*)dst + offsetd); 15 16 dst[get_global_id(0)] = 1.0f / (1.0f + exp(-src0[get_global_id(0)])); 17 } 18 19 kernel void kernel_sigmoid_f16( 20 global half * src0, 21 ulong offset0, 22 global half * dst, 23 ulong offsetd 24 ) { 25 src0 = (global half*)((global char*)src0 + offset0); 26 dst = (global half*)((global char*)dst + offsetd); 27 28 dst[get_global_id(0)] = 1.0f / (1.0f + exp(-src0[get_global_id(0)])); 29 }