| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef OPENCL_CL_D3D11_H_ |
| 18 |
#define OPENCL_CL_D3D11_H_ |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#if defined(_MSC_VER) |
| 25 |
#if _MSC_VER >=1500 |
| 26 |
#pragma warning( push ) |
| 27 |
#pragma warning( disable : 4201 ) |
| 28 |
#pragma warning( disable : 5105 ) |
| 29 |
#endif |
| 30 |
#endif |
| 31 |
#include <d3d11.h> |
| 32 |
#if defined(_MSC_VER) |
| 33 |
#if _MSC_VER >=1500 |
| 34 |
#pragma warning( pop ) |
| 35 |
#endif |
| 36 |
#endif |
| 37 |
|
| 38 |
#include <CL/cl.h> |
| 39 |
|
| 40 |
|
| 41 |
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) |
| 42 |
#define CL_NO_EXTENSION_PROTOTYPES |
| 43 |
#endif |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ |
| 49 |
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 50 |
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES |
| 51 |
#endif |
| 52 |
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ |
| 53 |
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 54 |
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES |
| 55 |
#endif |
| 56 |
|
| 57 |
#ifdef __cplusplus |
| 58 |
extern "C" { |
| 59 |
#endif |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
#define cl_khr_d3d11_sharing 1 |
| 65 |
#define CL_KHR_D3D11_SHARING_EXTENSION_NAME \ |
| 66 |
"cl_khr_d3d11_sharing" |
| 67 |
|
| 68 |
typedef cl_uint cl_d3d11_device_source_khr; |
| 69 |
typedef cl_uint cl_d3d11_device_set_khr; |
| 70 |
|
| 71 |
|
| 72 |
#define CL_INVALID_D3D11_DEVICE_KHR -1006 |
| 73 |
#define CL_INVALID_D3D11_RESOURCE_KHR -1007 |
| 74 |
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 |
| 75 |
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 |
| 76 |
|
| 77 |
|
| 78 |
#define CL_D3D11_DEVICE_KHR 0x4019 |
| 79 |
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A |
| 80 |
|
| 81 |
|
| 82 |
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B |
| 83 |
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C |
| 84 |
|
| 85 |
|
| 86 |
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D |
| 87 |
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D |
| 88 |
|
| 89 |
|
| 90 |
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E |
| 91 |
|
| 92 |
|
| 93 |
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F |
| 94 |
|
| 95 |
|
| 96 |
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 |
| 97 |
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 |
| 98 |
|
| 99 |
|
| 100 |
typedef cl_int (CL_API_CALL * |
| 101 |
clGetDeviceIDsFromD3D11KHR_fn)( |
| 102 |
cl_platform_id platform, |
| 103 |
cl_d3d11_device_source_khr d3d_device_source, |
| 104 |
void* d3d_object, |
| 105 |
cl_d3d11_device_set_khr d3d_device_set, |
| 106 |
cl_uint num_entries, |
| 107 |
cl_device_id* devices, |
| 108 |
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; |
| 109 |
|
| 110 |
typedef cl_mem (CL_API_CALL * |
| 111 |
clCreateFromD3D11BufferKHR_fn)( |
| 112 |
cl_context context, |
| 113 |
cl_mem_flags flags, |
| 114 |
ID3D11Buffer* resource, |
| 115 |
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 116 |
|
| 117 |
typedef cl_mem (CL_API_CALL * |
| 118 |
clCreateFromD3D11Texture2DKHR_fn)( |
| 119 |
cl_context context, |
| 120 |
cl_mem_flags flags, |
| 121 |
ID3D11Texture2D* resource, |
| 122 |
UINT subresource, |
| 123 |
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 124 |
|
| 125 |
typedef cl_mem (CL_API_CALL * |
| 126 |
clCreateFromD3D11Texture3DKHR_fn)( |
| 127 |
cl_context context, |
| 128 |
cl_mem_flags flags, |
| 129 |
ID3D11Texture3D* resource, |
| 130 |
UINT subresource, |
| 131 |
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 132 |
|
| 133 |
typedef cl_int (CL_API_CALL * |
| 134 |
clEnqueueAcquireD3D11ObjectsKHR_fn)( |
| 135 |
cl_command_queue command_queue, |
| 136 |
cl_uint num_objects, |
| 137 |
const cl_mem* mem_objects, |
| 138 |
cl_uint num_events_in_wait_list, |
| 139 |
const cl_event* event_wait_list, |
| 140 |
cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
| 141 |
|
| 142 |
typedef cl_int (CL_API_CALL * |
| 143 |
clEnqueueReleaseD3D11ObjectsKHR_fn)( |
| 144 |
cl_command_queue command_queue, |
| 145 |
cl_uint num_objects, |
| 146 |
const cl_mem* mem_objects, |
| 147 |
cl_uint num_events_in_wait_list, |
| 148 |
const cl_event* event_wait_list, |
| 149 |
cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
| 150 |
|
| 151 |
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 152 |
|
| 153 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 154 |
clGetDeviceIDsFromD3D11KHR( |
| 155 |
cl_platform_id platform, |
| 156 |
cl_d3d11_device_source_khr d3d_device_source, |
| 157 |
void* d3d_object, |
| 158 |
cl_d3d11_device_set_khr d3d_device_set, |
| 159 |
cl_uint num_entries, |
| 160 |
cl_device_id* devices, |
| 161 |
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; |
| 162 |
|
| 163 |
extern CL_API_ENTRY cl_mem CL_API_CALL |
| 164 |
clCreateFromD3D11BufferKHR( |
| 165 |
cl_context context, |
| 166 |
cl_mem_flags flags, |
| 167 |
ID3D11Buffer* resource, |
| 168 |
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 169 |
|
| 170 |
extern CL_API_ENTRY cl_mem CL_API_CALL |
| 171 |
clCreateFromD3D11Texture2DKHR( |
| 172 |
cl_context context, |
| 173 |
cl_mem_flags flags, |
| 174 |
ID3D11Texture2D* resource, |
| 175 |
UINT subresource, |
| 176 |
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 177 |
|
| 178 |
extern CL_API_ENTRY cl_mem CL_API_CALL |
| 179 |
clCreateFromD3D11Texture3DKHR( |
| 180 |
cl_context context, |
| 181 |
cl_mem_flags flags, |
| 182 |
ID3D11Texture3D* resource, |
| 183 |
UINT subresource, |
| 184 |
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
| 185 |
|
| 186 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 187 |
clEnqueueAcquireD3D11ObjectsKHR( |
| 188 |
cl_command_queue command_queue, |
| 189 |
cl_uint num_objects, |
| 190 |
const cl_mem* mem_objects, |
| 191 |
cl_uint num_events_in_wait_list, |
| 192 |
const cl_event* event_wait_list, |
| 193 |
cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
| 194 |
|
| 195 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 196 |
clEnqueueReleaseD3D11ObjectsKHR( |
| 197 |
cl_command_queue command_queue, |
| 198 |
cl_uint num_objects, |
| 199 |
const cl_mem* mem_objects, |
| 200 |
cl_uint num_events_in_wait_list, |
| 201 |
const cl_event* event_wait_list, |
| 202 |
cl_event* event) CL_API_SUFFIX__VERSION_1_2; |
| 203 |
|
| 204 |
#endif |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
#define cl_intel_sharing_format_query_d3d11 1 |
| 210 |
#define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_NAME \ |
| 211 |
"cl_intel_sharing_format_query_d3d11" |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
typedef cl_int (CL_API_CALL * |
| 216 |
clGetSupportedD3D11TextureFormatsINTEL_fn)( |
| 217 |
cl_context context, |
| 218 |
cl_mem_flags flags, |
| 219 |
cl_mem_object_type image_type, |
| 220 |
cl_uint plane, |
| 221 |
cl_uint num_entries, |
| 222 |
DXGI_FORMAT* d3d11_formats, |
| 223 |
cl_uint* num_texture_formats) ; |
| 224 |
|
| 225 |
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 226 |
|
| 227 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 228 |
clGetSupportedD3D11TextureFormatsINTEL( |
| 229 |
cl_context context, |
| 230 |
cl_mem_flags flags, |
| 231 |
cl_mem_object_type image_type, |
| 232 |
cl_uint plane, |
| 233 |
cl_uint num_entries, |
| 234 |
DXGI_FORMAT* d3d11_formats, |
| 235 |
cl_uint* num_texture_formats) ; |
| 236 |
|
| 237 |
#endif |
| 238 |
|
| 239 |
#ifdef __cplusplus |
| 240 |
} |
| 241 |
#endif |
| 242 |
|
| 243 |
#endif |