#define CL_INVALID_EVENT_WAIT_LIST -57
#define CL_INVALID_EVENT -58
#define CL_INVALID_OPERATION -59
-#define CL_INVALID_GL -60
+#define CL_INVALID_GL_OBJECT -60
#define CL_INVALID_BUFFER_SIZE -61
#define CL_INVALID_MIP_LEVEL -62
#define CL_INVALID_GLOBAL_WORK_SIZE -63
#define CL_FLOAT 0x10DE
/* cl_mem_type */
-#define CL_MEM_BUFFER 0x10F0
-#define CL_MEM_IMAGE2D 0x10F1
-#define CL_MEM_IMAGE3D 0x10F2
+#define CL_MEM_OBJECT_BUFFER 0x10F0
+#define CL_MEM_OBJECT_IMAGE2D 0x10F1
+#define CL_MEM_OBJECT_IMAGE3D 0x10F2
/* cl_mem_info */
#define CL_MEM_TYPE 0x1100
#define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
#define CL_COMMAND_MAP_BUFFER 0x11FB
#define CL_COMMAND_MAP_IMAGE 0x11FC
-#define CL_COMMAND_UNMAP_MEM 0x11FD
+#define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
#define CL_COMMAND_MARKER 0x11FE
-#define CL_COMMAND_ACQUIRE_GLS 0x11FF
-#define CL_COMMAND_RELEASE_GLS 0x1200
+#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
+#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
#define CL_COMMAND_READ_BUFFER_RECT 0x1201
#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
#define CL_COMMAND_COPY_BUFFER_RECT 0x1203
#ifndef __OPENCL_CL_D3D10_H
#define __OPENCL_CL_D3D10_H
+#ifdef __D3D10__
#include <d3d10.h>
+#endif
#include <CL/cl.h>
#include <CL/cl_platform.h>
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
// cl_command_type
-#define CL_COMMAND_ACQUIRE_D3D10S_KHR 0x4017
-#define CL_COMMAND_RELEASE_D3D10S_KHR 0x4018
+#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
+#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
/******************************************************************************/
+#ifndef __D3D10__
+typedef struct {int i;} ID3D10Buffer;
+typedef struct {int i;} ID3D10Texture2D;
+typedef struct {int i;} ID3D10Texture3D;
+#endif
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform,
typedef struct __GLsync *cl_GLsync;
/* cl_gl_object_type */
-#define CL_GL_BUFFER 0x2000
-#define CL_GL_TEXTURE2D 0x2001
-#define CL_GL_TEXTURE3D 0x2002
-#define CL_GL_RENDERBUFFER 0x2003
+#define CL_GL_OBJECT_BUFFER 0x2000
+#define CL_GL_OBJECT_TEXTURE2D 0x2001
+#define CL_GL_OBJECT_TEXTURE3D 0x2002
+#define CL_GL_OBJECT_RENDERBUFFER 0x2003
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_FLT_RADIX 2
#define CL_FLT_MAX 340282346638528859811704183484516925440.0f
#define CL_FLT_MIN 1.175494350822287507969e-38f
-#define CL_FLT_EPSILON 0x1.0p-23f
+#define CL_FLT_EPSILON MAKE_HEX_DOUBLE(0x1.0p-23f, 0x1L, -23)
#define CL_DBL_DIG 15
#define CL_DBL_MANT_DIG 53
cl_uint * num_devices)
{
/* Check parameter consistency */
- if (UNLIKELY(num_entries == 0 && devices == NULL))
+ if (UNLIKELY(num_entries == 0 && devices == NULL && num_devices == NULL))
return CL_SUCCESS;
- if (UNLIKELY(devices == NULL))
+ if (UNLIKELY(devices == NULL && num_devices == NULL))
return CL_INVALID_VALUE;
if (UNLIKELY(platform != NULL && platform != intel_platform))
return CL_INVALID_PLATFORM;
- if (UNLIKELY(device_type == CL_DEVICE_TYPE_CPU))
- return CL_INVALID_DEVICE_TYPE;
+ if (num_devices && (device_type == CL_DEVICE_TYPE_CPU)) {
+ *num_devices = 0;
+ return CL_SUCCESS;
+ }
/* Detect our device (reject a non intel one or gen<6) */
- if (UNLIKELY((*devices = cl_get_gt_device()) != NULL)) {
+ if (devices && UNLIKELY((*devices = cl_get_gt_device()) != NULL)) {
if (num_devices)
*num_devices = 1;
return CL_SUCCESS;
}
else {
if (num_devices)
- *num_devices = 0;
- return CL_DEVICE_NOT_FOUND;
+ *num_devices = 1;
+ return CL_SUCCESS;
}
}