Publishing R3
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / common / intel_ocl_icd / 6.3 / linux / include / CL / cl_egl.h
1 /*******************************************************************************
2  * Copyright (c) 2008-2015 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18  *    https://www.khronos.org/registry/
19  *
20  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27  ******************************************************************************/
28
29 #ifndef __OPENCL_CL_EGL_H
30 #define __OPENCL_CL_EGL_H
31
32 #ifdef __APPLE__
33
34 #else
35 #include <CL/cl.h>
36 #include <EGL/egl.h>
37 #include <EGL/eglext.h>
38 #endif  
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44
45 /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
46 #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR  0x202F
47 #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR    0x202D
48 #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR    0x202E
49
50 /* Error type for clCreateFromEGLImageKHR */
51 #define CL_INVALID_EGL_OBJECT_KHR             -1093
52 #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR      -1092
53
54 /* CLeglImageKHR is an opaque handle to an EGLImage */
55 typedef void* CLeglImageKHR;
56
57 /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
58 typedef void* CLeglDisplayKHR;
59
60 /* CLeglSyncKHR is an opaque handle to an EGLSync object */
61 typedef void* CLeglSyncKHR;
62
63 /* properties passed to clCreateFromEGLImageKHR */
64 typedef intptr_t cl_egl_image_properties_khr;
65
66
67 #define cl_khr_egl_image 1
68
69 extern CL_API_ENTRY cl_mem CL_API_CALL
70 clCreateFromEGLImageKHR(cl_context                  /* context */,
71                         CLeglDisplayKHR             /* egldisplay */,
72                         CLeglImageKHR               /* eglimage */,
73                         cl_mem_flags                /* flags */,
74                         const cl_egl_image_properties_khr * /* properties */,
75                         cl_int *                    /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
76
77 typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
78         cl_context                  context,
79         CLeglDisplayKHR             egldisplay,
80         CLeglImageKHR               eglimage,
81         cl_mem_flags                flags,
82         const cl_egl_image_properties_khr * properties,
83         cl_int *                    errcode_ret);
84
85
86 extern CL_API_ENTRY cl_int CL_API_CALL
87 clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */,
88                               cl_uint          /* num_objects */,
89                               const cl_mem *   /* mem_objects */,
90                               cl_uint          /* num_events_in_wait_list */,
91                               const cl_event * /* event_wait_list */,
92                               cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
93
94 typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
95         cl_command_queue command_queue,
96         cl_uint          num_objects,
97         const cl_mem *   mem_objects,
98         cl_uint          num_events_in_wait_list,
99         const cl_event * event_wait_list,
100         cl_event *       event);
101
102
103 extern CL_API_ENTRY cl_int CL_API_CALL
104 clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */,
105                               cl_uint          /* num_objects */,
106                               const cl_mem *   /* mem_objects */,
107                               cl_uint          /* num_events_in_wait_list */,
108                               const cl_event * /* event_wait_list */,
109                               cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
110
111 typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
112         cl_command_queue command_queue,
113         cl_uint          num_objects,
114         const cl_mem *   mem_objects,
115         cl_uint          num_events_in_wait_list,
116         const cl_event * event_wait_list,
117         cl_event *       event);
118
119
120 #define cl_khr_egl_event 1
121
122 extern CL_API_ENTRY cl_event CL_API_CALL
123 clCreateEventFromEGLSyncKHR(cl_context      /* context */,
124                             CLeglSyncKHR    /* sync */,
125                             CLeglDisplayKHR /* display */,
126                             cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
127
128 typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
129         cl_context      context,
130         CLeglSyncKHR    sync,
131         CLeglDisplayKHR display,
132         cl_int *        errcode_ret);
133
134 #ifdef __cplusplus
135 }
136 #endif
137
138 #endif /* __OPENCL_CL_EGL_H */