Re: [Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
On Mon, Aug 28, 2017 at 3:23 PM, Jan Veselywrote: > On Mon, 2017-08-28 at 15:15 -0700, Vinson Lee wrote: >> On Wed, Jul 19, 2017 at 3:51 PM, Jan Vesely wrote: >> > v2: Fix warning in cl-api-get-mem-object-info >> > v3: Filter permissible queue properties combinations >> > Use and test clCreateCommandQueueWithProperties on OCL 2.0 >> > >> > Signed-off-by: Jan Vesely >> > --- >> > >> > I see few regressions with this patch on beignet(SKL) in generated >> > clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test >> > fixes the regression so I believe it's beignet bug. >> > No regressions on clover Turks and beignet(IVB). >> > >> > Jan >> > >> >> This patch introduced this GCC warning. >> >> create-command-queue.c: In function ‘piglit_cl_test’: >> create-command-queue.c:159:12: warning: cast from pointer to integer >> of different size [-Wpointer-to-int-cast] >> (unsigned int)mixed_command_queue_properties); >> ^ > > thanks for noticing. the attached patch should fix the problem (and > correctly report failed property). > > Jan > Tested-by: Vinson Lee ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
On Mon, 2017-08-28 at 15:15 -0700, Vinson Lee wrote: > On Wed, Jul 19, 2017 at 3:51 PM, Jan Veselywrote: > > v2: Fix warning in cl-api-get-mem-object-info > > v3: Filter permissible queue properties combinations > > Use and test clCreateCommandQueueWithProperties on OCL 2.0 > > > > Signed-off-by: Jan Vesely > > --- > > > > I see few regressions with this patch on beignet(SKL) in generated > > clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test > > fixes the regression so I believe it's beignet bug. > > No regressions on clover Turks and beignet(IVB). > > > > Jan > > > > This patch introduced this GCC warning. > > create-command-queue.c: In function ‘piglit_cl_test’: > create-command-queue.c:159:12: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > (unsigned int)mixed_command_queue_properties); > ^ thanks for noticing. the attached patch should fix the problem (and correctly report failed property). Jan > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit From 9324f9da7dabf59fe983d7b7eb346cdc33b10d89 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Mon, 28 Aug 2017 18:20:26 -0400 Subject: [Piglit][PATCH 1/1] cl: Fix error message value. Fixes: f6d4e22d8b8eef1fbf5c7a234f520ae013a3e0d5 ("cl: Add support for OCL 2.0") Signed-off-by: Jan Vesely --- tests/cl/api/create-command-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cl/api/create-command-queue.c b/tests/cl/api/create-command-queue.c index 3ada5af90..e409d5261 100644 --- a/tests/cl/api/create-command-queue.c +++ b/tests/cl/api/create-command-queue.c @@ -156,7 +156,7 @@ piglit_cl_test(const int argc, fprintf(stderr, "Failed (error code: %s): Create command queue using 0x%X as command queue properties.\n", piglit_cl_get_error_name(errNo), - (unsigned int)mixed_command_queue_properties); + (unsigned int)mixed_command_queue_properties[1]); piglit_merge_result(, PIGLIT_FAIL); } clReleaseCommandQueue(command_queue); -- 2.13.5 signature.asc Description: This is a digitally signed message part ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
On Wed, Jul 19, 2017 at 3:51 PM, Jan Veselywrote: > v2: Fix warning in cl-api-get-mem-object-info > v3: Filter permissible queue properties combinations > Use and test clCreateCommandQueueWithProperties on OCL 2.0 > > Signed-off-by: Jan Vesely > --- > > I see few regressions with this patch on beignet(SKL) in generated > clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test > fixes the regression so I believe it's beignet bug. > No regressions on clover Turks and beignet(IVB). > > Jan > This patch introduced this GCC warning. create-command-queue.c: In function ‘piglit_cl_test’: create-command-queue.c:159:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (unsigned int)mixed_command_queue_properties); ^ ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
On Sun, Jul 30, 2017, 10:31 AM Jan Veselywrote: > On Thu, 2017-07-20 at 22:59 -0500, Aaron Watry wrote: > > Hey Jan, > > > > I've skimmed my way through this, and it's looking ok so far. I'll > > try to do a deeper dive over the changes needed for the 2.0 spec in > > the near future (I've been stuck in 1.1/1.2-land for too long). > > > > For now, you can have an: > > Acked-by: Aaron Watry > > thanks for taking a look. > > > > > I'll see if I can find some time tomorrow, or possibly this weekend to > > do a more detailed review. > > I plan to push this together with the sampler test fix early next week. > Let me know if you want me to postpone, the patch is not on critical > path. > Nah, don't feel like you need to postpone this. I'm not familiar enough with the 2.0 spec yet, so any additional review I gave for this would still be based on a limited understanding. > > regards, > Jan > > > > > --Aaron > > > > On Wed, Jul 19, 2017 at 5:51 PM, Jan Vesely > wrote: > > > v2: Fix warning in cl-api-get-mem-object-info > > > v3: Filter permissible queue properties combinations > > > Use and test clCreateCommandQueueWithProperties on OCL 2.0 > > > > > > Signed-off-by: Jan Vesely > > > --- > > > > > > I see few regressions with this patch on beignet(SKL) in generated > clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test > fixes the regression so I believe it's beignet bug. > > > No regressions on clover Turks and beignet(IVB). > > > > > > Jan > > > > > > tests/cl/api/create-command-queue.c | 37 +-- > > > tests/cl/api/get-mem-object-info.c | 8 > > > tests/util/piglit-util-cl-enum.c| 95 > +++-- > > > tests/util/piglit-util-cl-enum.h| 4 ++ > > > tests/util/piglit-util-cl.h | 4 +- > > > 5 files changed, 119 insertions(+), 29 deletions(-) > > > > > > diff --git a/tests/cl/api/create-command-queue.c > b/tests/cl/api/create-command-queue.c > > > index 0ffd1377c..3ada5af90 100644 > > > --- a/tests/cl/api/create-command-queue.c > > > +++ b/tests/cl/api/create-command-queue.c > > > @@ -52,7 +52,7 @@ get_mixed_command_queue_properties(int mask, > > > const cl_command_queue_properties > properties[]) { > > > int i = 0; > > > cl_command_queue_properties mixed_properties = 0; > > > - > > > + > > > while(mask > 0) { > > > if(mask%2 == 1) { > > > mixed_properties |= properties[i]; > > > @@ -64,6 +64,21 @@ get_mixed_command_queue_properties(int mask, > > > return mixed_properties; > > > } > > > > > > +static bool > > > +properties_forbidden(const cl_command_queue_properties properties, > > > + const struct piglit_cl_api_test_env* env) > > > +{ > > > + int num_command_queue_properties_mutexes = > > > + > PIGLIT_CL_ENUM_NUM(cl_command_queue_properties_mutexes, env->version); > > > + const cl_command_queue_properties* > command_queue_properties_mutexes = > > > + > PIGLIT_CL_ENUM_ARRAY(cl_command_queue_properties_mutexes); > > > + int i = 0; > > > + for (; i < num_command_queue_properties_mutexes; ++i) > > > + if (properties == command_queue_properties_mutexes[i]) > > > + return true; > > > + return false; > > > +} > > > + > > > enum piglit_result > > > piglit_cl_test(const int argc, > > > const char** argv, > > > @@ -79,7 +94,8 @@ piglit_cl_test(const int argc, > > > cl_command_queue command_queue; > > > cl_uint num_devices; > > > cl_device_id* devices; > > > - cl_command_queue_properties mixed_command_queue_properties; > > > + cl_command_queue_properties mixed_command_queue_properties[4] = > > > + {CL_QUEUE_PROPERTIES, 0, 0, 0}; > > > > > > cl_context_properties context_properties[] = { > > > CL_CONTEXT_PLATFORM, > (cl_context_properties)env->platform_id, > > > @@ -116,12 +132,25 @@ piglit_cl_test(const int argc, > > > * There are 2^(num_command_queue_properties)-1 possible > options. > > > */ > > > for(mask = 0; mask < (1 << num_command_queue_properties); > mask++) { > > > - mixed_command_queue_properties = > > > + mixed_command_queue_properties[1] = > > > get_mixed_command_queue_properties(mask, > command_queue_properties); > > > - command_queue = clCreateCommandQueue(cl_ctx, > > > + if > (properties_forbidden(mixed_command_queue_properties[1], env)) > > > + continue; > > > +#if defined CL_VERSION_2_0 > > > + if (env->version >= 20) { > > > + command_queue = > clCreateCommandQueueWithProperties( > > > +cl_ctx, > > >
Re: [Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
On Thu, 2017-07-20 at 22:59 -0500, Aaron Watry wrote: > Hey Jan, > > I've skimmed my way through this, and it's looking ok so far. I'll > try to do a deeper dive over the changes needed for the 2.0 spec in > the near future (I've been stuck in 1.1/1.2-land for too long). > > For now, you can have an: > Acked-by: Aaron Watrythanks for taking a look. > > I'll see if I can find some time tomorrow, or possibly this weekend to > do a more detailed review. I plan to push this together with the sampler test fix early next week. Let me know if you want me to postpone, the patch is not on critical path. regards, Jan > > --Aaron > > On Wed, Jul 19, 2017 at 5:51 PM, Jan Vesely wrote: > > v2: Fix warning in cl-api-get-mem-object-info > > v3: Filter permissible queue properties combinations > > Use and test clCreateCommandQueueWithProperties on OCL 2.0 > > > > Signed-off-by: Jan Vesely > > --- > > > > I see few regressions with this patch on beignet(SKL) in generated > > clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test > > fixes the regression so I believe it's beignet bug. > > No regressions on clover Turks and beignet(IVB). > > > > Jan > > > > tests/cl/api/create-command-queue.c | 37 +-- > > tests/cl/api/get-mem-object-info.c | 8 > > tests/util/piglit-util-cl-enum.c| 95 > > +++-- > > tests/util/piglit-util-cl-enum.h| 4 ++ > > tests/util/piglit-util-cl.h | 4 +- > > 5 files changed, 119 insertions(+), 29 deletions(-) > > > > diff --git a/tests/cl/api/create-command-queue.c > > b/tests/cl/api/create-command-queue.c > > index 0ffd1377c..3ada5af90 100644 > > --- a/tests/cl/api/create-command-queue.c > > +++ b/tests/cl/api/create-command-queue.c > > @@ -52,7 +52,7 @@ get_mixed_command_queue_properties(int mask, > > const cl_command_queue_properties > > properties[]) { > > int i = 0; > > cl_command_queue_properties mixed_properties = 0; > > - > > + > > while(mask > 0) { > > if(mask%2 == 1) { > > mixed_properties |= properties[i]; > > @@ -64,6 +64,21 @@ get_mixed_command_queue_properties(int mask, > > return mixed_properties; > > } > > > > +static bool > > +properties_forbidden(const cl_command_queue_properties properties, > > + const struct piglit_cl_api_test_env* env) > > +{ > > + int num_command_queue_properties_mutexes = > > + PIGLIT_CL_ENUM_NUM(cl_command_queue_properties_mutexes, > > env->version); > > + const cl_command_queue_properties* command_queue_properties_mutexes > > = > > + PIGLIT_CL_ENUM_ARRAY(cl_command_queue_properties_mutexes); > > + int i = 0; > > + for (; i < num_command_queue_properties_mutexes; ++i) > > + if (properties == command_queue_properties_mutexes[i]) > > + return true; > > + return false; > > +} > > + > > enum piglit_result > > piglit_cl_test(const int argc, > > const char** argv, > > @@ -79,7 +94,8 @@ piglit_cl_test(const int argc, > > cl_command_queue command_queue; > > cl_uint num_devices; > > cl_device_id* devices; > > - cl_command_queue_properties mixed_command_queue_properties; > > + cl_command_queue_properties mixed_command_queue_properties[4] = > > + {CL_QUEUE_PROPERTIES, 0, 0, 0}; > > > > cl_context_properties context_properties[] = { > > CL_CONTEXT_PLATFORM, > > (cl_context_properties)env->platform_id, > > @@ -116,12 +132,25 @@ piglit_cl_test(const int argc, > > * There are 2^(num_command_queue_properties)-1 possible options. > > */ > > for(mask = 0; mask < (1 << num_command_queue_properties); mask++) { > > - mixed_command_queue_properties = > > + mixed_command_queue_properties[1] = > > get_mixed_command_queue_properties(mask, > > command_queue_properties); > > - command_queue = clCreateCommandQueue(cl_ctx, > > + if (properties_forbidden(mixed_command_queue_properties[1], > > env)) > > + continue; > > +#if defined CL_VERSION_2_0 > > + if (env->version >= 20) { > > + command_queue = clCreateCommandQueueWithProperties( > > +cl_ctx, > > env->device_id, > > > > mixed_command_queue_properties, > > ); > > + } else > > +#endif //CL_VERSION_2_0 > > + { > > + command_queue = clCreateCommandQueue(cl_ctx, > > +
Re: [Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
Hey Jan, I've skimmed my way through this, and it's looking ok so far. I'll try to do a deeper dive over the changes needed for the 2.0 spec in the near future (I've been stuck in 1.1/1.2-land for too long). For now, you can have an: Acked-by: Aaron WatryI'll see if I can find some time tomorrow, or possibly this weekend to do a more detailed review. --Aaron On Wed, Jul 19, 2017 at 5:51 PM, Jan Vesely wrote: > v2: Fix warning in cl-api-get-mem-object-info > v3: Filter permissible queue properties combinations > Use and test clCreateCommandQueueWithProperties on OCL 2.0 > > Signed-off-by: Jan Vesely > --- > > I see few regressions with this patch on beignet(SKL) in generated > clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test > fixes the regression so I believe it's beignet bug. > No regressions on clover Turks and beignet(IVB). > > Jan > > tests/cl/api/create-command-queue.c | 37 +-- > tests/cl/api/get-mem-object-info.c | 8 > tests/util/piglit-util-cl-enum.c| 95 > +++-- > tests/util/piglit-util-cl-enum.h| 4 ++ > tests/util/piglit-util-cl.h | 4 +- > 5 files changed, 119 insertions(+), 29 deletions(-) > > diff --git a/tests/cl/api/create-command-queue.c > b/tests/cl/api/create-command-queue.c > index 0ffd1377c..3ada5af90 100644 > --- a/tests/cl/api/create-command-queue.c > +++ b/tests/cl/api/create-command-queue.c > @@ -52,7 +52,7 @@ get_mixed_command_queue_properties(int mask, > const cl_command_queue_properties > properties[]) { > int i = 0; > cl_command_queue_properties mixed_properties = 0; > - > + > while(mask > 0) { > if(mask%2 == 1) { > mixed_properties |= properties[i]; > @@ -64,6 +64,21 @@ get_mixed_command_queue_properties(int mask, > return mixed_properties; > } > > +static bool > +properties_forbidden(const cl_command_queue_properties properties, > + const struct piglit_cl_api_test_env* env) > +{ > + int num_command_queue_properties_mutexes = > + PIGLIT_CL_ENUM_NUM(cl_command_queue_properties_mutexes, > env->version); > + const cl_command_queue_properties* command_queue_properties_mutexes = > + PIGLIT_CL_ENUM_ARRAY(cl_command_queue_properties_mutexes); > + int i = 0; > + for (; i < num_command_queue_properties_mutexes; ++i) > + if (properties == command_queue_properties_mutexes[i]) > + return true; > + return false; > +} > + > enum piglit_result > piglit_cl_test(const int argc, > const char** argv, > @@ -79,7 +94,8 @@ piglit_cl_test(const int argc, > cl_command_queue command_queue; > cl_uint num_devices; > cl_device_id* devices; > - cl_command_queue_properties mixed_command_queue_properties; > + cl_command_queue_properties mixed_command_queue_properties[4] = > + {CL_QUEUE_PROPERTIES, 0, 0, 0}; > > cl_context_properties context_properties[] = { > CL_CONTEXT_PLATFORM, (cl_context_properties)env->platform_id, > @@ -116,12 +132,25 @@ piglit_cl_test(const int argc, > * There are 2^(num_command_queue_properties)-1 possible options. > */ > for(mask = 0; mask < (1 << num_command_queue_properties); mask++) { > - mixed_command_queue_properties = > + mixed_command_queue_properties[1] = > get_mixed_command_queue_properties(mask, > command_queue_properties); > - command_queue = clCreateCommandQueue(cl_ctx, > + if (properties_forbidden(mixed_command_queue_properties[1], > env)) > + continue; > +#if defined CL_VERSION_2_0 > + if (env->version >= 20) { > + command_queue = clCreateCommandQueueWithProperties( > +cl_ctx, > env->device_id, > > mixed_command_queue_properties, > ); > + } else > +#endif //CL_VERSION_2_0 > + { > + command_queue = clCreateCommandQueue(cl_ctx, > +env->device_id, > + > mixed_command_queue_properties[1], > +); > + } > if(errNo != CL_SUCCESS && errNo != > CL_INVALID_QUEUE_PROPERTIES) { > piglit_cl_check_error(errNo, CL_SUCCESS); > fprintf(stderr, > diff --git a/tests/cl/api/get-mem-object-info.c > b/tests/cl/api/get-mem-object-info.c > index
[Piglit] [PATCH 1/1] cl: Add support for OCL 2.0
v2: Fix warning in cl-api-get-mem-object-info v3: Filter permissible queue properties combinations Use and test clCreateCommandQueueWithProperties on OCL 2.0 Signed-off-by: Jan Vesely--- I see few regressions with this patch on beignet(SKL) in generated clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test fixes the regression so I believe it's beignet bug. No regressions on clover Turks and beignet(IVB). Jan tests/cl/api/create-command-queue.c | 37 +-- tests/cl/api/get-mem-object-info.c | 8 tests/util/piglit-util-cl-enum.c| 95 +++-- tests/util/piglit-util-cl-enum.h| 4 ++ tests/util/piglit-util-cl.h | 4 +- 5 files changed, 119 insertions(+), 29 deletions(-) diff --git a/tests/cl/api/create-command-queue.c b/tests/cl/api/create-command-queue.c index 0ffd1377c..3ada5af90 100644 --- a/tests/cl/api/create-command-queue.c +++ b/tests/cl/api/create-command-queue.c @@ -52,7 +52,7 @@ get_mixed_command_queue_properties(int mask, const cl_command_queue_properties properties[]) { int i = 0; cl_command_queue_properties mixed_properties = 0; - + while(mask > 0) { if(mask%2 == 1) { mixed_properties |= properties[i]; @@ -64,6 +64,21 @@ get_mixed_command_queue_properties(int mask, return mixed_properties; } +static bool +properties_forbidden(const cl_command_queue_properties properties, + const struct piglit_cl_api_test_env* env) +{ + int num_command_queue_properties_mutexes = + PIGLIT_CL_ENUM_NUM(cl_command_queue_properties_mutexes, env->version); + const cl_command_queue_properties* command_queue_properties_mutexes = + PIGLIT_CL_ENUM_ARRAY(cl_command_queue_properties_mutexes); + int i = 0; + for (; i < num_command_queue_properties_mutexes; ++i) + if (properties == command_queue_properties_mutexes[i]) + return true; + return false; +} + enum piglit_result piglit_cl_test(const int argc, const char** argv, @@ -79,7 +94,8 @@ piglit_cl_test(const int argc, cl_command_queue command_queue; cl_uint num_devices; cl_device_id* devices; - cl_command_queue_properties mixed_command_queue_properties; + cl_command_queue_properties mixed_command_queue_properties[4] = + {CL_QUEUE_PROPERTIES, 0, 0, 0}; cl_context_properties context_properties[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)env->platform_id, @@ -116,12 +132,25 @@ piglit_cl_test(const int argc, * There are 2^(num_command_queue_properties)-1 possible options. */ for(mask = 0; mask < (1 << num_command_queue_properties); mask++) { - mixed_command_queue_properties = + mixed_command_queue_properties[1] = get_mixed_command_queue_properties(mask, command_queue_properties); - command_queue = clCreateCommandQueue(cl_ctx, + if (properties_forbidden(mixed_command_queue_properties[1], env)) + continue; +#if defined CL_VERSION_2_0 + if (env->version >= 20) { + command_queue = clCreateCommandQueueWithProperties( +cl_ctx, env->device_id, mixed_command_queue_properties, ); + } else +#endif //CL_VERSION_2_0 + { + command_queue = clCreateCommandQueue(cl_ctx, +env->device_id, + mixed_command_queue_properties[1], +); + } if(errNo != CL_SUCCESS && errNo != CL_INVALID_QUEUE_PROPERTIES) { piglit_cl_check_error(errNo, CL_SUCCESS); fprintf(stderr, diff --git a/tests/cl/api/get-mem-object-info.c b/tests/cl/api/get-mem-object-info.c index 2db3b6ae6..5dcb4752d 100644 --- a/tests/cl/api/get-mem-object-info.c +++ b/tests/cl/api/get-mem-object-info.c @@ -170,6 +170,14 @@ test(int n, } break; #endif +#if defined(CL_VERSION_2_0) + case CL_MEM_USES_SVM_POINTER: + if (env->version >= 20) { + CHECK_SIZE(cl_bool) + CHECK_VALUE(cl_bool, CL_FALSE) + } + break; +#endif default: fprintf(stderr, "Warn: untested parameter %s\n",