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