[Piglit] [PATCH] cl: fix CL_KERNEL_GLOBAL_WORK_SIZE query
Tom Stellard
tom at stellard.net
Tue Jul 7 15:05:32 PDT 2015
On Sun, Jun 14, 2015 at 05:02:26PM +0200, EdB wrote:
> this query is only valid for a custom device or a build-in kernel
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> ---
> tests/cl/api/get-kernel-work-group-info.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/tests/cl/api/get-kernel-work-group-info.c b/tests/cl/api/get-kernel-work-group-info.c
> index a38cdf0..1334168 100644
> --- a/tests/cl/api/get-kernel-work-group-info.c
> +++ b/tests/cl/api/get-kernel-work-group-info.c
> @@ -83,6 +83,20 @@ piglit_cl_test(const int argc,
>
> /*** Normal usage ***/
> for(i = 0; i < num_kernel_work_group_infos; i++) {
> + cl_int success_code = CL_SUCCESS;
> +
> +#if defined(CL_VERSION_1_2)
> + /* CL_KERNEL_GLOBAL_WORK_SIZE query
> + * is valid for custom device or build-in kernel
> + */
> + if (kernel_work_group_infos[i] == CL_KERNEL_GLOBAL_WORK_SIZE) {
> + cl_device_type* dev_type_ptr =
> + piglit_cl_get_device_info(env->device_id, CL_DEVICE_TYPE);
> + if (*dev_type_ptr != CL_DEVICE_TYPE_CUSTOM)
> + success_code = CL_INVALID_VALUE;
> + }
> +#endif
> +
> printf("%s ", piglit_cl_get_enum_name(kernel_work_group_infos[i]));
>
> errNo = clGetKernelWorkGroupInfo(kernel,
> @@ -91,7 +105,7 @@ piglit_cl_test(const int argc,
> 0,
> NULL,
> ¶m_value_size);
> - if(!piglit_cl_check_error(errNo, CL_SUCCESS)) {
> + if(!piglit_cl_check_error(errNo, success_code)) {
> fprintf(stderr,
> "Failed (error code: %s): Get size of %s.\n",
> piglit_cl_get_error_name(errNo),
> @@ -107,7 +121,7 @@ piglit_cl_test(const int argc,
> param_value_size,
> param_value,
> NULL);
> - if(!piglit_cl_check_error(errNo, CL_SUCCESS)) {
> + if(!piglit_cl_check_error(errNo, success_code)) {
> fprintf(stderr,
> "Failed (error code: %s): Get value of %s.\n",
> piglit_cl_get_error_name(errNo),
> --
> 2.4.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list