HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cl_d3d11.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2008-2013 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  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22  **********************************************************************************/
23 
24 /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
25 
26 #ifndef __OPENCL_CL_D3D11_H
27 #define __OPENCL_CL_D3D11_H
28 
29 #include <d3d11.h>
30 #include <CL/cl.h>
31 #include <CL/cl_platform.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /******************************************************************************
38  * cl_khr_d3d11_sharing */
39 #define cl_khr_d3d11_sharing 1
40 
42 typedef cl_uint cl_d3d11_device_set_khr;
43 
44 /******************************************************************************/
45 
46 /* Error Codes */
47 #define CL_INVALID_D3D11_DEVICE_KHR -1006
48 #define CL_INVALID_D3D11_RESOURCE_KHR -1007
49 #define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
50 #define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
51 
52 /* cl_d3d11_device_source */
53 #define CL_D3D11_DEVICE_KHR 0x4019
54 #define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
55 
56 /* cl_d3d11_device_set */
57 #define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
58 #define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
59 
60 /* cl_context_info */
61 #define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
62 #define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
63 
64 /* cl_mem_info */
65 #define CL_MEM_D3D11_RESOURCE_KHR 0x401E
66 
67 /* cl_image_info */
68 #define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
69 
70 /* cl_command_type */
71 #define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
72 #define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
73 
74 /******************************************************************************/
75 
77  cl_platform_id platform,
78  cl_d3d11_device_source_khr d3d_device_source,
79  void * d3d_object,
80  cl_d3d11_device_set_khr d3d_device_set,
81  cl_uint num_entries,
82  cl_device_id * devices,
83  cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
84 
86  cl_context context,
88  ID3D11Buffer * resource,
89  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
90 
92  cl_context context,
94  ID3D11Texture2D * resource,
95  UINT subresource,
96  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
97 
99  cl_context context,
101  ID3D11Texture3D * resource,
102  UINT subresource,
103  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
104 
106  cl_command_queue command_queue,
107  cl_uint num_objects,
108  const cl_mem * mem_objects,
109  cl_uint num_events_in_wait_list,
110  const cl_event * event_wait_list,
112 
114  cl_command_queue command_queue,
115  cl_uint num_objects,
116  const cl_mem * mem_objects,
117  cl_uint num_events_in_wait_list,
118  const cl_event * event_wait_list,
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* __OPENCL_CL_D3D11_H */
126 
struct _cl_device_id * cl_device_id
Definition: cl.h:40
struct _cl_context * cl_context
Definition: cl.h:41
GLbitfield flags
Definition: glcorearb.h:1595
#define CL_API_SUFFIX__VERSION_1_2
Definition: cl_platform.h:76
struct _cl_platform_id * cl_platform_id
Definition: cl.h:39
cl_uint cl_d3d11_device_set_khr
Definition: cl_d3d11.h:42
struct _cl_event * event
Definition: glcorearb.h:2960
#define CL_API_ENTRY
Definition: cl_platform.h:43
cl_uint cl_d3d11_device_source_khr
Definition: cl_d3d11.h:41
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:105
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:113
struct _cl_mem * cl_mem
Definition: cl.h:43
struct _cl_event * cl_event
Definition: cl.h:46
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:98
struct _cl_command_queue * cl_command_queue
Definition: cl.h:42
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:85
#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:76
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:91
cl_bitfield cl_mem_flags
Definition: cl.h:67