HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cl_d3d11.h
Go to the documentation of this file.
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 /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
30 
31 #ifndef __OPENCL_CL_D3D11_H
32 #define __OPENCL_CL_D3D11_H
33 
34 #include <d3d11.h>
35 #include <CL/cl.h>
36 #include <CL/cl_platform.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /******************************************************************************
43  * cl_khr_d3d11_sharing */
44 #define cl_khr_d3d11_sharing 1
45 
47 typedef cl_uint cl_d3d11_device_set_khr;
48 
49 /******************************************************************************/
50 
51 /* Error Codes */
52 #define CL_INVALID_D3D11_DEVICE_KHR -1006
53 #define CL_INVALID_D3D11_RESOURCE_KHR -1007
54 #define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
55 #define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
56 
57 /* cl_d3d11_device_source */
58 #define CL_D3D11_DEVICE_KHR 0x4019
59 #define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
60 
61 /* cl_d3d11_device_set */
62 #define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
63 #define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
64 
65 /* cl_context_info */
66 #define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
67 #define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
68 
69 /* cl_mem_info */
70 #define CL_MEM_D3D11_RESOURCE_KHR 0x401E
71 
72 /* cl_image_info */
73 #define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
74 
75 /* cl_command_type */
76 #define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
77 #define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
78 
79 /******************************************************************************/
80 
82  cl_platform_id platform,
83  cl_d3d11_device_source_khr d3d_device_source,
84  void * d3d_object,
85  cl_d3d11_device_set_khr d3d_device_set,
86  cl_uint num_entries,
87  cl_device_id * devices,
88  cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
89 
93  ID3D11Buffer * resource,
94  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
95 
99  ID3D11Texture2D * resource,
100  UINT subresource,
101  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
102 
106  ID3D11Texture3D * resource,
107  UINT subresource,
108  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
109 
111  cl_command_queue command_queue,
112  cl_uint num_objects,
113  const cl_mem * mem_objects,
114  cl_uint num_events_in_wait_list,
115  const cl_event * event_wait_list,
117 
119  cl_command_queue command_queue,
120  cl_uint num_objects,
121  const cl_mem * mem_objects,
122  cl_uint num_events_in_wait_list,
123  const cl_event * event_wait_list,
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* __OPENCL_CL_D3D11_H */
131 
struct _cl_device_id * cl_device_id
Definition: cl.h:42
struct _cl_context * cl_context
Definition: cl.h:43
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2864
#define CL_API_SUFFIX__VERSION_1_2
Definition: cl_platform.h:61
struct _cl_platform_id * cl_platform_id
Definition: cl.h:41
cl_uint cl_d3d11_device_set_khr
Definition: cl_d3d11.h:47
#define CL_API_ENTRY
Definition: cl_platform.h:43
cl_uint cl_d3d11_device_source_khr
Definition: cl_d3d11.h:46
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueAcquireD3D11ObjectsKHR_fn)(cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) CL_API_SUFFIX__VERSION_1_2
Definition: cl_d3d11.h:110
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueReleaseD3D11ObjectsKHR_fn)(cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) CL_API_SUFFIX__VERSION_1_2
Definition: cl_d3d11.h:118
struct _cl_mem * cl_mem
Definition: cl.h:45
cl_event event
Definition: glew.h:3695
basic_printf_context_t< buffer >::type context
Definition: printf.h:631
struct _cl_event * cl_event
Definition: cl.h:48
CL_API_ENTRY cl_mem(CL_API_CALL * clCreateFromD3D11Texture3DKHR_fn)(cl_context context, cl_mem_flags flags, ID3D11Texture3D *resource, UINT subresource, cl_int *errcode_ret) CL_API_SUFFIX__VERSION_1_2
Definition: cl_d3d11.h:103
struct _cl_command_queue * cl_command_queue
Definition: cl.h:44
CL_API_ENTRY cl_mem(CL_API_CALL * clCreateFromD3D11BufferKHR_fn)(cl_context context, cl_mem_flags flags, ID3D11Buffer *resource, cl_int *errcode_ret) CL_API_SUFFIX__VERSION_1_2
Definition: cl_d3d11.h:90
#define CL_API_CALL
Definition: cl_platform.h:44
CL_API_ENTRY cl_int(CL_API_CALL * clGetDeviceIDsFromD3D11KHR_fn)(cl_platform_id platform, cl_d3d11_device_source_khr d3d_device_source, void *d3d_object, cl_d3d11_device_set_khr d3d_device_set, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices) CL_API_SUFFIX__VERSION_1_2
Definition: cl_d3d11.h:81
CL_API_ENTRY cl_mem(CL_API_CALL * clCreateFromD3D11Texture2DKHR_fn)(cl_context context, cl_mem_flags flags, ID3D11Texture2D *resource, UINT subresource, cl_int *errcode_ret) CL_API_SUFFIX__VERSION_1_2
Definition: cl_d3d11.h:96
cl_bitfield cl_mem_flags
Definition: cl.h:77