1 /******************************************************************************* 2 * Copyright (c) 2008-2020 The Khronos Group Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 #ifndef __OPENCL_CL_D3D10_H 18 #define __OPENCL_CL_D3D10_H 19 20 #if defined(_MSC_VER) 21 #if _MSC_VER >=1500 22 #pragma warning( push ) 23 #pragma warning( disable : 4201 ) 24 #endif 25 #endif 26 #include <d3d10.h> 27 #if defined(_MSC_VER) 28 #if _MSC_VER >=1500 29 #pragma warning( pop ) 30 #endif 31 #endif 32 #include <CL/cl.h> 33 #include <CL/cl_platform.h> 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 /****************************************************************************** 40 * cl_khr_d3d10_sharing */ 41 #define cl_khr_d3d10_sharing 1 42 43 typedef cl_uint cl_d3d10_device_source_khr; 44 typedef cl_uint cl_d3d10_device_set_khr; 45 46 /******************************************************************************/ 47 48 /* Error Codes */ 49 #define CL_INVALID_D3D10_DEVICE_KHR -1002 50 #define CL_INVALID_D3D10_RESOURCE_KHR -1003 51 #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 52 #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 53 54 /* cl_d3d10_device_source_nv */ 55 #define CL_D3D10_DEVICE_KHR 0x4010 56 #define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 57 58 /* cl_d3d10_device_set_nv */ 59 #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 60 #define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 61 62 /* cl_context_info */ 63 #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 64 #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C 65 66 /* cl_mem_info */ 67 #define CL_MEM_D3D10_RESOURCE_KHR 0x4015 68 69 /* cl_image_info */ 70 #define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 71 72 /* cl_command_type */ 73 #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 74 #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 75 76 /******************************************************************************/ 77 78 typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( 79 cl_platform_id platform, 80 cl_d3d10_device_source_khr d3d_device_source, 81 void * d3d_object, 82 cl_d3d10_device_set_khr d3d_device_set, 83 cl_uint num_entries, 84 cl_device_id * devices, 85 cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; 86 87 typedef cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( 88 cl_context context, 89 cl_mem_flags flags, 90 ID3D10Buffer * resource, 91 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 92 93 typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( 94 cl_context context, 95 cl_mem_flags flags, 96 ID3D10Texture2D * resource, 97 UINT subresource, 98 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 99 100 typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( 101 cl_context context, 102 cl_mem_flags flags, 103 ID3D10Texture3D * resource, 104 UINT subresource, 105 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; 106 107 typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( 108 cl_command_queue command_queue, 109 cl_uint num_objects, 110 const cl_mem * mem_objects, 111 cl_uint num_events_in_wait_list, 112 const cl_event * event_wait_list, 113 cl_event * event) CL_API_SUFFIX__VERSION_1_0; 114 115 typedef cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( 116 cl_command_queue command_queue, 117 cl_uint num_objects, 118 const cl_mem * mem_objects, 119 cl_uint num_events_in_wait_list, 120 const cl_event * event_wait_list, 121 cl_event * event) CL_API_SUFFIX__VERSION_1_0; 122 123 #ifdef __cplusplus 124 } 125 #endif 126 127 #endif /* __OPENCL_CL_D3D10_H */ 128 129