Commit 2489a0c1 by John Plate Committed by Commit Bot

Fixed OpenCL headers for Windows

Bug: angleproject:5761 Change-Id: I29d1fd3bf862728a3e78418a4f98219828394452 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2807717 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 15b34197
DisableFormat: true DisableFormat: true
SortIncludes: false
# ANGLE OpenCL Headers
The OpenCL headers ANGLE uses are the original headers from Khronos, but they are modified to allow
the macro `CL_API_ENTRY` to be overridden externally.
The modifications have been [submitted](https://github.com/KhronosGroup/OpenCL-Headers/pull/162) to
Khronos, and this document should be updated after they are merged.
### Regenerating headers
1. Clone [https://github.com/KhronosGroup/OpenCL-Headers.git](https://github.com/KhronosGroup/OpenCL-Headers.git).
1. Copy all headers from `OpenCL-Headers/CL/` over to this folder.
1. Edit the headers:
* Change all occurences of `typedef CL_API_ENTRY` to `typedef`.
* In `cl_platform.h` change both `#define CL_API_ENTRY` to
```
#if !defined(CL_API_ENTRY)
#define CL_API_ENTRY
#endif
```
...@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d10_device_set_khr; ...@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/ /******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform, cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source, cl_d3d10_device_source_khr d3d_device_source,
void * d3d_object, void * d3d_object,
...@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( ...@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_device_id * devices, cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
ID3D10Buffer * resource, ID3D10Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
ID3D10Texture2D * resource, ID3D10Texture2D * resource,
UINT subresource, UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
ID3D10Texture3D * resource, ID3D10Texture3D * resource,
UINT subresource, UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -112,7 +112,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( ...@@ -112,7 +112,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
const cl_event * event_wait_list, const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0; cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
......
...@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d11_device_set_khr; ...@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d11_device_set_khr;
/******************************************************************************/ /******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
cl_platform_id platform, cl_platform_id platform,
cl_d3d11_device_source_khr d3d_device_source, cl_d3d11_device_source_khr d3d_device_source,
void * d3d_object, void * d3d_object,
...@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( ...@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
cl_device_id * devices, cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
ID3D11Buffer * resource, ID3D11Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
ID3D11Texture2D * resource, ID3D11Texture2D * resource,
UINT subresource, UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
ID3D11Texture3D * resource, ID3D11Texture3D * resource,
UINT subresource, UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -112,7 +112,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( ...@@ -112,7 +112,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
const cl_event * event_wait_list, const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2; cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
......
...@@ -76,7 +76,7 @@ typedef struct _cl_dx9_surface_info_khr ...@@ -76,7 +76,7 @@ typedef struct _cl_dx9_surface_info_khr
/******************************************************************************/ /******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( typedef cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(
cl_platform_id platform, cl_platform_id platform,
cl_uint num_media_adapters, cl_uint num_media_adapters,
cl_dx9_media_adapter_type_khr * media_adapter_type, cl_dx9_media_adapter_type_khr * media_adapter_type,
...@@ -86,7 +86,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_f ...@@ -86,7 +86,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_f
cl_device_id * devices, cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
cl_dx9_media_adapter_type_khr adapter_type, cl_dx9_media_adapter_type_khr adapter_type,
...@@ -94,7 +94,7 @@ typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( ...@@ -94,7 +94,7 @@ typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_uint plane, cl_uint plane,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -102,7 +102,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn ...@@ -102,7 +102,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn
const cl_event * event_wait_list, const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2; cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -161,7 +161,7 @@ clGetDeviceIDsFromDX9INTEL( ...@@ -161,7 +161,7 @@ clGetDeviceIDsFromDX9INTEL(
cl_device_id* devices, cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_1; cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int (CL_API_CALL* clGetDeviceIDsFromDX9INTEL_fn)( typedef cl_int (CL_API_CALL* clGetDeviceIDsFromDX9INTEL_fn)(
cl_platform_id platform, cl_platform_id platform,
cl_dx9_device_source_intel dx9_device_source, cl_dx9_device_source_intel dx9_device_source,
void* dx9_object, void* dx9_object,
...@@ -179,7 +179,7 @@ clCreateFromDX9MediaSurfaceINTEL( ...@@ -179,7 +179,7 @@ clCreateFromDX9MediaSurfaceINTEL(
UINT plane, UINT plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_1; cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceINTEL_fn)( typedef cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceINTEL_fn)(
cl_context context, cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
IDirect3DSurface9* resource, IDirect3DSurface9* resource,
...@@ -196,7 +196,7 @@ clEnqueueAcquireDX9ObjectsINTEL( ...@@ -196,7 +196,7 @@ clEnqueueAcquireDX9ObjectsINTEL(
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_1; cl_event* event) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9ObjectsINTEL_fn)( typedef cl_int (CL_API_CALL *clEnqueueAcquireDX9ObjectsINTEL_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem* mem_objects, const cl_mem* mem_objects,
...@@ -213,7 +213,7 @@ clEnqueueReleaseDX9ObjectsINTEL( ...@@ -213,7 +213,7 @@ clEnqueueReleaseDX9ObjectsINTEL(
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_1; cl_event* event) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9ObjectsINTEL_fn)( typedef cl_int (CL_API_CALL *clEnqueueReleaseDX9ObjectsINTEL_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
cl_mem* mem_objects, cl_mem* mem_objects,
......
...@@ -56,7 +56,7 @@ clCreateFromEGLImageKHR(cl_context context, ...@@ -56,7 +56,7 @@ clCreateFromEGLImageKHR(cl_context context,
const cl_egl_image_properties_khr * properties, const cl_egl_image_properties_khr * properties,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( typedef cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
cl_context context, cl_context context,
CLeglDisplayKHR egldisplay, CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage, CLeglImageKHR eglimage,
...@@ -73,7 +73,7 @@ clEnqueueAcquireEGLObjectsKHR(cl_command_queue command_queue, ...@@ -73,7 +73,7 @@ clEnqueueAcquireEGLObjectsKHR(cl_command_queue command_queue,
const cl_event * event_wait_list, const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0; cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -90,7 +90,7 @@ clEnqueueReleaseEGLObjectsKHR(cl_command_queue command_queue, ...@@ -90,7 +90,7 @@ clEnqueueReleaseEGLObjectsKHR(cl_command_queue command_queue,
const cl_event * event_wait_list, const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0; cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( typedef cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_uint num_objects, cl_uint num_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -107,7 +107,7 @@ clCreateEventFromEGLSyncKHR(cl_context context, ...@@ -107,7 +107,7 @@ clCreateEventFromEGLSyncKHR(cl_context context,
CLeglDisplayKHR display, CLeglDisplayKHR display,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( typedef cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
cl_context context, cl_context context,
CLeglSyncKHR sync, CLeglSyncKHR sync,
CLeglDisplayKHR display, CLeglDisplayKHR display,
......
...@@ -102,7 +102,7 @@ clIcdGetPlatformIDsKHR(cl_uint num_entries, ...@@ -102,7 +102,7 @@ clIcdGetPlatformIDsKHR(cl_uint num_entries,
cl_platform_id * platforms, cl_platform_id * platforms,
cl_uint * num_platforms); cl_uint * num_platforms);
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(cl_uint num_entries, (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(cl_uint num_entries,
cl_platform_id * platforms, cl_platform_id * platforms,
cl_uint * num_platforms); cl_uint * num_platforms);
...@@ -129,7 +129,7 @@ clCreateProgramWithILKHR(cl_context context, ...@@ -129,7 +129,7 @@ clCreateProgramWithILKHR(cl_context context,
size_t length, size_t length,
cl_int * errcode_ret); cl_int * errcode_ret);
typedef CL_API_ENTRY cl_program typedef cl_program
(CL_API_CALL *clCreateProgramWithILKHR_fn)(cl_context context, (CL_API_CALL *clCreateProgramWithILKHR_fn)(cl_context context,
const void * il, const void * il,
size_t length, size_t length,
...@@ -178,7 +178,7 @@ typedef CL_API_ENTRY cl_program ...@@ -178,7 +178,7 @@ typedef CL_API_ENTRY cl_program
extern CL_API_ENTRY cl_int CL_API_CALL extern CL_API_ENTRY cl_int CL_API_CALL
clTerminateContextKHR(cl_context context) CL_EXT_SUFFIX__VERSION_1_2; clTerminateContextKHR(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL *clTerminateContextKHR_fn)(cl_context context) CL_EXT_SUFFIX__VERSION_1_2; (CL_API_CALL *clTerminateContextKHR_fn)(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
...@@ -206,7 +206,7 @@ clCreateCommandQueueWithPropertiesKHR(cl_context context, ...@@ -206,7 +206,7 @@ clCreateCommandQueueWithPropertiesKHR(cl_context context,
const cl_queue_properties_khr* properties, const cl_queue_properties_khr* properties,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2; cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_command_queue typedef cl_command_queue
(CL_API_CALL *clCreateCommandQueueWithPropertiesKHR_fn)(cl_context context, (CL_API_CALL *clCreateCommandQueueWithPropertiesKHR_fn)(cl_context context,
cl_device_id device, cl_device_id device,
const cl_queue_properties_khr* properties, const cl_queue_properties_khr* properties,
...@@ -270,13 +270,13 @@ typedef CL_API_ENTRY cl_command_queue ...@@ -270,13 +270,13 @@ typedef CL_API_ENTRY cl_command_queue
extern CL_API_ENTRY cl_int CL_API_CALL extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; clReleaseDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL *clReleaseDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; (CL_API_CALL *clReleaseDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL extern CL_API_ENTRY cl_int CL_API_CALL
clRetainDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; clRetainDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL *clRetainDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1; (CL_API_CALL *clRetainDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
typedef cl_ulong cl_device_partition_property_ext; typedef cl_ulong cl_device_partition_property_ext;
...@@ -287,7 +287,7 @@ clCreateSubDevicesEXT(cl_device_id in_device, ...@@ -287,7 +287,7 @@ clCreateSubDevicesEXT(cl_device_id in_device,
cl_device_id * out_devices, cl_device_id * out_devices,
cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1; cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id in_device, (CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id in_device,
const cl_device_partition_property_ext * properties, const cl_device_partition_property_ext * properties,
cl_uint num_entries, cl_uint num_entries,
...@@ -346,7 +346,7 @@ clEnqueueMigrateMemObjectEXT(cl_command_queue command_queue, ...@@ -346,7 +346,7 @@ clEnqueueMigrateMemObjectEXT(cl_command_queue command_queue,
const cl_event * event_wait_list, const cl_event * event_wait_list,
cl_event * event); cl_event * event);
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL *clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue command_queue, (CL_API_CALL *clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue command_queue,
cl_uint num_mem_objects, cl_uint num_mem_objects,
const cl_mem * mem_objects, const cl_mem * mem_objects,
...@@ -566,7 +566,7 @@ clGetKernelSubGroupInfoKHR(cl_kernel in_kernel, ...@@ -566,7 +566,7 @@ clGetKernelSubGroupInfoKHR(cl_kernel in_kernel,
void * param_value, void * param_value,
size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED; size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
typedef CL_API_ENTRY cl_int typedef cl_int
(CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel in_kernel, (CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel in_kernel,
cl_device_id in_device, cl_device_id in_device,
cl_kernel_sub_group_info param_name, cl_kernel_sub_group_info param_name,
...@@ -1068,7 +1068,7 @@ clCreateAcceleratorINTEL( ...@@ -1068,7 +1068,7 @@ clCreateAcceleratorINTEL(
const void* descriptor, const void* descriptor,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2; cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_accelerator_intel (CL_API_CALL *clCreateAcceleratorINTEL_fn)( typedef cl_accelerator_intel (CL_API_CALL *clCreateAcceleratorINTEL_fn)(
cl_context context, cl_context context,
cl_accelerator_type_intel accelerator_type, cl_accelerator_type_intel accelerator_type,
size_t descriptor_size, size_t descriptor_size,
...@@ -1083,7 +1083,7 @@ clGetAcceleratorInfoINTEL( ...@@ -1083,7 +1083,7 @@ clGetAcceleratorInfoINTEL(
void* param_value, void* param_value,
size_t* param_value_size_ret) CL_EXT_SUFFIX__VERSION_1_2; size_t* param_value_size_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetAcceleratorInfoINTEL_fn)( typedef cl_int (CL_API_CALL *clGetAcceleratorInfoINTEL_fn)(
cl_accelerator_intel accelerator, cl_accelerator_intel accelerator,
cl_accelerator_info_intel param_name, cl_accelerator_info_intel param_name,
size_t param_value_size, size_t param_value_size,
...@@ -1094,14 +1094,14 @@ extern CL_API_ENTRY cl_int CL_API_CALL ...@@ -1094,14 +1094,14 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clRetainAcceleratorINTEL( clRetainAcceleratorINTEL(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2; cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainAcceleratorINTEL_fn)( typedef cl_int (CL_API_CALL *clRetainAcceleratorINTEL_fn)(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2; cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseAcceleratorINTEL( clReleaseAcceleratorINTEL(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2; cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseAcceleratorINTEL_fn)( typedef cl_int (CL_API_CALL *clReleaseAcceleratorINTEL_fn)(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2; cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
/****************************************** /******************************************
...@@ -1374,7 +1374,7 @@ clHostMemAllocINTEL( ...@@ -1374,7 +1374,7 @@ clHostMemAllocINTEL(
cl_uint alignment, cl_uint alignment,
cl_int* errcode_ret); cl_int* errcode_ret);
typedef CL_API_ENTRY void* (CL_API_CALL * typedef void* (CL_API_CALL *
clHostMemAllocINTEL_fn)( clHostMemAllocINTEL_fn)(
cl_context context, cl_context context,
const cl_mem_properties_intel* properties, const cl_mem_properties_intel* properties,
...@@ -1391,7 +1391,7 @@ clDeviceMemAllocINTEL( ...@@ -1391,7 +1391,7 @@ clDeviceMemAllocINTEL(
cl_uint alignment, cl_uint alignment,
cl_int* errcode_ret); cl_int* errcode_ret);
typedef CL_API_ENTRY void* (CL_API_CALL * typedef void* (CL_API_CALL *
clDeviceMemAllocINTEL_fn)( clDeviceMemAllocINTEL_fn)(
cl_context context, cl_context context,
cl_device_id device, cl_device_id device,
...@@ -1409,7 +1409,7 @@ clSharedMemAllocINTEL( ...@@ -1409,7 +1409,7 @@ clSharedMemAllocINTEL(
cl_uint alignment, cl_uint alignment,
cl_int* errcode_ret); cl_int* errcode_ret);
typedef CL_API_ENTRY void* (CL_API_CALL * typedef void* (CL_API_CALL *
clSharedMemAllocINTEL_fn)( clSharedMemAllocINTEL_fn)(
cl_context context, cl_context context,
cl_device_id device, cl_device_id device,
...@@ -1423,7 +1423,7 @@ clMemFreeINTEL( ...@@ -1423,7 +1423,7 @@ clMemFreeINTEL(
cl_context context, cl_context context,
void* ptr); void* ptr);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clMemFreeINTEL_fn)( clMemFreeINTEL_fn)(
cl_context context, cl_context context,
void* ptr); void* ptr);
...@@ -1433,7 +1433,7 @@ clMemBlockingFreeINTEL( ...@@ -1433,7 +1433,7 @@ clMemBlockingFreeINTEL(
cl_context context, cl_context context,
void* ptr); void* ptr);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clMemBlockingFreeINTEL_fn)( clMemBlockingFreeINTEL_fn)(
cl_context context, cl_context context,
void* ptr); void* ptr);
...@@ -1447,7 +1447,7 @@ clGetMemAllocInfoINTEL( ...@@ -1447,7 +1447,7 @@ clGetMemAllocInfoINTEL(
void* param_value, void* param_value,
size_t* param_value_size_ret); size_t* param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clGetMemAllocInfoINTEL_fn)( clGetMemAllocInfoINTEL_fn)(
cl_context context, cl_context context,
const void* ptr, const void* ptr,
...@@ -1462,7 +1462,7 @@ clSetKernelArgMemPointerINTEL( ...@@ -1462,7 +1462,7 @@ clSetKernelArgMemPointerINTEL(
cl_uint arg_index, cl_uint arg_index,
const void* arg_value); const void* arg_value);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clSetKernelArgMemPointerINTEL_fn)( clSetKernelArgMemPointerINTEL_fn)(
cl_kernel kernel, cl_kernel kernel,
cl_uint arg_index, cl_uint arg_index,
...@@ -1478,7 +1478,7 @@ clEnqueueMemsetINTEL( /* Deprecated */ ...@@ -1478,7 +1478,7 @@ clEnqueueMemsetINTEL( /* Deprecated */
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event); cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clEnqueueMemsetINTEL_fn)( /* Deprecated */ clEnqueueMemsetINTEL_fn)( /* Deprecated */
cl_command_queue command_queue, cl_command_queue command_queue,
void* dst_ptr, void* dst_ptr,
...@@ -1499,7 +1499,7 @@ clEnqueueMemFillINTEL( ...@@ -1499,7 +1499,7 @@ clEnqueueMemFillINTEL(
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event); cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clEnqueueMemFillINTEL_fn)( clEnqueueMemFillINTEL_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
void* dst_ptr, void* dst_ptr,
...@@ -1521,7 +1521,7 @@ clEnqueueMemcpyINTEL( ...@@ -1521,7 +1521,7 @@ clEnqueueMemcpyINTEL(
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event); cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clEnqueueMemcpyINTEL_fn)( clEnqueueMemcpyINTEL_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
cl_bool blocking, cl_bool blocking,
...@@ -1547,7 +1547,7 @@ clEnqueueMigrateMemINTEL( ...@@ -1547,7 +1547,7 @@ clEnqueueMigrateMemINTEL(
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event); cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clEnqueueMigrateMemINTEL_fn)( clEnqueueMigrateMemINTEL_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
const void* ptr, const void* ptr,
...@@ -1569,7 +1569,7 @@ clEnqueueMemAdviseINTEL( ...@@ -1569,7 +1569,7 @@ clEnqueueMemAdviseINTEL(
const cl_event* event_wait_list, const cl_event* event_wait_list,
cl_event* event); cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL * typedef cl_int (CL_API_CALL *
clEnqueueMemAdviseINTEL_fn)( clEnqueueMemAdviseINTEL_fn)(
cl_command_queue command_queue, cl_command_queue command_queue,
const void* ptr, const void* ptr,
...@@ -1594,7 +1594,7 @@ clCreateBufferWithPropertiesINTEL( ...@@ -1594,7 +1594,7 @@ clCreateBufferWithPropertiesINTEL(
void * host_ptr, void * host_ptr,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_0; cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL * typedef cl_mem (CL_API_CALL *
clCreateBufferWithPropertiesINTEL_fn)( clCreateBufferWithPropertiesINTEL_fn)(
cl_context context, cl_context context,
const cl_mem_properties_intel* properties, const cl_mem_properties_intel* properties,
......
...@@ -145,7 +145,7 @@ clGetGLContextInfoKHR(const cl_context_properties * properties, ...@@ -145,7 +145,7 @@ clGetGLContextInfoKHR(const cl_context_properties * properties,
void * param_value, void * param_value,
size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( typedef cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
const cl_context_properties * properties, const cl_context_properties * properties,
cl_gl_context_info param_name, cl_gl_context_info param_name,
size_t param_value_size, size_t param_value_size,
......
...@@ -24,11 +24,15 @@ extern "C" { ...@@ -24,11 +24,15 @@ extern "C" {
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)
#define CL_API_ENTRY #if !defined(CL_API_ENTRY)
#define CL_API_ENTRY
#endif
#define CL_API_CALL __stdcall #define CL_API_CALL __stdcall
#define CL_CALLBACK __stdcall #define CL_CALLBACK __stdcall
#else #else
#define CL_API_ENTRY #if !defined(CL_API_ENTRY)
#define CL_API_ENTRY
#endif
#define CL_API_CALL #define CL_API_CALL
#define CL_CALLBACK #define CL_CALLBACK
#endif #endif
......
DisableFormat: true DisableFormat: true
SortIncludes: false
DisableFormat: true DisableFormat: true
SortIncludes: false
DisableFormat: true DisableFormat: true
SortIncludes: false
DisableFormat: true DisableFormat: true
SortIncludes: false
DisableFormat: true DisableFormat: true
SortIncludes: false
DisableFormat: true DisableFormat: true
SortIncludes: false
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679", "4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"a5727169ccae71f737d689a67f59e4c8", "142d88c6897c428055ed7f0cbcc24717",
"scripts/gl.xml": "scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6", "2a73a58a7e26d8676a2c0af6d528cae6",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -166,9 +166,9 @@ ...@@ -166,9 +166,9 @@
"src/libGLESv2/libGLESv2_with_capture_autogen.def": "src/libGLESv2/libGLESv2_with_capture_autogen.def":
"301a20588e14724b390409c71d5ccfcd", "301a20588e14724b390409c71d5ccfcd",
"src/libOpenCL/entry_points_cl_autogen.cpp": "src/libOpenCL/entry_points_cl_autogen.cpp":
"9da7a72f6afcd5af04777103612a3bee", "228858e9707c6c1c4abe2fe618dfb2ab",
"src/libOpenCL/entry_points_cl_autogen.h": "src/libOpenCL/entry_points_cl_autogen.h":
"3b4a3094e8fd9082b71915b5bd1e8fee", "ca2c45e4f2ae7688efac5100d5b468ad",
"src/libOpenCL/libOpenCL_autogen.cpp": "src/libOpenCL/libOpenCL_autogen.cpp":
"6a44d6aedb6d21282de91bc719e7f0bf" "5505f26e1214b5c65fd3abfb46139ef0"
} }
\ No newline at end of file
...@@ -246,7 +246,7 @@ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\ ...@@ -246,7 +246,7 @@ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\
""" """
TEMPLATE_CL_ENTRY_POINT_NO_RETURN = """\ TEMPLATE_CL_ENTRY_POINT_NO_RETURN = """\
void CL_API_ENTRY CL_{name}({params}) void CL_API_CALL CL_{name}({params})
{{ {{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params}); CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
...@@ -255,7 +255,7 @@ void CL_API_ENTRY CL_{name}({params}) ...@@ -255,7 +255,7 @@ void CL_API_ENTRY CL_{name}({params})
""" """
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
{return_type}CL_API_ENTRY CL_{name}({params}) {return_type}CL_API_CALL CL_{name}({params})
{{ {{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params}); CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
...@@ -327,7 +327,7 @@ CONTEXT_HEADER = """\ ...@@ -327,7 +327,7 @@ CONTEXT_HEADER = """\
CONTEXT_DECL_FORMAT = """ {return_type} {name_lower_no_suffix}({internal_params}){maybe_const}; \\""" CONTEXT_DECL_FORMAT = """ {return_type} {name_lower_no_suffix}({internal_params}){maybe_const}; \\"""
TEMPLATE_CL_ENTRY_POINT_EXPORT = """\ TEMPLATE_CL_ENTRY_POINT_EXPORT = """\
ANGLE_EXPORT {return_type}CL_API_ENTRY cl{name}({params}) CL_API_CALL {return_type} CL_API_CALL cl{name}({params})
{{ {{
EnsureCLLoaded(); EnsureCLLoaded();
return cl_loader.cl{name}({internal_params}); return cl_loader.cl{name}({internal_params});
...@@ -827,7 +827,7 @@ std::unique_ptr<angle::Library> &EntryPointsLib() ...@@ -827,7 +827,7 @@ std::unique_ptr<angle::Library> &EntryPointsLib()
return *sEntryPointsLib; return *sEntryPointsLib;
} }
angle::GenericProc CL_API_ENTRY GlobalLoad(const char *symbol) angle::GenericProc CL_API_CALL GlobalLoad(const char *symbol)
{ {
return reinterpret_cast<angle::GenericProc>(EntryPointsLib()->getSymbol(symbol)); return reinterpret_cast<angle::GenericProc>(EntryPointsLib()->getSymbol(symbol));
} }
...@@ -937,6 +937,9 @@ void EnsureEGLLoaded() {} ...@@ -937,6 +937,9 @@ void EnsureEGLLoaded() {}
LIBCL_HEADER_INCLUDES = """\ LIBCL_HEADER_INCLUDES = """\
#include "export.h" #include "export.h"
#ifndef CL_API_ENTRY
# define CL_API_ENTRY ANGLE_EXPORT
#endif
#include <CL/cl.h> #include <CL/cl.h>
""" """
...@@ -1186,7 +1189,7 @@ def get_api_entry_def(api): ...@@ -1186,7 +1189,7 @@ def get_api_entry_def(api):
if api == apis.EGL: if api == apis.EGL:
return "EGLAPIENTRY" return "EGLAPIENTRY"
elif api == apis.CL: elif api == apis.CL:
return "CL_API_ENTRY" return "CL_API_CALL"
else: else:
return "GL_APIENTRY" return "GL_APIENTRY"
......
DisableFormat: true DisableFormat: true
SortIncludes: false
...@@ -29,28 +29,22 @@ angle_source_set("cl_includes") { ...@@ -29,28 +29,22 @@ angle_source_set("cl_includes") {
] ]
} }
# TODO(jplate): Fix OpenCL headers for Windows http://anglebug.com/5761 angle_shared_library("OpenCL") {
if (is_linux) { defines = [
angle_shared_library("OpenCL") { "CL_TARGET_OPENCL_VERSION=100",
defines = [ "LIBCL_IMPLEMENTATION",
"CL_TARGET_OPENCL_VERSION=100", ]
"LIBCL_IMPLEMENTATION", sources = [
] "cl_loader.h",
sources = [ "cl_loader_autogen.cpp",
"cl_loader.h", "entry_points_cl_autogen.cpp",
"cl_loader_autogen.cpp", "entry_points_cl_autogen.h",
"entry_points_cl_autogen.cpp", "entry_points_cl_utils.h",
"entry_points_cl_autogen.h", "libOpenCL_autogen.cpp",
"entry_points_cl_utils.h", ]
"libOpenCL_autogen.cpp", deps = [ ":cl_includes" ]
]
deps = [ ":cl_includes" ]
}
} }
group("angle_cl") { group("angle_cl") {
# TODO(jplate): Fix OpenCL headers for Windows http://anglebug.com/5761 data_deps = [ ":OpenCL" ]
if (is_linux) {
data_deps = [ ":OpenCL" ]
}
} }
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include <export.h> #include <export.h>
#ifndef CL_API_ENTRY
# define CL_API_ENTRY ANGLE_EXPORT
#endif
#include <CL/cl_icd.h> #include <CL/cl_icd.h>
ANGLE_NO_EXPORT extern cl_icd_dispatch cl_loader; ANGLE_NO_EXPORT extern cl_icd_dispatch cl_loader;
...@@ -18,7 +21,7 @@ ANGLE_NO_EXPORT extern cl_icd_dispatch cl_loader; ...@@ -18,7 +21,7 @@ ANGLE_NO_EXPORT extern cl_icd_dispatch cl_loader;
namespace angle namespace angle
{ {
using GenericProc = void (*)(); using GenericProc = void (*)();
using LoadProc = GenericProc(CL_API_ENTRY *)(const char *); using LoadProc = GenericProc(CL_API_CALL *)(const char *);
ANGLE_NO_EXPORT void LoadCL(LoadProc loadProc); ANGLE_NO_EXPORT void LoadCL(LoadProc loadProc);
} // namespace angle } // namespace angle
......
DisableFormat: true DisableFormat: true
SortIncludes: false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment