[Piglit] [PATCH 1/1] cl: OCL1.1 allows pointers to NULL as valid kernel args

Jan Vesely jan.vesely at rutgers.edu
Tue Feb 28 01:44:59 UTC 2017


On Wed, 2017-02-22 at 11:27 -0500, Jan Vesely wrote:
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
>  tests/cl/api/set-kernel-arg.c | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/cl/api/set-kernel-arg.c b/tests/cl/api/set-kernel-arg.c
> index d306931..8679ccb 100644
> --- a/tests/cl/api/set-kernel-arg.c
> +++ b/tests/cl/api/set-kernel-arg.c
> @@ -219,16 +219,19 @@ piglit_cl_test(const int argc,
>  	/*
>  	 * CL_INVALID_MEM_OBJECT for an argument declared to be a memory object when
>  	 * the specified arg_value is not a valid memory object.
> +	 * OpenCL 1.1+ allows pointer to NULL to act as NULL argument.
>  	 */
> -	test_str = "Trigger CL_INVALID_MEM_OBJECT for an argument declared to be a memory object when the specified arg_value is not a valid memory object.";
> -	errNo = clSetKernelArg(kernel, 0, sizeof(cl_mem), &invalid_buffer);
> -	if(   errNo != CL_INVALID_MEM_OBJECT
> -	   && errNo != CL_INVALID_ARG_VALUE) { // two possible values
> -		piglit_cl_check_error(errNo, CL_INVALID_MEM_OBJECT);
> -		fprintf(stderr,
> -		        "Failed (error code: %s): %s\n",
> -		        piglit_cl_get_error_name(errNo), test_str);
> -		piglit_merge_result(&input_check_result, PIGLIT_FAIL);
> +	if (env->version == 100) {
> +		test_str = "Trigger CL_INVALID_MEM_OBJECT for an argument declared to be a memory object when the specified arg_value is not a valid memory object.";
> +		errNo = clSetKernelArg(kernel, 0, sizeof(cl_mem), &invalid_buffer);
> +		if(   errNo != CL_INVALID_MEM_OBJECT
> +		   && errNo != CL_INVALID_ARG_VALUE) { // two possible values
> +			piglit_cl_check_error(errNo, CL_INVALID_MEM_OBJECT);
> +			fprintf(stderr,
> +			        "Failed (error code: %s): %s\n",
> +			        piglit_cl_get_error_name(errNo), test_str);
> +			piglit_merge_result(&input_check_result, PIGLIT_FAIL);
> +		}
>  	}
>  
>  	/*
ping
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170227/8387f74c/attachment.sig>


More information about the Piglit mailing list