[Beignet] Limit get_program_global_data() calls to OpenCL 2.0

Jan Beich jbeich at freebsd.org
Thu Mar 16 10:13:21 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217635
---
 src/cl_program.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/cl_program.c b/src/cl_program.c
index 363aed5d..bb96d98f 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -675,7 +675,8 @@ cl_program_build(cl_program p, const char *options)
     memcpy(p->bin + copyed, interp_kernel_get_code(opaque), sz);
     copyed += sz;
   }
-  if ((err = get_program_global_data(p)) != CL_SUCCESS)
+  uint32_t ocl_version = interp_kernel_get_ocl_version(interp_program_get_kernel(p->opaque, 0));
+  if (ocl_version >= 200 && (err = get_program_global_data(p)) != CL_SUCCESS)
     goto error;
 
   p->is_built = 1;
@@ -784,7 +785,8 @@ cl_program_link(cl_context            context,
     copyed += sz;
   }
 
-  if ((err = get_program_global_data(p)) != CL_SUCCESS)
+  uint32_t ocl_version = interp_kernel_get_ocl_version(interp_program_get_kernel(p->opaque, 0));
+  if (ocl_version >= 200 && (err = get_program_global_data(p)) != CL_SUCCESS)
     goto error;
 
 done:


More information about the Beignet mailing list