From: Tom Stellard <[email protected]> --- tests/all_cl.tests | 2 + .../cl/program/execute/gegl-gamma-2-2-to-linear.cl | 54 ++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/cl/program/execute/gegl-gamma-2-2-to-linear.cl
diff --git a/tests/all_cl.tests b/tests/all_cl.tests index a5e7091..b886d48 100644 --- a/tests/all_cl.tests +++ b/tests/all_cl.tests @@ -112,6 +112,7 @@ add_plain_program_tester_test(program_execute, 'Scalar arithmetic ushort', 'exec add_plain_program_tester_test(program_execute, 'Vector arithmetic int4', 'execute/vector-arithmetic-int4.program_test') add_plain_program_tester_test(program_execute, 'Vector arithmetic float4', 'execute/vector-arithmetic-float4.program_test') add_plain_program_tester_test(program_execute, 'Vector load int4', 'execute/vector-load-int4.cl') +add_plain_program_tester_test(program_execute, 'Vector store float4', 'execute/vector-store-float4.cl') add_plain_program_tester_test(program_execute, 'Scalar bitwise op int', 'execute/scalar-bitwise-int.cl') add_plain_program_tester_test(program_execute, 'Scalar comparison char', 'execute/scalar-comparison-char.cl') add_plain_program_tester_test(program_execute, 'Scalar comparison float', 'execute/scalar-comparison-float.cl') @@ -131,3 +132,4 @@ add_plain_program_tester_test(program_execute, 'Comma operator', 'execute/comma. add_plain_program_tester_test(program_execute, 'Reference and dereference operators', 'execute/reference.cl') add_plain_program_tester_test(program_execute, 'get_global_id', 'execute/get-global-id.cl') add_plain_program_tester_test(program_execute, 'For loop', 'execute/for-loop.cl') +add_plain_program_tester_test(program_execute, 'GEGL gamma-2-2-to-linear', 'execute/gegl-gamma-2-2-to-linear.cl') diff --git a/tests/cl/program/execute/gegl-gamma-2-2-to-linear.cl b/tests/cl/program/execute/gegl-gamma-2-2-to-linear.cl new file mode 100644 index 0000000..9cd449e --- /dev/null +++ b/tests/cl/program/execute/gegl-gamma-2-2-to-linear.cl @@ -0,0 +1,54 @@ +/* The OpenCL kernel comes from GEGL (www.gegl.org) + * File: gegl/opencl/gegl-cl-color-kernel.h + * + * 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 2012 Victor Oliveira ([email protected]) + */ + + +/*! +[config] +name: GEGL gamma_2_2_to_linear +clc_version_min: 10 +kernel_name: gamma_2_2_to_linear + +[test] +name: Input = 0.3928 +arg_in: 1 float 0.03928 +arg_out: 0 buffer float[1] 0.00304 tolerance 0.00001 + +[test] +name: Input = 1.0 +arg_in: 1 float 1.0 +arg_out: 0 buffer float[1] 1.0 + +[test] +name: Input = -12.92 +arg_in: 1 float -12.92 +arg_out: 0 buffer float[1] -1.0 + +[test] +name: Input = 0.5 +arg_in: 1 float 0.5 +arg_out: 0 buffer float[1] 0.214041 tolerance 0.00001 +!*/ + +kernel void gamma_2_2_to_linear (global float *out, float value) +{ + if (value > 0.03928f) + out[0] = native_powr ((value + 0.055f) / 1.055f, 2.4f); + else + out[0] = value / 12.92f; +} -- 1.7.11.4 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
