[PATCH 2/2] opencl: Basic OpenCL 1.0 implementation.
Peter Urbanec
peter at urbanec.net
Mon Nov 29 05:10:43 CST 2010
diff --git a/dlls/opencl/opencl.c b/dlls/opencl/opencl.c
index ef316f7..bf8a8be 100644
--- a/dlls/opencl/opencl.c
+++ b/dlls/opencl/opencl.c
@@ -19,11 +19,1153 @@
*/
#include "config.h"
+#include "wine/port.h"
#include "wine/debug.h"
+#include "wine/library.h"
+
+#include "windef.h"
+#include "winbase.h"
WINE_DEFAULT_DEBUG_CHANNEL(opencl);
#ifdef HAVE_OPENCL
#include <CL/opencl.h>
+/* TODO: Figure out how to provide GL context sharing before enabling
OpenGL */
+#define OPENCL_WITH_GL 0
+
+#define MAKE_FUNCPTR(f) static typeof(f) * p##f;
+/* Platform API */
+MAKE_FUNCPTR(clGetPlatformIDs)
+MAKE_FUNCPTR(clGetPlatformInfo)
+
+/* Device APIs */
+MAKE_FUNCPTR(clGetDeviceIDs)
+MAKE_FUNCPTR(clGetDeviceInfo)
+
+/* Context APIs */
+MAKE_FUNCPTR(clCreateContext)
+MAKE_FUNCPTR(clCreateContextFromType)
+MAKE_FUNCPTR(clRetainContext)
+MAKE_FUNCPTR(clReleaseContext)
+MAKE_FUNCPTR(clGetContextInfo)
+
+/* Command Queue APIs */
+MAKE_FUNCPTR(clCreateCommandQueue)
+MAKE_FUNCPTR(clRetainCommandQueue)
+MAKE_FUNCPTR(clReleaseCommandQueue)
+MAKE_FUNCPTR(clGetCommandQueueInfo)
+MAKE_FUNCPTR(clSetCommandQueueProperty)
+
+/* Memory Object APIs */
+MAKE_FUNCPTR(clCreateBuffer)
+MAKE_FUNCPTR(clCreateImage2D)
+MAKE_FUNCPTR(clCreateImage3D)
+MAKE_FUNCPTR(clRetainMemObject)
+MAKE_FUNCPTR(clReleaseMemObject)
+MAKE_FUNCPTR(clGetSupportedImageFormats)
+MAKE_FUNCPTR(clGetMemObjectInfo)
+MAKE_FUNCPTR(clGetImageInfo)
+
+/* Sampler APIs */
+MAKE_FUNCPTR(clCreateSampler)
+MAKE_FUNCPTR(clRetainSampler)
+MAKE_FUNCPTR(clReleaseSampler)
+MAKE_FUNCPTR(clGetSamplerInfo)
+
+/* Program Object APIs */
+MAKE_FUNCPTR(clCreateProgramWithSource)
+MAKE_FUNCPTR(clCreateProgramWithBinary)
+MAKE_FUNCPTR(clRetainProgram)
+MAKE_FUNCPTR(clReleaseProgram)
+MAKE_FUNCPTR(clBuildProgram)
+MAKE_FUNCPTR(clUnloadCompiler)
+MAKE_FUNCPTR(clGetProgramInfo)
+MAKE_FUNCPTR(clGetProgramBuildInfo)
+
+/* Kernel Object APIs */
+MAKE_FUNCPTR(clCreateKernel)
+MAKE_FUNCPTR(clCreateKernelsInProgram)
+MAKE_FUNCPTR(clRetainKernel)
+MAKE_FUNCPTR(clReleaseKernel)
+MAKE_FUNCPTR(clSetKernelArg)
+MAKE_FUNCPTR(clGetKernelInfo)
+MAKE_FUNCPTR(clGetKernelWorkGroupInfo)
+
+/* Event Object APIs */
+MAKE_FUNCPTR(clWaitForEvents)
+MAKE_FUNCPTR(clGetEventInfo)
+MAKE_FUNCPTR(clRetainEvent)
+MAKE_FUNCPTR(clReleaseEvent)
+
+/* Profiling APIs */
+MAKE_FUNCPTR(clGetEventProfilingInfo)
+
+/* Flush and Finish APIs */
+MAKE_FUNCPTR(clFlush)
+MAKE_FUNCPTR(clFinish)
+
+/* Enqueued Commands APIs */
+MAKE_FUNCPTR(clEnqueueReadBuffer)
+MAKE_FUNCPTR(clEnqueueWriteBuffer)
+MAKE_FUNCPTR(clEnqueueCopyBuffer)
+MAKE_FUNCPTR(clEnqueueReadImage)
+MAKE_FUNCPTR(clEnqueueWriteImage)
+MAKE_FUNCPTR(clEnqueueCopyImage)
+MAKE_FUNCPTR(clEnqueueCopyImageToBuffer)
+MAKE_FUNCPTR(clEnqueueCopyBufferToImage)
+MAKE_FUNCPTR(clEnqueueMapBuffer)
+MAKE_FUNCPTR(clEnqueueMapImage)
+MAKE_FUNCPTR(clEnqueueUnmapMemObject)
+MAKE_FUNCPTR(clEnqueueNDRangeKernel)
+MAKE_FUNCPTR(clEnqueueTask)
+MAKE_FUNCPTR(clEnqueueNativeKernel)
+MAKE_FUNCPTR(clEnqueueMarker)
+MAKE_FUNCPTR(clEnqueueWaitForEvents)
+MAKE_FUNCPTR(clEnqueueBarrier)
+
+/* Extension function access */
+MAKE_FUNCPTR(clGetExtensionFunctionAddress)
+
+#if OPENCL_WITH_GL
+/* Khronos-approved (KHR) OpenCL extensions which have OpenGL
dependencies. */
+MAKE_FUNCPTR(clCreateFromGLBuffer)
+MAKE_FUNCPTR(clCreateFromGLTexture2D)
+MAKE_FUNCPTR(clCreateFromGLTexture3D)
+MAKE_FUNCPTR(clCreateFromGLRenderbuffer)
+MAKE_FUNCPTR(clGetGLObjectInfo)
+MAKE_FUNCPTR(clGetGLTextureInfo)
+MAKE_FUNCPTR(clEnqueueAcquireGLObjects)
+MAKE_FUNCPTR(clEnqueueReleaseGLObjects)
+/* MAKE_FUNCPTR(clGetGLContextInfoKHR) */
+#endif
+
+#undef MAKE_FUNCPTR
+
+
+static BOOL load_funcs(void *handle)
+{
+#define LOAD_FUNCPTR(f) if((p##f = (void*)wine_dlsym(handle, #f, NULL,
0)) == NULL) \
+ { ERR("Can not find " #f "\n"); return FALSE; } else {
TRACE("Loaded function " #f "\n"); };
+
+ /* Platform API */
+ LOAD_FUNCPTR(clGetPlatformIDs)
+ LOAD_FUNCPTR(clGetPlatformInfo)
+
+ /* Device APIs */
+ LOAD_FUNCPTR(clGetDeviceIDs)
+ LOAD_FUNCPTR(clGetDeviceInfo)
+
+ /* Context APIs */
+ LOAD_FUNCPTR(clCreateContext)
+ LOAD_FUNCPTR(clCreateContextFromType)
+ LOAD_FUNCPTR(clRetainContext)
+ LOAD_FUNCPTR(clReleaseContext)
+ LOAD_FUNCPTR(clGetContextInfo)
+
+ /* Command Queue APIs */
+ LOAD_FUNCPTR(clCreateCommandQueue)
+ LOAD_FUNCPTR(clRetainCommandQueue)
+ LOAD_FUNCPTR(clReleaseCommandQueue)
+ LOAD_FUNCPTR(clGetCommandQueueInfo)
+ LOAD_FUNCPTR(clSetCommandQueueProperty)
+
+ /* Memory Object APIs */
+ LOAD_FUNCPTR(clCreateBuffer)
+ LOAD_FUNCPTR(clCreateImage2D)
+ LOAD_FUNCPTR(clCreateImage3D)
+ LOAD_FUNCPTR(clRetainMemObject)
+ LOAD_FUNCPTR(clReleaseMemObject)
+ LOAD_FUNCPTR(clGetSupportedImageFormats)
+ LOAD_FUNCPTR(clGetMemObjectInfo)
+ LOAD_FUNCPTR(clGetImageInfo)
+
+ /* Sampler APIs */
+ LOAD_FUNCPTR(clCreateSampler)
+ LOAD_FUNCPTR(clRetainSampler)
+ LOAD_FUNCPTR(clReleaseSampler)
+ LOAD_FUNCPTR(clGetSamplerInfo)
+
+ /* Program Object APIs */
+ LOAD_FUNCPTR(clCreateProgramWithSource)
+ LOAD_FUNCPTR(clCreateProgramWithBinary)
+ LOAD_FUNCPTR(clRetainProgram)
+ LOAD_FUNCPTR(clReleaseProgram)
+ LOAD_FUNCPTR(clBuildProgram)
+ LOAD_FUNCPTR(clUnloadCompiler)
+ LOAD_FUNCPTR(clGetProgramInfo)
+ LOAD_FUNCPTR(clGetProgramBuildInfo)
+
+ /* Kernel Object APIs */
+ LOAD_FUNCPTR(clCreateKernel)
+ LOAD_FUNCPTR(clCreateKernelsInProgram)
+ LOAD_FUNCPTR(clRetainKernel)
+ LOAD_FUNCPTR(clReleaseKernel)
+ LOAD_FUNCPTR(clSetKernelArg)
+ LOAD_FUNCPTR(clGetKernelInfo)
+ LOAD_FUNCPTR(clGetKernelWorkGroupInfo)
+
+ /* Event Object APIs */
+ LOAD_FUNCPTR(clWaitForEvents)
+ LOAD_FUNCPTR(clGetEventInfo)
+ LOAD_FUNCPTR(clRetainEvent)
+ LOAD_FUNCPTR(clReleaseEvent)
+
+ /* Profiling APIs */
+ LOAD_FUNCPTR(clGetEventProfilingInfo)
+
+ /* Flush and Finish APIs */
+ LOAD_FUNCPTR(clFlush)
+ LOAD_FUNCPTR(clFinish)
+
+ /* Enqueued Commands APIs */
+ LOAD_FUNCPTR(clEnqueueReadBuffer)
+ LOAD_FUNCPTR(clEnqueueWriteBuffer)
+ LOAD_FUNCPTR(clEnqueueCopyBuffer)
+ LOAD_FUNCPTR(clEnqueueReadImage)
+ LOAD_FUNCPTR(clEnqueueWriteImage)
+ LOAD_FUNCPTR(clEnqueueCopyImage)
+ LOAD_FUNCPTR(clEnqueueCopyImageToBuffer)
+ LOAD_FUNCPTR(clEnqueueCopyBufferToImage)
+ LOAD_FUNCPTR(clEnqueueMapBuffer)
+ LOAD_FUNCPTR(clEnqueueMapImage)
+ LOAD_FUNCPTR(clEnqueueUnmapMemObject)
+ LOAD_FUNCPTR(clEnqueueNDRangeKernel)
+ LOAD_FUNCPTR(clEnqueueTask)
+ LOAD_FUNCPTR(clEnqueueNativeKernel)
+ LOAD_FUNCPTR(clEnqueueMarker)
+ LOAD_FUNCPTR(clEnqueueWaitForEvents)
+ LOAD_FUNCPTR(clEnqueueBarrier)
+
+ /* Extension function access */
+ LOAD_FUNCPTR(clGetExtensionFunctionAddress)
+
+#if OPENCL_WITH_GL
+ /* Khronos-approved (KHR) OpenCL extensions which have OpenGL
dependencies. */
+ LOAD_FUNCPTR(clCreateFromGLBuffer)
+ LOAD_FUNCPTR(clCreateFromGLTexture2D)
+ LOAD_FUNCPTR(clCreateFromGLTexture3D)
+ LOAD_FUNCPTR(clCreateFromGLRenderbuffer)
+ LOAD_FUNCPTR(clGetGLObjectInfo)
+ LOAD_FUNCPTR(clGetGLTextureInfo)
+ LOAD_FUNCPTR(clEnqueueAcquireGLObjects)
+ LOAD_FUNCPTR(clEnqueueReleaseGLObjects)
+/* LOAD_FUNCPTR(clGetGLContextInfoKHR) */
+#endif
+
+#undef LOAD_FUNCPTR
+ return TRUE;
+}
+
+static HMODULE opencl_handle;
+static void* libOpenCL_handle = NULL;
+
+static BOOL process_attach(void)
+{
+ void *handle;
+ if (libOpenCL_handle) return TRUE;
+
+ handle = wine_dlopen(SONAME_LIBOPENCL, RTLD_NOW, NULL, 0);
+ if (!handle)
+ {
+ ERR("Can not load %s.\n", SONAME_LIBOPENCL);
+ return FALSE;
+ }
+
+ if (!load_funcs(handle))
+ {
+ wine_dlclose(handle, NULL, 0);
+ return FALSE;
+ }
+
+ TRACE("Loaded %s\n", SONAME_LIBOPENCL);
+ libOpenCL_handle = handle;
+ return TRUE;
+}
+
+static void process_detach(void)
+{
+ if (libOpenCL_handle) wine_dlclose(libOpenCL_handle, NULL, 0);
+ libOpenCL_handle = NULL;
+}
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID
lpvReserved)
+{
+ TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ opencl_handle = hinstDLL;
+ DisableThreadLibraryCalls(hinstDLL);
+ return process_attach();
+ case DLL_PROCESS_DETACH:
+ process_detach();
+ break;
+ }
+
+ return TRUE;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Platform API */
+
+cl_int WINAPI wine_clGetPlatformIDs(cl_uint num_entries, cl_platform_id
*platforms, cl_uint *num_platforms)
+{
+ cl_int ret;
+ TRACE("(%d, %p, %p)\n", num_entries, platforms, num_platforms);
+ ret = pclGetPlatformIDs(num_entries, platforms, num_platforms);
+ TRACE("(%d, %p, %p)=%d\n", num_entries, platforms, num_platforms, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetPlatformInfo(cl_platform_id platform,
cl_platform_info param_name,
+ size_t param_value_size, void *
param_value, size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("(%p, 0x%x, %d, %p, %p)\n", platform, param_name,
param_value_size, param_value, param_value_size_ret);
+
+ /* Hide all extensions.
+ * TODO: Add individual extension support as needed.
+ */
+ if (param_name == CL_PLATFORM_EXTENSIONS)
+ {
+ ret = CL_INVALID_VALUE;
+
+ if (param_value && param_value_size > 0)
+ {
+ char *exts = (char *) param_value;
+ exts[0] = '\0';
+ ret = CL_SUCCESS;
+ }
+
+ if (param_value_size_ret)
+ {
+ *param_value_size_ret = 1;
+ ret = CL_SUCCESS;
+ }
+ }
+ else
+ {
+ ret = pclGetPlatformInfo(platform, param_name,
param_value_size, param_value, param_value_size_ret);
+ }
+
+ TRACE("(%p, 0x%x, %d, %p, %p)=%d\n", platform, param_name,
param_value_size, param_value, param_value_size_ret, ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Device APIs */
+
+cl_int WINAPI wine_clGetDeviceIDs(cl_platform_id platform,
cl_device_type device_type,
+ cl_uint num_entries, cl_device_id *
devices, cl_uint * num_devices)
+{
+ cl_int ret;
+ TRACE("(%p, 0x%lx, %d, %p, %p)\n", platform, (long unsigned
int)device_type, num_entries, devices, num_devices);
+ ret = pclGetDeviceIDs(platform, device_type, num_entries, devices,
num_devices);
+ TRACE("(%p, 0x%lx, %d, %p, %p)=%d\n", platform, (long unsigned
int)device_type, num_entries, devices, num_devices, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetDeviceInfo(cl_device_id device, cl_device_info
param_name,
+ size_t param_value_size, void *
param_value, size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("(%p, 0x%x, %d, %p, %p)\n",device, param_name,
param_value_size, param_value, param_value_size_ret);
+
+ /* Hide all extensions.
+ * TODO: Add individual extension support as needed.
+ */
+ if (param_name == CL_DEVICE_EXTENSIONS)
+ {
+ ret = CL_INVALID_VALUE;
+
+ if (param_value && param_value_size > 0)
+ {
+ char *exts = (char *) param_value;
+ exts[0] = '\0';
+ ret = CL_SUCCESS;
+ }
+
+ if (param_value_size_ret)
+ {
+ *param_value_size_ret = 1;
+ ret = CL_SUCCESS;
+ }
+ }
+ else
+ {
+ ret = pclGetDeviceInfo(device, param_name, param_value_size,
param_value, param_value_size_ret);
+ }
+
+ /* Filter out the CL_EXEC_NATIVE_KERNEL flag */
+ if (param_name == CL_DEVICE_EXECUTION_CAPABILITIES)
+ {
+ cl_device_exec_capabilities *caps =
(cl_device_exec_capabilities *) param_value;
+ *caps &= ~CL_EXEC_NATIVE_KERNEL;
+ }
+
+ TRACE("(%p, 0x%x, %d, %p, %p)=%d\n",device, param_name,
param_value_size, param_value, param_value_size_ret, ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Context APIs */
+
+typedef struct
+{
+ void WINAPI (*pfn_notify)(const char *errinfo, const void
*private_info, size_t cb, void *user_data);
+ void *user_data;
+} CONTEXT_CALLBACK;
+
+static void context_fn_notify(const char *errinfo, const void
*private_info, size_t cb, void *user_data)
+{
+ CONTEXT_CALLBACK *ccb;
+ TRACE("(%s, %p, %d, %p)\n", errinfo, private_info, cb, user_data);
+ ccb = (CONTEXT_CALLBACK *) user_data;
+ if(ccb->pfn_notify) ccb->pfn_notify(errinfo, private_info, cb,
ccb->user_data);
+ TRACE("Callback COMPLETED\n");
+}
+
+cl_context WINAPI wine_clCreateContext(const cl_context_properties *
properties, cl_uint num_devices, const cl_device_id * devices,
+ void WINAPI (*pfn_notify)(const
char *errinfo, const void *private_info, size_t cb, void *user_data),
+ void * user_data, cl_int *
errcode_ret)
+{
+ cl_context ret;
+ CONTEXT_CALLBACK *ccb;
+ TRACE("(%p, %d, %p, %p, %p, %p)\n", properties, num_devices,
devices, pfn_notify, user_data, errcode_ret);
+ /* FIXME: The CONTEXT_CALLBACK structure is currently leaked.
+ * Pointers to callback redirectors should be remembered and
free()d when the context is destroyed.
+ * The problem is determining when a context is being destroyed.
clReleaseContext only decrements
+ * the use count for a context, it's destruction can come much
later and therefore there is a risk
+ * that the callback could be invoked after the user_data memory
has been free()d.
+ */
+ ccb = HeapAlloc(GetProcessHeap(), 0, sizeof(CONTEXT_CALLBACK));
+ ccb->pfn_notify = pfn_notify;
+ ccb->user_data = user_data;
+ ret = pclCreateContext(properties, num_devices, devices,
context_fn_notify, ccb, errcode_ret);
+ TRACE("(%p, %d, %p, %p, %p, %p (%d)))=%p\n", properties,
num_devices, devices, &pfn_notify, user_data, errcode_ret, errcode_ret ?
*errcode_ret : 0, ret);
+ return ret;
+}
+
+cl_context WINAPI wine_clCreateContextFromType(const
cl_context_properties * properties, cl_device_type device_type,
+ void WINAPI
(*pfn_notify)(const char *errinfo, const void *private_info, size_t cb,
void *user_data),
+ void * user_data, cl_int
* errcode_ret)
+{
+ cl_context ret;
+ CONTEXT_CALLBACK *ccb;
+ TRACE("(%p, 0x%lx, %p, %p, %p)\n", properties, (long unsigned
int)device_type, pfn_notify, user_data, errcode_ret);
+ /* FIXME: The CONTEXT_CALLBACK structure is currently leaked.
+ * Pointers to callback redirectors should be remembered and
free()d when the context is destroyed.
+ * The problem is determining when a context is being destroyed.
clReleaseContext only decrements
+ * the use count for a context, it's destruction can come much
later and therefore there is a risk
+ * that the callback could be invoked after the user_data memory
has been free()d.
+ */
+ ccb = HeapAlloc(GetProcessHeap(), 0, sizeof(CONTEXT_CALLBACK));
+ ccb->pfn_notify = pfn_notify;
+ ccb->user_data = user_data;
+ ret = pclCreateContextFromType(properties, device_type,
context_fn_notify, ccb, errcode_ret);
+ TRACE("(%p, 0x%lx, %p, %p, %p (%d)))=%p\n", properties, (long
unsigned int)device_type, pfn_notify, user_data, errcode_ret,
errcode_ret ? *errcode_ret : 0, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainContext(cl_context context)
+{
+ cl_int ret;
+ TRACE("(%p)\n", context);
+ ret = pclRetainContext(context);
+ TRACE("(%p)=%d\n", context, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseContext(cl_context context)
+{
+ cl_int ret;
+ TRACE("(%p)\n", context);
+ ret = pclReleaseContext(context);
+ TRACE("(%p)=%d\n", context, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetContextInfo(cl_context context, cl_context_info
param_name,
+ size_t param_value_size, void *
param_value, size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("(%p, 0x%x, %d, %p, %p)\n", context, param_name,
param_value_size, param_value, param_value_size_ret);
+ ret = pclGetContextInfo(context, param_name, param_value_size,
param_value, param_value_size_ret);
+ TRACE("(%p, 0x%x, %d, %p, %p)=%d\n", context, param_name,
param_value_size, param_value, param_value_size_ret, ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Command Queue APIs */
+
+cl_command_queue WINAPI wine_clCreateCommandQueue(cl_context context,
cl_device_id device,
+
cl_command_queue_properties properties, cl_int * errcode_ret)
+{
+ cl_command_queue ret;
+ TRACE("(%p, %p, 0x%lx, %p)\n", context, device, (long unsigned
int)properties, errcode_ret);
+ ret = pclCreateCommandQueue(context, device, properties, errcode_ret);
+ TRACE("(%p, %p, 0x%lx, %p)=%p\n", context, device, (long unsigned
int)properties, errcode_ret, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainCommandQueue(cl_command_queue command_queue)
+{
+ cl_int ret;
+ TRACE("(%p)\n", command_queue);
+ ret = pclRetainCommandQueue(command_queue);
+ TRACE("(%p)=%d\n", command_queue, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseCommandQueue(cl_command_queue command_queue)
+{
+ cl_int ret;
+ TRACE("(%p)\n", command_queue);
+ ret = pclReleaseCommandQueue(command_queue);
+ TRACE("(%p)=%d\n", command_queue, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetCommandQueueInfo(cl_command_queue
command_queue, cl_command_queue_info param_name,
+ size_t param_value_size, void
* param_value, size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("%p, %d, %d, %p, %p\n", command_queue, param_name,
param_value_size, param_value, param_value_size_ret);
+ ret = pclGetCommandQueueInfo(command_queue, param_name,
param_value_size, param_value, param_value_size_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clSetCommandQueueProperty(cl_command_queue
command_queue, cl_command_queue_properties properties, cl_bool enable,
+
cl_command_queue_properties * old_properties)
+{
+ cl_int ret;
+ TRACE("%p, 0x%lx, %d, %p\n", command_queue, (long unsigned
int)properties, enable, old_properties);
+ ret = pclSetCommandQueueProperty(command_queue, properties, enable,
old_properties);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Memory Object APIs */
+
+cl_mem WINAPI wine_clCreateBuffer(cl_context context, cl_mem_flags
flags, size_t size, void * host_ptr, cl_int * errcode_ret)
+{
+ cl_mem ret;
+ TRACE("\n");
+ ret = pclCreateBuffer(context, flags, size, host_ptr, errcode_ret);
+ return ret;
+}
+
+cl_mem WINAPI wine_clCreateImage2D(cl_context context, cl_mem_flags
flags, cl_image_format * image_format,
+ size_t image_width, size_t
image_height, size_t image_row_pitch, void * host_ptr, cl_int * errcode_ret)
+{
+ cl_mem ret;
+ TRACE("\n");
+ ret = pclCreateImage2D(context, flags, image_format, image_width,
image_height, image_row_pitch, host_ptr, errcode_ret);
+ return ret;
+}
+
+cl_mem WINAPI wine_clCreateImage3D(cl_context context, cl_mem_flags
flags, cl_image_format * image_format,
+ size_t image_width, size_t
image_height, size_t image_depth, size_t image_row_pitch, size_t
image_slice_pitch,
+ void * host_ptr, cl_int * errcode_ret)
+{
+ cl_mem ret;
+ TRACE("\n");
+ ret = pclCreateImage3D(context, flags, image_format, image_width,
image_height, image_depth, image_row_pitch, image_slice_pitch, host_ptr,
errcode_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainMemObject(cl_mem memobj)
+{
+ cl_int ret;
+ TRACE("(%p)\n", memobj);
+ ret = pclRetainMemObject(memobj);
+ TRACE("(%p)=%d\n", memobj, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseMemObject(cl_mem memobj)
+{
+ cl_int ret;
+ TRACE("(%p)\n", memobj);
+ ret = pclReleaseMemObject(memobj);
+ TRACE("(%p)=%d\n", memobj, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetSupportedImageFormats(cl_context context,
cl_mem_flags flags, cl_mem_object_type image_type, cl_uint num_entries,
+ cl_image_format *
image_formats, cl_uint * num_image_formats)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetSupportedImageFormats(context, flags, image_type,
num_entries, image_formats, num_image_formats);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetMemObjectInfo(cl_mem memobj, cl_mem_info
param_name, size_t param_value_size, void * param_value, size_t *
param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetMemObjectInfo(memobj, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetImageInfo(cl_mem image, cl_image_info
param_name, size_t param_value_size, void * param_value, size_t *
param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetImageInfo(image, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Sampler APIs */
+
+cl_sampler WINAPI wine_clCreateSampler(cl_context context, cl_bool
normalized_coords, cl_addressing_mode addressing_mode,
+ cl_filter_mode filter_mode,
cl_int * errcode_ret)
+{
+ cl_sampler ret;
+ TRACE("\n");
+ ret = pclCreateSampler(context, normalized_coords, addressing_mode,
filter_mode, errcode_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainSampler(cl_sampler sampler)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclRetainSampler(sampler);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseSampler(cl_sampler sampler)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclReleaseSampler(sampler);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetSamplerInfo(cl_sampler sampler, cl_sampler_info
param_name, size_t param_value_size,
+ void * param_value, size_t *
param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetSamplerInfo(sampler, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Program Object APIs */
+
+cl_program WINAPI wine_clCreateProgramWithSource(cl_context context,
cl_uint count, const char ** strings,
+ const size_t *
lengths, cl_int * errcode_ret)
+{
+ cl_program ret;
+ TRACE("\n");
+ ret = pclCreateProgramWithSource(context, count, strings, lengths,
errcode_ret);
+ return ret;
+}
+
+cl_program WINAPI wine_clCreateProgramWithBinary(cl_context context,
cl_uint num_devices, const cl_device_id * device_list,
+ const size_t *
lengths, const unsigned char ** binaries, cl_int * binary_status,
+ cl_int * errcode_ret)
+{
+ cl_program ret;
+ TRACE("\n");
+ ret = pclCreateProgramWithBinary(context, num_devices, device_list,
lengths, binaries, binary_status, errcode_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainProgram(cl_program program)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclRetainProgram(program);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseProgram(cl_program program)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclReleaseProgram(program);
+ return ret;
+}
+
+typedef struct
+{
+ void WINAPI (*pfn_notify)(cl_program program, void * user_data);
+ void *user_data;
+} PROGRAM_CALLBACK;
+
+static void program_fn_notify(cl_program program, void * user_data)
+{
+ PROGRAM_CALLBACK *pcb;
+ TRACE("(%p, %p)\n", program, user_data);
+ pcb = (PROGRAM_CALLBACK *) user_data;
+ pcb->pfn_notify(program, pcb->user_data);
+ HeapFree(GetProcessHeap(), 0, pcb);
+ TRACE("Callback COMPLETED\n");
+}
+
+cl_int WINAPI wine_clBuildProgram(cl_program program, cl_uint
num_devices, const cl_device_id * device_list, const char * options,
+ void WINAPI (*pfn_notify)(cl_program
program, void * user_data),
+ void * user_data)
+{
+ cl_int ret;
+ TRACE("\n");
+ if(pfn_notify)
+ {
+ /* When pfn_notify is provided, clBuildProgram is asynchronous */
+ PROGRAM_CALLBACK *pcb;
+ pcb = HeapAlloc(GetProcessHeap(), 0, sizeof(PROGRAM_CALLBACK));
+ pcb->pfn_notify = pfn_notify;
+ pcb->user_data = user_data;
+ ret = pclBuildProgram(program, num_devices, device_list,
options, program_fn_notify, pcb);
+ }
+ else
+ {
+ /* When pfn_notify is NULL, clBuildProgram is synchronous */
+ ret = pclBuildProgram(program, num_devices, device_list,
options, NULL, user_data);
+ }
+ return ret;
+}
+
+cl_int WINAPI wine_clUnloadCompiler(void)
+{
+ cl_int ret;
+ TRACE("()\n");
+ ret = pclUnloadCompiler();
+ TRACE("()=%d\n", ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetProgramInfo(cl_program program, cl_program_info
param_name,
+ size_t param_value_size, void *
param_value, size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetProgramInfo(program, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetProgramBuildInfo(cl_program program,
cl_device_id device,
+ cl_program_build_info
param_name, size_t param_value_size, void * param_value,
+ size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetProgramBuildInfo(program, device, param_name,
param_value_size, param_value, param_value_size_ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Kernel Object APIs */
+
+cl_kernel WINAPI wine_clCreateKernel(cl_program program, char *
kernel_name, cl_int * errcode_ret)
+{
+ cl_kernel ret;
+ TRACE("\n");
+ ret = pclCreateKernel(program, kernel_name, errcode_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clCreateKernelsInProgram(cl_program program, cl_uint
num_kernels,
+ cl_kernel * kernels,
cl_uint * num_kernels_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclCreateKernelsInProgram(program, num_kernels, kernels,
num_kernels_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainKernel(cl_kernel kernel)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclRetainKernel(kernel);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseKernel(cl_kernel kernel)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclReleaseKernel(kernel);
+ return ret;
+}
+
+cl_int WINAPI wine_clSetKernelArg(cl_kernel kernel, cl_uint arg_index,
size_t arg_size, void * arg_value)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclSetKernelArg(kernel, arg_index, arg_size, arg_value);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetKernelInfo(cl_kernel kernel, cl_kernel_info
param_name,
+ size_t param_value_size, void *
param_value, size_t * param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetKernelInfo(kernel, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetKernelWorkGroupInfo(cl_kernel kernel,
cl_device_id device,
+ cl_kernel_work_group_info
param_name, size_t param_value_size,
+ void * param_value, size_t
* param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetKernelWorkGroupInfo(kernel, device, param_name,
param_value_size, param_value, param_value_size_ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Event Object APIs */
+
+cl_int WINAPI wine_clWaitForEvents(cl_uint num_events, cl_event *
event_list)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclWaitForEvents(num_events, event_list);
+ return ret;
+}
+
+cl_int WINAPI wine_clGetEventInfo(cl_event event, cl_event_info
param_name, size_t param_value_size,
+ void * param_value, size_t *
param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetEventInfo(event, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clRetainEvent(cl_event event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclRetainEvent(event);
+ return ret;
+}
+
+cl_int WINAPI wine_clReleaseEvent(cl_event event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclReleaseEvent(event);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Profiling APIs */
+
+cl_int WINAPI wine_clGetEventProfilingInfo(cl_event event,
cl_profiling_info param_name, size_t param_value_size,
+ void * param_value, size_t *
param_value_size_ret)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclGetEventProfilingInfo(event, param_name, param_value_size,
param_value, param_value_size_ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Flush and Finish APIs */
+
+cl_int WINAPI wine_clFlush(cl_command_queue command_queue)
+{
+ cl_int ret;
+ TRACE("(%p)\n", command_queue);
+ ret = pclFlush(command_queue);
+ TRACE("(%p)=%d\n", command_queue, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clFinish(cl_command_queue command_queue)
+{
+ cl_int ret;
+ TRACE("(%p)\n", command_queue);
+ ret = pclFinish(command_queue);
+ TRACE("(%p)=%d\n", command_queue, ret);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Enqueued Commands APIs */
+
+cl_int WINAPI wine_clEnqueueReadBuffer(cl_command_queue command_queue,
cl_mem buffer, cl_bool blocking_read,
+ size_t offset, size_t cb, void *
ptr,
+ cl_uint num_events_in_wait_list,
const cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueReadBuffer(command_queue, buffer, blocking_read,
offset, cb, ptr, num_events_in_wait_list, event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueWriteBuffer(cl_command_queue command_queue,
cl_mem buffer, cl_bool blocking_write,
+ size_t offset, size_t cb, const
void * ptr,
+ cl_uint
num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueWriteBuffer(command_queue, buffer, blocking_write,
offset, cb, ptr, num_events_in_wait_list, event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueCopyBuffer(cl_command_queue command_queue,
cl_mem src_buffer, cl_mem dst_buffer,
+ size_t src_offset, size_t
dst_offset, size_t cb,
+ cl_uint num_events_in_wait_list,
const cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueCopyBuffer(command_queue, src_buffer, dst_buffer,
src_offset, dst_offset, cb, num_events_in_wait_list, event_wait_list,
event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueReadImage(cl_command_queue command_queue,
cl_mem image, cl_bool blocking_read,
+ const size_t * origin, const
size_t * region,
+ size_t row_pitch, size_t
slice_pitch, void * ptr,
+ cl_uint num_events_in_wait_list,
const cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("(%p, %p, %d, %p, %p, %d, %d, %p, %d, %p, %p)\n",
command_queue, image, blocking_read,
+ origin, region, row_pitch, slice_pitch, ptr,
num_events_in_wait_list, event_wait_list, event);
+ ret = pclEnqueueReadImage(command_queue, image, blocking_read,
origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list,
event_wait_list, event);
+ TRACE("(%p, %p, %d, %p, %p, %d, %d, %p, %d, %p, %p)=%d\n",
command_queue, image, blocking_read,
+ origin, region, row_pitch, slice_pitch, ptr,
num_events_in_wait_list, event_wait_list, event, ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueWriteImage(cl_command_queue command_queue,
cl_mem image, cl_bool blocking_write,
+ const size_t * origin, const
size_t * region,
+ size_t input_row_pitch, size_t
input_slice_pitch, const void * ptr,
+ cl_uint num_events_in_wait_list,
const cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueWriteImage(command_queue, image, blocking_write,
origin, region, input_row_pitch, input_slice_pitch, ptr,
num_events_in_wait_list, event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueCopyImage(cl_command_queue command_queue,
cl_mem src_image, cl_mem dst_image,
+ size_t * src_origin, size_t *
dst_origin, size_t * region,
+ cl_uint num_events_in_wait_list,
cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueCopyImage(command_queue, src_image, dst_image,
src_origin, dst_origin, region, num_events_in_wait_list,
event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueCopyImageToBuffer(cl_command_queue
command_queue, cl_mem src_image, cl_mem dst_buffer,
+ size_t * src_origin,
size_t * region, size_t dst_offset,
+ cl_uint
num_events_in_wait_list, cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueCopyImageToBuffer(command_queue, src_image,
dst_buffer, src_origin, region, dst_offset, num_events_in_wait_list,
event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueCopyBufferToImage(cl_command_queue
command_queue, cl_mem src_buffer, cl_mem dst_image,
+ size_t src_offset, size_t
* dst_origin, size_t * region,
+ cl_uint
num_events_in_wait_list, cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueCopyBufferToImage(command_queue, src_buffer,
dst_image, src_offset, dst_origin, region, num_events_in_wait_list,
event_wait_list, event);
+ return ret;
+}
+
+void * WINAPI wine_clEnqueueMapBuffer(cl_command_queue command_queue,
cl_mem buffer, cl_bool blocking_map,
+ cl_map_flags map_flags, size_t
offset, size_t cb,
+ cl_uint num_events_in_wait_list,
cl_event * event_wait_list, cl_event * event, cl_int * errcode_ret)
+{
+ void * ret;
+ TRACE("\n");
+ ret = pclEnqueueMapBuffer(command_queue, buffer, blocking_map,
map_flags, offset, cb, num_events_in_wait_list, event_wait_list, event,
errcode_ret);
+ return ret;
+}
+
+void * WINAPI wine_clEnqueueMapImage(cl_command_queue command_queue,
cl_mem image, cl_bool blocking_map,
+ cl_map_flags map_flags, size_t *
origin, size_t * region,
+ size_t * image_row_pitch, size_t *
image_slice_pitch,
+ cl_uint num_events_in_wait_list,
cl_event * event_wait_list, cl_event * event, cl_int * errcode_ret)
+{
+ void * ret;
+ TRACE("\n");
+ ret = pclEnqueueMapImage(command_queue, image, blocking_map,
map_flags, origin, region, image_row_pitch, image_slice_pitch,
num_events_in_wait_list, event_wait_list, event, errcode_ret);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueUnmapMemObject(cl_command_queue
command_queue, cl_mem memobj, void * mapped_ptr,
+ cl_uint
num_events_in_wait_list, cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueUnmapMemObject(command_queue, memobj, mapped_ptr,
num_events_in_wait_list, event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueNDRangeKernel(cl_command_queue
command_queue, cl_kernel kernel, cl_uint work_dim,
+ size_t * global_work_offset,
size_t * global_work_size, size_t * local_work_size,
+ cl_uint
num_events_in_wait_list, cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueNDRangeKernel(command_queue, kernel, work_dim,
global_work_offset, global_work_size, local_work_size,
num_events_in_wait_list, event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueTask(cl_command_queue command_queue,
cl_kernel kernel,
+ cl_uint num_events_in_wait_list,
cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueTask(command_queue, kernel,
num_events_in_wait_list, event_wait_list, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueNativeKernel(cl_command_queue command_queue,
+ void WINAPI (*user_func)(void
*args),
+ void * args, size_t cb_args,
+ cl_uint num_mem_objects, const
cl_mem * mem_list, const void ** args_mem_loc,
+ cl_uint
num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
+{
+ cl_int ret = CL_INVALID_OPERATION;
+ /* FIXME: There appears to be no obvious method for translating the
ABI for user_func.
+ * There is no opaque user_data structure passed, that could
encapsulate the return address.
+ * The OpenCL specification seems to indicate that args has an
implementation specific
+ * structure that can not be used to stash away a return address
for the WINAPI user_func.
+ */
+#if 0
+ ret = pclEnqueueNativeKernel(command_queue, user_func, args,
cb_args, num_mem_objects, mem_list, args_mem_loc,
+ num_events_in_wait_list,
event_wait_list, event);
+#else
+ FIXME("not supported due to user_func ABI mismatch\n");
+#endif
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueMarker(cl_command_queue command_queue,
cl_event * event)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueMarker(command_queue, event);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueWaitForEvents(cl_command_queue
command_queue, cl_uint num_events, cl_event * event_list)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueWaitForEvents(command_queue, num_events, event_list);
+ return ret;
+}
+
+cl_int WINAPI wine_clEnqueueBarrier(cl_command_queue command_queue)
+{
+ cl_int ret;
+ TRACE("\n");
+ ret = pclEnqueueBarrier(command_queue);
+ return ret;
+}
+
+
+/*---------------------------------------------------------------*/
+/* Extension function access */
+
+void * WINAPI wine_clGetExtensionFunctionAddress(const char * func_name)
+{
+ void * ret = 0;
+ TRACE("(%s)\n",func_name);
+#if 0
+ ret = pclGetExtensionFunctionAddress(func_name);
+#else
+ FIXME("extensions not implemented\n");
+#endif
+ TRACE("(%s)=%p\n",func_name, ret);
+ return ret;
+}
+
+
+#if OPENCL_WITH_GL
+/*---------------------------------------------------------------*/
+/* Khronos-approved (KHR) OpenCL extensions which have OpenGL
dependencies. */
+
+cl_mem WINAPI wine_clCreateFromGLBuffer(cl_context context,
cl_mem_flags flags, cl_GLuint bufobj, int * errcode_ret)
+{
+}
+
+cl_mem WINAPI wine_clCreateFromGLTexture2D(cl_context context,
cl_mem_flags flags, cl_GLenum target,
+ cl_GLint miplevel, cl_GLuint
texture, cl_int * errcode_ret)
+{
+}
+
+cl_mem WINAPI wine_clCreateFromGLTexture3D(cl_context context,
cl_mem_flags flags, cl_GLenum target,
+ cl_GLint miplevel, cl_GLuint
texture, cl_int * errcode_ret)
+{
+}
+
+cl_mem WINAPI wine_clCreateFromGLRenderbuffer(cl_context context,
cl_mem_flags flags, cl_GLuint renderbuffer, cl_int * errcode_ret)
+{
+}
+
+cl_int WINAPI wine_clGetGLObjectInfo(cl_mem memobj, cl_gl_object_type *
gl_object_type, cl_GLuint * gl_object_name)
+{
+}
+
+cl_int WINAPI wine_clGetGLTextureInfo(cl_mem memobj, cl_gl_texture_info
param_name, size_t param_value_size,
+ void * param_value, size_t *
param_value_size_ret)
+{
+}
+
+cl_int WINAPI wine_clEnqueueAcquireGLObjects(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_int WINAPI wine_clEnqueueReleaseGLObjects(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_khr_gl_sharing extension */
+
+cl_int WINAPI wine_clGetGLContextInfoKHR(const cl_context_properties *
properties, cl_gl_context_info param_name,
+ size_t param_value_size, void
* param_value, size_t * param_value_size_ret)
+{
+}
+
+#endif
+
+
+#if 0
+/*---------------------------------------------------------------*/
+/* cl_khr_icd extension */
+
+cl_int WINAPI wine_clIcdGetPlatformIDsKHR(cl_uint num_entries,
cl_platform_id * platforms, cl_uint * num_platforms)
+{
+}
+#endif
+
+
#endif /* HAVE_OPENCL */
diff --git a/dlls/opencl/opencl.spec b/dlls/opencl/opencl.spec
index 46c972a..f2a4a70 100644
--- a/dlls/opencl/opencl.spec
+++ b/dlls/opencl/opencl.spec
@@ -1,75 +1,96 @@
# OpenCL 1.0
-@ stub clBuildProgram
-@ stub clCreateBuffer
-@ stub clCreateCommandQueue
-@ stub clCreateContext
-@ stub clCreateContextFromType
+@ stdcall clGetPlatformIDs( long ptr ptr ) wine_clGetPlatformIDs
+@ stdcall clGetPlatformInfo( long long long ptr ptr )
wine_clGetPlatformInfo
+
+@ stdcall clGetDeviceIDs( long long long ptr ptr ) wine_clGetDeviceIDs
+@ stdcall clGetDeviceInfo( long long long ptr ptr ) wine_clGetDeviceInfo
+
+@ stdcall clCreateContext( ptr long ptr long ptr ptr ) wine_clCreateContext
+@ stdcall clCreateContextFromType( ptr long long ptr ptr )
wine_clCreateContextFromType
+@ stdcall clRetainContext( long ) wine_clRetainContext
+@ stdcall clReleaseContext( long ) wine_clReleaseContext
+@ stdcall clGetContextInfo( long long long ptr ptr ) wine_clGetContextInfo
+
+@ stdcall clCreateCommandQueue( long long long ptr )
wine_clCreateCommandQueue
+@ stdcall clRetainCommandQueue( long ) wine_clRetainCommandQueue
+@ stdcall clReleaseCommandQueue( long ) wine_clReleaseCommandQueue
+@ stdcall clGetCommandQueueInfo( long long long ptr ptr )
wine_clGetCommandQueueInfo
+@ stdcall clSetCommandQueueProperty( long long long ptr )
wine_clSetCommandQueueProperty
+
+@ stdcall clCreateBuffer( long long long ptr ptr ) wine_clCreateBuffer
+@ stdcall clCreateImage2D( long long ptr long long long ptr ptr )
wine_clCreateImage2D
+@ stdcall clCreateImage3D( long long ptr long long long long long ptr
ptr ) wine_clCreateImage3D
+@ stdcall clRetainMemObject( long ) wine_clRetainMemObject
+@ stdcall clReleaseMemObject( long ) wine_clReleaseMemObject
+@ stdcall clGetSupportedImageFormats( long long long long ptr ptr )
wine_clGetSupportedImageFormats
+@ stdcall clGetMemObjectInfo( long long long ptr ptr )
wine_clGetMemObjectInfo
+@ stdcall clGetImageInfo( long long long ptr ptr ) wine_clGetImageInfo
+
+@ stdcall clCreateSampler( long long long long ptr ) wine_clCreateSampler
+@ stdcall clRetainSampler( long ) wine_clRetainSampler
+@ stdcall clReleaseSampler( long ) wine_clReleaseSampler
+@ stdcall clGetSamplerInfo( long long long ptr ptr ) wine_clGetSamplerInfo
+
+@ stdcall clCreateProgramWithSource( long long ptr ptr ptr )
wine_clCreateProgramWithSource
+@ stdcall clCreateProgramWithBinary( long long ptr ptr ptr ptr ptr )
wine_clCreateProgramWithBinary
+@ stdcall clRetainProgram( long ) wine_clRetainProgram
+@ stdcall clReleaseProgram( long ) wine_clReleaseProgram
+@ stdcall clBuildProgram( long long ptr str ptr ptr ) wine_clBuildProgram
+@ stdcall clUnloadCompiler() wine_clUnloadCompiler
+@ stdcall clGetProgramInfo( long long long ptr ptr ) wine_clGetProgramInfo
+@ stdcall clGetProgramBuildInfo( long long long long ptr ptr )
wine_clGetProgramBuildInfo
+
+@ stdcall clCreateKernel( long str ptr ) wine_clCreateKernel
+@ stdcall clCreateKernelsInProgram( long long ptr ptr )
wine_clCreateKernelsInProgram
+@ stdcall clRetainKernel( long ) wine_clRetainKernel
+@ stdcall clReleaseKernel( long ) wine_clReleaseKernel
+@ stdcall clSetKernelArg( long long long ptr ) wine_clSetKernelArg
+@ stdcall clGetKernelInfo( long long long ptr ptr ) wine_clGetKernelInfo
+@ stdcall clGetKernelWorkGroupInfo( long long long long ptr ptr )
wine_clGetKernelWorkGroupInfo
+
+@ stdcall clWaitForEvents( long ptr ) wine_clWaitForEvents
+@ stdcall clGetEventInfo( long long long ptr ptr ) wine_clGetEventInfo
+@ stdcall clReleaseEvent( long ) wine_clReleaseEvent
+@ stdcall clRetainEvent( long ) wine_clRetainEvent
+
+@ stdcall clGetEventProfilingInfo( long long long ptr ptr )
wine_clGetEventProfilingInfo
+
+@ stdcall clFlush( long ) wine_clFlush
+@ stdcall clFinish( long ) wine_clFinish
+
+@ stdcall clEnqueueReadBuffer( long long long long long ptr long ptr
ptr ) wine_clEnqueueReadBuffer
+@ stdcall clEnqueueWriteBuffer( long long long long long ptr long ptr
ptr ) wine_clEnqueueWriteBuffer
+@ stdcall clEnqueueCopyBuffer( long long long long long long long ptr
ptr ) wine_clEnqueueCopyBuffer
+@ stdcall clEnqueueReadImage( long long long ptr ptr long long ptr long
ptr ptr ) wine_clEnqueueReadImage
+@ stdcall clEnqueueWriteImage( long long long ptr ptr long long ptr
long ptr ptr ) wine_clEnqueueWriteImage
+@ stdcall clEnqueueCopyImage( long long long ptr ptr ptr long ptr ptr )
wine_clEnqueueCopyImage
+@ stdcall clEnqueueCopyImageToBuffer( long long long ptr ptr long long
ptr ptr ) wine_clEnqueueCopyImageToBuffer
+@ stdcall clEnqueueCopyBufferToImage( long long long long ptr ptr long
ptr ptr ) wine_clEnqueueCopyBufferToImage
+@ stdcall clEnqueueMapBuffer( long long long long long long long ptr
ptr ptr ) wine_clEnqueueMapBuffer
+@ stdcall clEnqueueMapImage( long long long long ptr ptr ptr ptr long
ptr ptr ptr ) wine_clEnqueueMapImage
+@ stdcall clEnqueueUnmapMemObject( long long ptr long ptr ptr )
wine_clEnqueueUnmapMemObject
+@ stdcall clEnqueueNDRangeKernel( long long long ptr ptr ptr long ptr
ptr ) wine_clEnqueueNDRangeKernel
+@ stdcall clEnqueueTask( long long long ptr ptr ) wine_clEnqueueTask
+@ stdcall clEnqueueNativeKernel( long long ptr long long ptr ptr long
ptr ptr ) wine_clEnqueueNativeKernel
+@ stdcall clEnqueueMarker( long ptr ) wine_clEnqueueMarker
+@ stdcall clEnqueueWaitForEvents( long long ptr )
wine_clEnqueueWaitForEvents
+@ stdcall clEnqueueBarrier( long ) wine_clEnqueueBarrier
+
+@ stdcall clGetExtensionFunctionAddress( str )
wine_clGetExtensionFunctionAddress
+
@ stub clCreateFromGLBuffer
-@ stub clCreateFromGLRenderbuffer
@ stub clCreateFromGLTexture2D
@ stub clCreateFromGLTexture3D
-@ stub clCreateImage2D
-@ stub clCreateImage3D
-@ stub clCreateKernel
-@ stub clCreateKernelsInProgram
-@ stub clCreateProgramWithBinary
-@ stub clCreateProgramWithSource
-@ stub clCreateSampler
-@ stub clEnqueueAcquireGLObjects
-@ stub clEnqueueBarrier
-@ stub clEnqueueCopyBuffer
-@ stub clEnqueueCopyBufferToImage
-@ stub clEnqueueCopyImage
-@ stub clEnqueueCopyImageToBuffer
-@ stub clEnqueueMapBuffer
-@ stub clEnqueueMapImage
-@ stub clEnqueueMarker
-@ stub clEnqueueNDRangeKernel
-@ stub clEnqueueNativeKernel
-@ stub clEnqueueReadBuffer
-@ stub clEnqueueReadImage
-@ stub clEnqueueReleaseGLObjects
-@ stub clEnqueueTask
-@ stub clEnqueueUnmapMemObject
-@ stub clEnqueueWaitForEvents
-@ stub clEnqueueWriteBuffer
-@ stub clEnqueueWriteImage
-@ stub clFinish
-@ stub clFlush
-@ stub clGetCommandQueueInfo
-@ stub clGetContextInfo
-@ stub clGetDeviceIDs
-@ stub clGetDeviceInfo
-@ stub clGetEventInfo
-@ stub clGetEventProfilingInfo
-@ stub clGetExtensionFunctionAddress
+@ stub clCreateFromGLRenderbuffer
@ stub clGetGLObjectInfo
@ stub clGetGLTextureInfo
-@ stub clGetImageInfo
-@ stub clGetKernelInfo
-@ stub clGetKernelWorkGroupInfo
-@ stub clGetMemObjectInfo
-@ stub clGetPlatformIDs
-@ stub clGetPlatformInfo
-@ stub clGetProgramBuildInfo
-@ stub clGetProgramInfo
-@ stub clGetSamplerInfo
-@ stub clGetSupportedImageFormats
-@ stub clReleaseCommandQueue
-@ stub clReleaseContext
-@ stub clReleaseEvent
-@ stub clReleaseKernel
-@ stub clReleaseMemObject
-@ stub clReleaseProgram
-@ stub clReleaseSampler
-@ stub clRetainCommandQueue
-@ stub clRetainContext
-@ stub clRetainEvent
-@ stub clRetainKernel
-@ stub clRetainMemObject
-@ stub clRetainProgram
-@ stub clRetainSampler
-@ stub clSetCommandQueueProperty
-@ stub clSetKernelArg
-@ stub clUnloadCompiler
-@ stub clWaitForEvents
+@ stub clEnqueueAcquireGLObjects
+@ stub clEnqueueReleaseGLObjects
+# @ stdcall clCreateFromGLBuffer( long long long ptr )
wine_clCreateFromGLBuffer
+# @ stdcall clCreateFromGLTexture2D( long long long long long ptr )
wine_clCreateFromGLTexture2D
+# @ stdcall clCreateFromGLTexture3D( long long long long long ptr )
wine_clCreateFromGLTexture3D
+# @ stdcall clCreateFromGLRenderbuffer( long long long ptr )
wine_clCreateFromGLRenderbuffer
+# @ stdcall clGetGLObjectInfo( long ptr ptr ) wine_clGetGLObjectInfo
+# @ stdcall clGetGLTextureInfo( long long long ptr ptr )
wine_clGetGLTextureInfo
+# @ stdcall clEnqueueAcquireGLObjects( long long ptr long ptr ptr )
wine_clEnqueueAcquireGLObjects
+# @ stdcall clEnqueueReleaseGLObjects( long long ptr long ptr ptr )
wine_clEnqueueReleaseGLObjects
More information about the wine-patches
mailing list