summaryrefslogtreecommitdiff
path: root/llama.cpp/ggml/src/ggml-opencl/kernels/fill.cl
diff options
context:
space:
mode:
Diffstat (limited to 'llama.cpp/ggml/src/ggml-opencl/kernels/fill.cl')
-rw-r--r--llama.cpp/ggml/src/ggml-opencl/kernels/fill.cl17
1 files changed, 17 insertions, 0 deletions
diff --git a/llama.cpp/ggml/src/ggml-opencl/kernels/fill.cl b/llama.cpp/ggml/src/ggml-opencl/kernels/fill.cl
new file mode 100644
index 0000000..9b73938
--- /dev/null
+++ b/llama.cpp/ggml/src/ggml-opencl/kernels/fill.cl
@@ -0,0 +1,17 @@
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+//------------------------------------------------------------------------------
+// fill
+//------------------------------------------------------------------------------
+__kernel void kernel_fill_f32(
+ __global float *dst,
+ ulong offsetd,
+ float v,
+ int n
+
+) {
+ dst = (global float*)((global char*)dst + offsetd);
+ if(get_global_id(0) < n){
+ dst[get_global_id(0)] = v;
+ }
+}