Make CL-GL sharing available via ICD

Submitted by Chuanbo Weng on Jan. 23, 2017, 11:43 a.m.

Details

Message ID 5A0E318D73C83C40A09BDBBE131796D73AE9F2B2@shsmsx102.ccr.corp.intel.com
State New
Headers show
Series "Make CL-GL sharing available via ICD" ( rev: 2 ) in Beignet

Not browsing as part of any series.

Commit Message

Chuanbo Weng Jan. 23, 2017, 11:43 a.m.
This patch LGTM, and I did a basic test on this patch. Thanks for your patch.

-----Original Message-----
From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of Rebecca N. Palmer

Sent: Monday, January 23, 2017 7:11 AM
To: beignet@lists.freedesktop.org
Subject: [Beignet] [PATCH] Make CL-GL sharing available via ICD

Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>

---
(Warning: has not been tested)

-  CL_GL_INTEROP(clCreateFromGLTexture3D),
-  CL_GL_INTEROP(clCreateFromGLRenderbuffer),
-  CL_GL_INTEROP(clGetGLObjectInfo),
-  CL_GL_INTEROP(clGetGLTextureInfo),
+  CL_NOTYET(clCreateFromGLTexture3D),
+  CL_NOTYET(clCreateFromGLRenderbuffer),
+  CL_NOTYET(clGetGLObjectInfo),
+  CL_NOTYET(clGetGLTextureInfo),
   CL_GL_INTEROP(clEnqueueAcquireGLObjects),
   CL_GL_INTEROP(clEnqueueReleaseGLObjects),
-  CL_GL_INTEROP(clGetGLContextInfoKHR),
+  CL_NOTYET(clGetGLContextInfoKHR),
   (void *) NULL,
   (void *) NULL,
   (void *) NULL,
@@ -135,9 +139,9 @@ struct _cl_icd_dispatch const cl_khr_icd_dispatch = {
   clEnqueueReadBufferRect,
   clEnqueueWriteBufferRect,
   clEnqueueCopyBufferRect,
-  CL_1_2_NOTYET(clCreateSubDevicesEXT),
-  CL_1_2_NOTYET(clRetainDeviceEXT),
-  CL_1_2_NOTYET(clReleaseDeviceEXT),
+  CL_NOTYET(clCreateSubDevicesEXT),
+  CL_NOTYET(clRetainDeviceEXT),
+  CL_NOTYET(clReleaseDeviceEXT),
 #ifdef CL_VERSION_1_2
   (void *) NULL,
   clCreateSubDevices,

_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet

Patch hide | download patch | download mbox

diff --git a/src/cl_khr_icd.c b/src/cl_khr_icd.c index 7b3600c..e4daf79 100644
--- a/src/cl_khr_icd.c
+++ b/src/cl_khr_icd.c
@@ -18,10 +18,14 @@ 
 
 #include "cl_platform_id.h"
 #include "CL/cl_intel.h" // for clGetKernelSubGroupInfoKHR
-/* The interop functions are not implemented in Beignet */ -#define CL_GL_INTEROP(x) NULL
-/* OpenCL 1.2 is not implemented in Beignet */ -#define CL_1_2_NOTYET(x) NULL
+/* The interop functions are only available if sharing is enabled */ 
+#ifdef HAS_GL_EGL #define CL_GL_INTEROP(x) x #else #define 
+CL_GL_INTEROP(x) (void *) NULL #endif
+/* These are not yet implemented in Beignet */ #define CL_NOTYET(x) 
+(void *) NULL
 
 /** Return platform list through ICD interface
  * This code is used only if a client is linked directly against the library @@ -114,13 +118,13 @@ struct _cl_icd_dispatch const cl_khr_icd_dispatch = {
   clGetExtensionFunctionAddress,
   CL_GL_INTEROP(clCreateFromGLBuffer),
   CL_GL_INTEROP(clCreateFromGLTexture2D),

Comments

Pushed.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Weng, Chuanbo

> Sent: Monday, January 23, 2017 19:44

> To: Rebecca N. Palmer <rebecca_palmer@zoho.com>;

> beignet@lists.freedesktop.org

> Subject: Re: [Beignet] [PATCH] Make CL-GL sharing available via ICD

> 

> This patch LGTM, and I did a basic test on this patch. Thanks for your patch.

> 

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Rebecca N. Palmer

> Sent: Monday, January 23, 2017 7:11 AM

> To: beignet@lists.freedesktop.org

> Subject: [Beignet] [PATCH] Make CL-GL sharing available via ICD

> 

> Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>

> ---

> (Warning: has not been tested)

> 

> diff --git a/src/cl_khr_icd.c b/src/cl_khr_icd.c index 7b3600c..e4daf79 100644

> --- a/src/cl_khr_icd.c

> +++ b/src/cl_khr_icd.c

> @@ -18,10 +18,14 @@

> 

>  #include "cl_platform_id.h"

>  #include "CL/cl_intel.h" // for clGetKernelSubGroupInfoKHR

> -/* The interop functions are not implemented in Beignet */ -#define

> CL_GL_INTEROP(x) NULL

> -/* OpenCL 1.2 is not implemented in Beignet */ -#define CL_1_2_NOTYET(x)

> NULL

> +/* The interop functions are only available if sharing is enabled */

> +#ifdef HAS_GL_EGL #define CL_GL_INTEROP(x) x #else #define

> +CL_GL_INTEROP(x) (void *) NULL #endif

> +/* These are not yet implemented in Beignet */ #define CL_NOTYET(x)

> +(void *) NULL

> 

>  /** Return platform list through ICD interface

>   * This code is used only if a client is linked directly against the library @@ -

> 114,13 +118,13 @@ struct _cl_icd_dispatch const cl_khr_icd_dispatch = {

>    clGetExtensionFunctionAddress,

>    CL_GL_INTEROP(clCreateFromGLBuffer),

>    CL_GL_INTEROP(clCreateFromGLTexture2D),

> -  CL_GL_INTEROP(clCreateFromGLTexture3D),

> -  CL_GL_INTEROP(clCreateFromGLRenderbuffer),

> -  CL_GL_INTEROP(clGetGLObjectInfo),

> -  CL_GL_INTEROP(clGetGLTextureInfo),

> +  CL_NOTYET(clCreateFromGLTexture3D),

> +  CL_NOTYET(clCreateFromGLRenderbuffer),

> +  CL_NOTYET(clGetGLObjectInfo),

> +  CL_NOTYET(clGetGLTextureInfo),

>    CL_GL_INTEROP(clEnqueueAcquireGLObjects),

>    CL_GL_INTEROP(clEnqueueReleaseGLObjects),

> -  CL_GL_INTEROP(clGetGLContextInfoKHR),

> +  CL_NOTYET(clGetGLContextInfoKHR),

>    (void *) NULL,

>    (void *) NULL,

>    (void *) NULL,

> @@ -135,9 +139,9 @@ struct _cl_icd_dispatch const cl_khr_icd_dispatch = {

>    clEnqueueReadBufferRect,

>    clEnqueueWriteBufferRect,

>    clEnqueueCopyBufferRect,

> -  CL_1_2_NOTYET(clCreateSubDevicesEXT),

> -  CL_1_2_NOTYET(clRetainDeviceEXT),

> -  CL_1_2_NOTYET(clReleaseDeviceEXT),

> +  CL_NOTYET(clCreateSubDevicesEXT),

> +  CL_NOTYET(clRetainDeviceEXT),

> +  CL_NOTYET(clReleaseDeviceEXT),

>  #ifdef CL_VERSION_1_2

>    (void *) NULL,

>    clCreateSubDevices,

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/beignet

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/beignet