[1/2] get-kernel-work-group-info: Check value of CL_KERNEL_COMPILE_WORK_GROUP_SIZE

Submitted by Tom Stellard on March 24, 2015, 3:25 p.m.

Details

Message ID 1427210748-26907-2-git-send-email-thomas.stellard@amd.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Tom Stellard March 24, 2015, 3:25 p.m.
Verify it returns {0,0,0} when the reqd_work_group_size attribute is
not specified.
---
 tests/cl/api/get-kernel-work-group-info.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/cl/api/get-kernel-work-group-info.c b/tests/cl/api/get-kernel-work-group-info.c
index a38cdf0..2e12e0d 100644
--- a/tests/cl/api/get-kernel-work-group-info.c
+++ b/tests/cl/api/get-kernel-work-group-info.c
@@ -115,6 +115,31 @@  piglit_cl_test(const int argc,
 			piglit_merge_result(&result, PIGLIT_FAIL);
 		}
 
+		/* Checks for specific queries */
+		switch (kernel_work_group_infos[i]) {
+		case CL_KERNEL_COMPILE_WORK_GROUP_SIZE: {
+			size_t zero[3] = {0, 0, 0};
+			unsigned expected_size = 3 * sizeof(size_t);
+			if (param_value_size != expected_size) {
+				fprintf(stderr, "Error: "
+						"Invalid param_value_size "
+						"Expected %u, got %u\n",
+						expected_size,
+						(unsigned)param_value_size);
+				piglit_merge_result(&result, PIGLIT_FAIL);
+			}
+			if (memcmp(param_value, &zero, expected_size)) {
+				fprintf(stderr, "Error: expected {0,0,0} "
+						"when attribute "
+						"reqd_work_group_size is "
+						"unspecified.");
+				piglit_merge_result(&result, PIGLIT_FAIL);
+			}
+			break;
+		}
+		default: break;
+		}
+
 		//TODO: output returned values
 		printf("\n");
 		free(param_value);

Comments

On Tue, 2015-03-24 at 15:25 +0000, Tom Stellard wrote:
> Verify it returns {0,0,0} when the reqd_work_group_size attribute is
> not specified.
> ---
>  tests/cl/api/get-kernel-work-group-info.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/tests/cl/api/get-kernel-work-group-info.c b/tests/cl/api/get-kernel-work-group-info.c
> index a38cdf0..2e12e0d 100644
> --- a/tests/cl/api/get-kernel-work-group-info.c
> +++ b/tests/cl/api/get-kernel-work-group-info.c
> @@ -115,6 +115,31 @@ piglit_cl_test(const int argc,
>  			piglit_merge_result(&result, PIGLIT_FAIL);
>  		}
>  
> +		/* Checks for specific queries */
> +		switch (kernel_work_group_infos[i]) {
> +		case CL_KERNEL_COMPILE_WORK_GROUP_SIZE: {
> +			size_t zero[3] = {0, 0, 0};
> +			unsigned expected_size = 3 * sizeof(size_t);
> +			if (param_value_size != expected_size) {
> +				fprintf(stderr, "Error: "
> +						"Invalid param_value_size "
> +						"Expected %u, got %u\n",
> +						expected_size,
> +						(unsigned)param_value_size);
> +				piglit_merge_result(&result, PIGLIT_FAIL);
> +			}
> +			if (memcmp(param_value, &zero, expected_size)) {
> +				fprintf(stderr, "Error: expected {0,0,0} "
> +						"when attribute "
> +						"reqd_work_group_size is "
> +						"unspecified.");
> +				piglit_merge_result(&result, PIGLIT_FAIL);
> +			}
> +			break;
> +		}
> +		default: break;
> +		}
> +
>  		//TODO: output returned values
>  		printf("\n");
>  		free(param_value);

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>