Re: [Piglit] Ideas for Wine Test Suite and Mesa Workflow

2016-02-24 Thread Zhenbo Li
2016-02-21 21:38 GMT+08:00 Zhenbo Li :
>
> I think I can write a functional python script, and submit it to wine.
> In mesa, it needs to do
> little(more simple than piglit/tests/igt.py). I'm writing a proof of
> concept test(piglit/tests/wine)
> now, and I'm going to send it to this mail list few days later.

Hello,

It costs me some time to read previous code. I've finished my
proof-of-concept work[1]. As we mentioned before, we can add an
interpreter for test results in wine, and call it from piglit via a
simple script.

[1]: 
https://github.com/Endle/piglit-gsoc/commit/49ab297e9f0e5284b949f54b401c0da609c82d69
https://github.com/Endle/wine-gsoc/commit/e278a23b23db3b398231f8cc17877c4513d6fed9

-- 
Have a nice day!
Zhenbo Li
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] cl: clSetKernelArg check for image support

2016-02-24 Thread Serge Martin
---
 tests/cl/api/set-kernel-arg.c | 51 +++
 1 file changed, 37 insertions(+), 14 deletions(-)

diff --git a/tests/cl/api/set-kernel-arg.c b/tests/cl/api/set-kernel-arg.c
index 6bd7ec8..4e44fc0 100644
--- a/tests/cl/api/set-kernel-arg.c
+++ b/tests/cl/api/set-kernel-arg.c
@@ -51,6 +51,21 @@ PIGLIT_CL_API_TEST_CONFIG_BEGIN
 
 PIGLIT_CL_API_TEST_CONFIG_END
 
+static bool
+get_device_image_support(cl_device_id device)
+{
+   cl_bool *has_image =
+   piglit_cl_get_device_info(device, CL_DEVICE_IMAGE_SUPPORT);
+
+   if (!*has_image) {
+   fprintf(stdout, "No image support. Sampler arg won't be 
tested\n");
+   free(has_image);
+   return false;
+   }
+
+   free(has_image);
+   return true;
+}
 
 static bool
 test (cl_kernel kernel,
@@ -88,10 +103,13 @@ piglit_cl_test(const int argc,
cl_mem buffer;
cl_float float_num = 1.1;
cl_int int_num = 1;
-   cl_sampler sampler;
+   cl_sampler sampler = NULL;
 
cl_mem invalid_buffer;
 
+   cl_bool image_support =
+   get_device_image_support(env->context->device_ids[0]);
+
/*** Normal usage ***/
kernel = clCreateKernel(env->program, "kernel_fun", );
if(!piglit_cl_check_error(errNo, CL_SUCCESS)) {
@@ -113,16 +131,18 @@ piglit_cl_test(const int argc,
return PIGLIT_FAIL;
}
 
-   sampler = clCreateSampler(env->context->cl_ctx,
- CL_TRUE,
- CL_ADDRESS_NONE,
- CL_FILTER_NEAREST,
- );
-   if(!piglit_cl_check_error(errNo, CL_SUCCESS)) {
-   fprintf(stderr,
-   "Failed (error code: %s): Create sampler.\n",
-   piglit_cl_get_error_name(errNo));
-   return PIGLIT_FAIL;
+   if (image_support) {
+   sampler = clCreateSampler(env->context->cl_ctx,
+ CL_TRUE,
+ CL_ADDRESS_NONE,
+ CL_FILTER_NEAREST,
+ );
+   if(!piglit_cl_check_error(errNo, CL_SUCCESS)) {
+   fprintf(stderr,
+   "Failed (error code: %s): Create sampler.\n",
+   piglit_cl_get_error_name(errNo));
+   return PIGLIT_FAIL;
+   }
}
 
test(kernel, 0, sizeof(cl_mem), ,
@@ -134,9 +154,12 @@ piglit_cl_test(const int argc,
test(kernel, 2, sizeof(cl_int), NULL,
 CL_SUCCESS, ,
 "Set kernel argument for array");
-   test(kernel, 3, sizeof(cl_sampler), ,
-CL_SUCCESS, ,
-"Set kernel argument for sampler");
+
+   if (image_support) {
+   test(kernel, 3, sizeof(cl_sampler), ,
+CL_SUCCESS, ,
+"Set kernel argument for sampler");
+   }

/*
 * Next line is also valid.
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] cl: clSetKernelArg test more args kind

2016-02-24 Thread Serge Martin
---
 tests/cl/api/set-kernel-arg.c | 30 +++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/tests/cl/api/set-kernel-arg.c b/tests/cl/api/set-kernel-arg.c
index 4e44fc0..471fea1 100644
--- a/tests/cl/api/set-kernel-arg.c
+++ b/tests/cl/api/set-kernel-arg.c
@@ -44,10 +44,18 @@ PIGLIT_CL_API_TEST_CONFIG_BEGIN
config.create_context = true;
 
config.program_source =
+   "typedef struct struct_arg {\n"
+   "   int   m1;\n"
+   "   int4  m2;\n"
+   "   float m3;\n"
+   "} struct_arg_t;\n"
+   "\n"
"kernel void kernel_fun(__global int* arr, \
float float_num,   \
__local int* int_ptr,  \
-   sampler_t sampler) {}";
+   sampler_t sampler, \
+   int3 vec3, \
+   struct_arg_t s_arg) {}";
 
 PIGLIT_CL_API_TEST_CONFIG_END
 
@@ -95,6 +103,12 @@ piglit_cl_test(const int argc,
const struct piglit_cl_api_test_config* config,
const struct piglit_cl_api_test_env* env)
 {
+   typedef struct struct_arg {
+   cl_int   m1;
+   cl_int4  m2;
+   cl_float m3;
+   } struct_arg_t;
+
enum piglit_result result = PIGLIT_PASS;
 
cl_int errNo;
@@ -104,6 +118,8 @@ piglit_cl_test(const int argc,
cl_float float_num = 1.1;
cl_int int_num = 1;
cl_sampler sampler = NULL;
+   cl_int3 vec3;
+   struct_arg_t s_arg;
 
cl_mem invalid_buffer;
 
@@ -160,7 +176,15 @@ piglit_cl_test(const int argc,
 CL_SUCCESS, ,
 "Set kernel argument for sampler");
}
-   
+
+   test(kernel, 4, sizeof(cl_int3), ,
+CL_SUCCESS, ,
+"Set kernel argument for cl_int3");
+
+   test(kernel, 5, sizeof(struct_arg_t), _arg,
+CL_SUCCESS, ,
+"Set kernel argument for struct");
+
/*
 * Next line is also valid.
 *
@@ -183,7 +207,7 @@ piglit_cl_test(const int argc,
/*
 * CL_INVALID_ARG_INDEX if arg_index is not a valid argument index.
 */
-   test(kernel, 4, sizeof(cl_float), _num,
+   test(kernel, 11, sizeof(cl_float), _num,
 CL_INVALID_ARG_INDEX, ,
 "Trigger CL_INVALID_ARG_INDEX if arg_index is not a valid argument 
index");
 
-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 0/2] cl: more clSetKernelArg checks

2016-02-24 Thread Serge Martin
This serie is intended to add test case for GROMACS error when passing a struct
arg by value (currently a failure on Clover).
It also add a check for cl_int3 that are of the same size as cl_int4.

Serge Martin (2):
  cl: clSetKernelArg check for image support
  cl: clSetKernelArg test more args kind

 tests/cl/api/set-kernel-arg.c | 79 ++-
 1 file changed, 63 insertions(+), 16 deletions(-)

-- 
2.5.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit