[Piglit] [PATCH] Replace scalar-load-[float|uchar] with more comprehensive tests.
Tom Stellard
tom at stellard.net
Tue Dec 4 17:31:48 PST 2012
On Mon, Dec 03, 2012 at 07:57:26PM -0600, Aaron Watry wrote:
> Move the kernel declarations into an include file and then create separate
> program_test files for char/uchar/short/ushort/int/uint/long/ulong/float.
>
> I'm not quite sure how to use #pragmas in a program_test configuration, so for
> now I'm leaving out half/double data types.
#pragmas usually go in the source file right? Could you do something like:
#pragma PRAGMA_DEF and then add -DPRAGMA_DEF to the build flags.
This patch looks good and should really help increase the coverage.
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> ---
> .../program/execute/scalar-load-char.program_test | 27 +++++++++++++++
> tests/cl/program/execute/scalar-load-float.cl | 34 -------------------
> .../program/execute/scalar-load-float.program_test | 27 +++++++++++++++
> .../program/execute/scalar-load-int.program_test | 27 +++++++++++++++
> .../program/execute/scalar-load-long.program_test | 27 +++++++++++++++
> .../program/execute/scalar-load-short.program_test | 27 +++++++++++++++
> tests/cl/program/execute/scalar-load-uchar.cl | 35 --------------------
> .../program/execute/scalar-load-uchar.program_test | 27 +++++++++++++++
> .../program/execute/scalar-load-uint.program_test | 27 +++++++++++++++
> .../program/execute/scalar-load-ulong.program_test | 27 +++++++++++++++
> .../execute/scalar-load-ushort.program_test | 27 +++++++++++++++
> tests/cl/program/execute/scalar-load.inc | 14 ++++++++
> 12 files changed, 257 insertions(+), 69 deletions(-)
> create mode 100644 tests/cl/program/execute/scalar-load-char.program_test
> delete mode 100644 tests/cl/program/execute/scalar-load-float.cl
> create mode 100644 tests/cl/program/execute/scalar-load-float.program_test
> create mode 100644 tests/cl/program/execute/scalar-load-int.program_test
> create mode 100644 tests/cl/program/execute/scalar-load-long.program_test
> create mode 100644 tests/cl/program/execute/scalar-load-short.program_test
> delete mode 100644 tests/cl/program/execute/scalar-load-uchar.cl
> create mode 100644 tests/cl/program/execute/scalar-load-uchar.program_test
> create mode 100644 tests/cl/program/execute/scalar-load-uint.program_test
> create mode 100644 tests/cl/program/execute/scalar-load-ulong.program_test
> create mode 100644 tests/cl/program/execute/scalar-load-ushort.program_test
> create mode 100644 tests/cl/program/execute/scalar-load.inc
>
> diff --git a/tests/cl/program/execute/scalar-load-char.program_test b/tests/cl/program/execute/scalar-load-char.program_test
> new file mode 100644
> index 0000000..a168875
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-char.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (char)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=char -D OUT_TYPE=int
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer int[1] -5
> +arg_in: 1 buffer char[1] -5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer int[1] -6
> +arg_in: 1 char -6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer int[1] -7
> +arg_in: 1 buffer char[1] -7
> +
> diff --git a/tests/cl/program/execute/scalar-load-float.cl b/tests/cl/program/execute/scalar-load-float.cl
> deleted file mode 100644
> index 0df9862..0000000
> --- a/tests/cl/program/execute/scalar-load-float.cl
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -/*!
> -[config]
> -name: Scalar load float
> -
> -[test]
> -kernel_name: load_global
> -name: global address space
> -arg_out: 0 buffer float[1] 3.5
> -arg_in: 1 buffer float[1] 3.5
> -
> -[test]
> -kernel_name: load_param
> -name: parameter address space
> -arg_out: 0 buffer float[1] 3.6
> -arg_in: 1 float 3.6
> -
> -[test]
> -kernel_name: load_constant
> -name: constant address space
> -arg_out: 0 buffer float[1] 3.7
> -arg_in: 1 buffer float[1] 3.7
> -!*/
> -
> -kernel void load_global(global float *out, global float *in) {
> - out[0] = in[0];
> -}
> -
> -kernel void load_param(global float *out, float in) {
> - out[0] = in;
> -}
> -
> -kernel void load_constant(global float *out, constant float *in) {
> - out[0] = in[0];
> -}
> diff --git a/tests/cl/program/execute/scalar-load-float.program_test b/tests/cl/program/execute/scalar-load-float.program_test
> new file mode 100644
> index 0000000..3e45847
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-float.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (float)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=float -D OUT_TYPE=float
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +kernel_name: load_global
> +name: global address space
> +arg_out: 0 buffer float[1] 3.5
> +arg_in: 1 buffer float[1] 3.5
> +
> +[test]
> +kernel_name: load_param
> +name: parameter address space
> +arg_out: 0 buffer float[1] 3.6
> +arg_in: 1 float 3.6
> +
> +[test]
> +kernel_name: load_constant
> +name: constant address space
> +arg_out: 0 buffer float[1] 3.7
> +arg_in: 1 buffer float[1] 3.7
> +
> diff --git a/tests/cl/program/execute/scalar-load-int.program_test b/tests/cl/program/execute/scalar-load-int.program_test
> new file mode 100644
> index 0000000..655e60f
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-int.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (int)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=int -D OUT_TYPE=int
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer int[1] -5
> +arg_in: 1 buffer int[1] -5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer int[1] -6
> +arg_in: 1 int -6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer int[1] -7
> +arg_in: 1 buffer int[1] -7
> +
> diff --git a/tests/cl/program/execute/scalar-load-long.program_test b/tests/cl/program/execute/scalar-load-long.program_test
> new file mode 100644
> index 0000000..d8c95fc
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-long.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (long)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=long -D OUT_TYPE=long
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer long[1] -5
> +arg_in: 1 buffer long[1] -5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer long[1] -6
> +arg_in: 1 long -6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer long[1] -7
> +arg_in: 1 buffer long[1] -7
> +
> diff --git a/tests/cl/program/execute/scalar-load-short.program_test b/tests/cl/program/execute/scalar-load-short.program_test
> new file mode 100644
> index 0000000..e1d52ea
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-short.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (short)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=short -D OUT_TYPE=int
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer int[1] -5
> +arg_in: 1 buffer short[1] -5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer int[1] -6
> +arg_in: 1 short -6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer int[1] -7
> +arg_in: 1 buffer short[1] -7
> +
> diff --git a/tests/cl/program/execute/scalar-load-uchar.cl b/tests/cl/program/execute/scalar-load-uchar.cl
> deleted file mode 100644
> index 3faa285..0000000
> --- a/tests/cl/program/execute/scalar-load-uchar.cl
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*!
> -[config]
> -name: Scalar load uchar
> -
> -[test]
> -name: global address space
> -kernel_name: uchar_load_global
> -arg_out: 0 buffer uint[1] 5
> -arg_in: 1 buffer uchar[1] 5
> -
> -[test]
> -name: parameter address space
> -kernel_name: uchar_load_param
> -arg_out: 0 buffer uint[1] 6
> -arg_in: 1 uchar 6
> -
> -[test]
> -name: constant address space
> -kernel_name: uchar_load_constant
> -arg_out: 0 buffer uint[1] 7
> -arg_in: 1 buffer uchar[1] 7
> -
> -!*/
> -
> -kernel void uchar_load_global(global uint *out, global uchar *in) {
> - out[0] = in[0];
> -}
> -
> -kernel void uchar_load_param(global uint *out, uchar in) {
> - out[0] = in;
> -}
> -
> -kernel void uchar_load_constant(global uint *out, constant uchar *in) {
> - out[0] = in[0];
> -}
> diff --git a/tests/cl/program/execute/scalar-load-uchar.program_test b/tests/cl/program/execute/scalar-load-uchar.program_test
> new file mode 100644
> index 0000000..798bd53
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-uchar.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (uchar)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=uchar -D OUT_TYPE=uint
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer uint[1] 5
> +arg_in: 1 buffer uchar[1] 5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer uint[1] 6
> +arg_in: 1 uchar 6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer uint[1] 7
> +arg_in: 1 buffer uchar[1] 7
> +
> diff --git a/tests/cl/program/execute/scalar-load-uint.program_test b/tests/cl/program/execute/scalar-load-uint.program_test
> new file mode 100644
> index 0000000..94b5993
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-uint.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (uint)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=uint -D OUT_TYPE=uint
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer uint[1] 5
> +arg_in: 1 buffer uint[1] 5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer uint[1] 6
> +arg_in: 1 uint 6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer uint[1] 7
> +arg_in: 1 buffer uint[1] 7
> +
> diff --git a/tests/cl/program/execute/scalar-load-ulong.program_test b/tests/cl/program/execute/scalar-load-ulong.program_test
> new file mode 100644
> index 0000000..cbad644
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-ulong.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (ulong)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=ulong -D OUT_TYPE=ulong
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer ulong[1] 5
> +arg_in: 1 buffer ulong[1] 5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer ulong[1] 6
> +arg_in: 1 ulong 6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer ulong[1] 7
> +arg_in: 1 buffer ulong[1] 7
> +
> diff --git a/tests/cl/program/execute/scalar-load-ushort.program_test b/tests/cl/program/execute/scalar-load-ushort.program_test
> new file mode 100644
> index 0000000..a929ed4
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load-ushort.program_test
> @@ -0,0 +1,27 @@
> +[config]
> +name: Scalar Data Type Load (ushort)
> +
> +program_source_file: scalar-load.inc
> +build_options: -D SCALAR_TYPE=ushort -D OUT_TYPE=uint
> +
> +dimensions: 1
> +global_size: 1 0 0
> +
> +[test]
> +name: global address space
> +kernel_name: load_global
> +arg_out: 0 buffer uint[1] 5
> +arg_in: 1 buffer ushort[1] 5
> +
> +[test]
> +name: parameter address space
> +kernel_name: load_param
> +arg_out: 0 buffer uint[1] 6
> +arg_in: 1 ushort 6
> +
> +[test]
> +name: constant address space
> +kernel_name: load_constant
> +arg_out: 0 buffer uint[1] 7
> +arg_in: 1 buffer ushort[1] 7
> +
> diff --git a/tests/cl/program/execute/scalar-load.inc b/tests/cl/program/execute/scalar-load.inc
> new file mode 100644
> index 0000000..5458847
> --- /dev/null
> +++ b/tests/cl/program/execute/scalar-load.inc
> @@ -0,0 +1,14 @@
> +typedef OUT_TYPE out_t;
> +typedef SCALAR_TYPE scalar_t;
> +
> +kernel void load_global(global out_t *out, global scalar_t *in) {
> + out[0] = in[0];
> +}
> +
> +kernel void load_param(global out_t *out, scalar_t in) {
> + out[0] = in;
> +}
> +
> +kernel void load_constant(global out_t *out, constant scalar_t *in) {
> + out[0] = in[0];
> +}
> --
> 1.7.10.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list