[Piglit] [PATCH 3/3] cl: Add test for get_local_size()

Aaron Watry awatry at gmail.com
Mon Apr 15 09:35:23 PDT 2013


For the series:
Reviewed-By: Aaron Watry <awatry at gmail.com>


On Mon, Apr 15, 2013 at 10:22 AM, Tom Stellard <tom at stellard.net> wrote:

> From: Tom Stellard <thomas.stellard at amd.com>
>
> ---
>  tests/cl/program/execute/get-local-size.cl | 44
> ++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 tests/cl/program/execute/get-local-size.cl
>
> diff --git a/tests/cl/program/execute/get-local-size.clb/tests/cl/program/execute/
> get-local-size.cl
> new file mode 100644
> index 0000000..ea09856
> --- /dev/null
> +++ b/tests/cl/program/execute/get-local-size.cl
> @@ -0,0 +1,44 @@
> +/*!
> +[config]
> +
> +[test]
> +name: 1D 4 (2)
> +dimensions: 1
> +global_size: 4 0 0
> +local_size: 2 0 0
> +kernel_name: local_size_1d
> +arg_out: 0 buffer int[4] repeat 2
> +
> +[test]
> +name: 2D 4 x 4 (2 x 1)
> +dimensions: 2
> +global_size: 4 4 0
> +local_size: 2 1 0
> +kernel_name: local_size_2d
> +arg_out: 0 buffer int[16] repeat 0x21
> +
> +[test]
> +name: 3D 8 x 4 x 2 (4 x 2 x 1)
> +dimensions: 3
> +global_size: 8 4 2
> +local_size:  4 2 1
> +kernel_name: local_size_3d
> +arg_out: 0 buffer int[64] repeat 0x421
> +
> +!*/
> +
> +kernel void local_size_1d(global int *out) {
> +       out[get_global_id(0)] = get_local_size(0);
> +}
> +
> +kernel void local_size_2d(global int *out) {
> +       out[get_global_id(0) + get_global_id(1) * get_global_size(0)] =
> +                               (get_local_size(0) << 4) |
> get_local_size(1);
> +}
>

F


> +
> +kernel void local_size_3d(global int *out) {
> +       out[get_global_id(0) + (get_global_id(1) * get_global_size(0)) +
> +           (get_global_id(2) * get_global_size(0) * get_global_size(1))] =
> +
> +       (get_local_size(0) << 8) | (get_local_size(1) << 4) |
> get_local_size(2);
> +}
> --
> 1.7.11.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130415/74af8113/attachment.html>


More information about the Piglit mailing list