diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-09-19 15:30:45 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-10-15 20:53:37 +0000 |
commit | 020195745186fe1424e5aac6dd2104472cff091b (patch) | |
tree | 8f6d44c0714ee0c8614127bd899606600c58f401 /tests/cl/program/execute/gegl-fir-get-mean-component-1D-CL.cl | |
parent | 82efeb5f3015d9b837fa1d95f2605bdefd8c2d1e (diff) |
cl: Add gegl fir-get-mean-component-1D-CL.cl
Reviewed-by: Blaž Tomažič <blaz.tomazic@gmail.com>
Diffstat (limited to 'tests/cl/program/execute/gegl-fir-get-mean-component-1D-CL.cl')
-rw-r--r-- | tests/cl/program/execute/gegl-fir-get-mean-component-1D-CL.cl | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/cl/program/execute/gegl-fir-get-mean-component-1D-CL.cl b/tests/cl/program/execute/gegl-fir-get-mean-component-1D-CL.cl new file mode 100644 index 000000000..419819375 --- /dev/null +++ b/tests/cl/program/execute/gegl-fir-get-mean-component-1D-CL.cl @@ -0,0 +1,58 @@ +/* The OpenCL kernel comes from GEGL (www.gegl.org) + * File: gegl/operations/common/gaussian-blur.c + * + * This file is an image processing operation for GEGL + * GEGL is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * GEGL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GEGL; if not, see <http://www.gnu.org/licenses/>. + * + * Copyright 2006 Dominik Ernst <dernst@gmx.de> + * + * Recursive Gauss IIR Filter as described by Young / van Vliet + * in "Signal Processing 44 (1995) 139 - 151" + * + */ + + +/*! +[config] +name: GEGL fir_get_mean_component_1D_CL +clc_version_min: 10 +kernel_name: fir_get_mean_component_1D_CL + +[test] +arg_in: 1 buffer float4[5] repeat 1.0 +arg_in: 2 int 0 #offset +arg_in: 3 int 1 #delta_offset +arg_in: 4 buffer float[5] 0.1 0.2 0.3 0.4 0.5 +arg_in: 5 int 5 #matrix_legnth + +arg_out: 0 buffer float4[1] repeat 1.5 +!*/ + +kernel void fir_get_mean_component_1D_CL(global float4 *out, + const global float4 *buf, + int offset, + const int delta_offset, + constant float *cmatrix, + const int matrix_length) +{ + float4 acc = 0.0f; + int i; + + for(i=0; i<matrix_length; i++) + { + acc += buf[offset] * cmatrix[i]; + offset += delta_offset; + } + out[0] = acc; +} |