#include "Common.h"
#include "Proxy.h"
#include "API.h"

// AUTOGENERATED {{{

cl_int JAVACL_PROXY_API
JAVAclGetPlatformIDs(cl_uint          num_entries,
                 cl_platform_id * platforms,
                 cl_uint *        num_platforms) {
  JNIEnv *env = GetEnv();
  return (cl_int)(*env)->CallIntMethod(env, gOpenCLProxyImplementation, gclGetPlatformIDsMethod, (jint)num_entries, (jlong)(size_t)platforms, (jlong)(size_t)num_platforms);
}

// }}} AUTOGENERATED

// See https://github.com/NatTuck/pocl/blob/master/lib/CL/pocl_icd.h
struct _cl_icd_dispatch gJavaCLProxyDispatch = {
  &JAVAclGetPlatformIDs,
  NULL, // &JAVAclGetPlatformInfo,
  NULL, // &JAVAclGetDeviceIDs,
  NULL, // &JAVAclGetDeviceInfo,
  NULL, // &JAVAclCreateContext,
  NULL, // &JAVAclCreateContextFromType,
  NULL, // &JAVAclRetainContext,
  NULL, // &JAVAclReleaseContext,
  NULL, // &JAVAclGetContextInfo,
  NULL, // &JAVAclCreateCommandQueue,
  NULL, // &JAVAclRetainCommandQueue,
  NULL, // &JAVAclReleaseCommandQueue,
  NULL, // &JAVAclGetCommandQueueInfo,
  NULL, // &JAVAclSetCommandQueueProperty,
  NULL, // &JAVAclCreateBuffer,
  NULL, // &JAVAclCreateImage2D,
  NULL, // &JAVAclCreateImage3D,
  NULL, // &JAVAclRetainMemObject,
  NULL, // &JAVAclReleaseMemObject,
  NULL, // &JAVAclGetSupportedImageFormats,
  NULL, // &JAVAclGetMemObjectInfo,
  NULL, // &JAVAclGetImageInfo,
  NULL, // &JAVAclCreateSampler,
  NULL, // &JAVAclRetainSampler,
  NULL, // &JAVAclReleaseSampler,
  NULL, // &JAVAclGetSamplerInfo,
  NULL, // &JAVAclCreateProgramWithSource,
  NULL, // &JAVAclCreateProgramWithBinary,
  NULL, // &JAVAclRetainProgram,
  NULL, // &JAVAclReleaseProgram,
  NULL, // &JAVAclBuildProgram,
  NULL, // &JAVAclUnloadCompiler,
  NULL, // &JAVAclGetProgramInfo,
  NULL, // &JAVAclGetProgramBuildInfo,
  NULL, // &JAVAclCreateKernel,
  NULL, // &JAVAclCreateKernelsInProgram,
  NULL, // &JAVAclRetainKernel,
  NULL, // &JAVAclReleaseKernel,
  NULL, // &JAVAclSetKernelArg,
  NULL, // &JAVAclGetKernelInfo,
  NULL, // &JAVAclGetKernelWorkGroupInfo,
  NULL, // &JAVAclWaitForEvents,
  NULL, // &JAVAclGetEventInfo,
  NULL, // &JAVAclRetainEvent,
  NULL, // &JAVAclReleaseEvent,
  NULL, // &JAVAclGetEventProfilingInfo,
  NULL, // &JAVAclFlush,
  NULL, // &JAVAclFinish,
  NULL, // &JAVAclEnqueueReadBuffer,
  NULL, // &JAVAclEnqueueWriteBuffer,
  NULL, // &JAVAclEnqueueCopyBuffer,
  NULL, // &JAVAclEnqueueReadImage,
  NULL, // &JAVAclEnqueueWriteImage,
  NULL, // &JAVAclEnqueueCopyImage,
  NULL, // &JAVAclEnqueueCopyImageToBuffer,
  NULL, // &JAVAclEnqueueCopyBufferToImage,
  NULL, // &JAVAclEnqueueMapBuffer,
  NULL, // &JAVAclEnqueueMapImage,
  NULL, // &JAVAclEnqueueUnmapMemObject,
  NULL, // &JAVAclEnqueueNDRangeKernel,
  NULL, // &JAVAclEnqueueTask,
  NULL, // &JAVAclEnqueueNativeKernel,
  NULL, // &JAVAclEnqueueMarker,
  NULL, // &JAVAclEnqueueWaitForEvents,
  NULL, // &JAVAclEnqueueBarrier,
  NULL, // &JAVAclGetExtensionFunctionAddress,
  NULL, // &JAVAclCreateFromGLBuffer,
  NULL, // &JAVAclCreateFromGLTexture2D,
  NULL, // &JAVAclCreateFromGLTexture3D,
  NULL, // &JAVAclCreateFromGLRenderbuffer,
  NULL, // &JAVAclGetGLObjectInfo,
  NULL, // &JAVAclGetGLTextureInfo,
  NULL, // &JAVAclEnqueueAcquireGLObjects,
  NULL, // &JAVAclEnqueueReleaseGLObjects,
  NULL, // &JAVAclGetGLContextInfoKHR,
  NULL, // &clUnknown75,
  NULL, // &clUnknown76,
  NULL, // &clUnknown77,
  NULL, // &clUnknown78,
  NULL, // &clUnknown79,
  NULL, // &clUnknown80,
  NULL, // &JAVAclSetEventCallback,
  NULL, // &JAVAclCreateSubBuffer,
  NULL, // &JAVAclSetMemObjectDestructorCallback,
  NULL, // &JAVAclCreateUserEvent,
  NULL, // &JAVAclSetUserEventStatus,
  NULL, // &JAVAclEnqueueReadBufferRect,
  NULL, // &JAVAclEnqueueWriteBufferRect,
  NULL, // &JAVAclEnqueueCopyBufferRect,
  NULL, // &JAVAclCreateSubDevicesEXT,
  NULL, // &JAVAclRetainDeviceEXT,
  NULL, // &JAVAclReleaseDeviceEXT,
  NULL, // &clUnknown92,
  NULL, // &JAVAclCreateSubDevices,
  NULL, // &JAVAclRetainDevice,
  NULL, // &JAVAclReleaseDevice,
  NULL, // &JAVAclCreateImage,
  NULL, // &JAVAclCreateProgramWithBuiltInKernels,
  NULL, // &JAVAclCompileProgram,
  NULL, // &JAVAclLinkProgram,
  NULL, // &JAVAclUnloadPlatformCompiler,
  NULL, // &JAVAclGetKernelArgInfo,
  NULL, // &JAVAclEnqueueFillBuffer,
  NULL, // &JAVAclEnqueueFillImage,
  NULL, // &JAVAclEnqueueMigrateMemObjects,
  NULL, // &JAVAclEnqueueMarkerWithWaitList,
  NULL, // &JAVAclEnqueueBarrierWithWaitList,
  NULL, // &JAVAclGetExtensionFunctionAddressForPlatform,
  NULL, // &JAVAclCreateFromGLTexture,
};

