Commit cddb2003 by John Plate Committed by Commit Bot

Stubs for CL validation entry points

Bug: angleproject:5775 Change-Id: Ic3b15efdf602bad8f5f170f03ba24b421a398ca8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2848504Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: John Plate <jplate@google.com>
parent e1201106
......@@ -10,7 +10,7 @@
"scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py":
"992b715af193e3c5667e6c2b3240d4e6",
"ce49f151aac3d4a163686d7e45bcb03e",
"scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6",
"scripts/gl_angle_ext.xml":
......@@ -20,9 +20,9 @@
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/common/entry_points_enum_autogen.cpp":
"8c07f579466a1a57fa6689f7ebc6dfae",
"f44e96c3297ed6787434ae7ee02596af",
"src/common/entry_points_enum_autogen.h":
"62145e8368def39a9c1dc26d000c9795",
"9db537e91358777907a2bba88ee98be5",
"src/libANGLE/Context_gl_1_autogen.h":
"6be1391ee21b3754d9e9c512255d4c5d",
"src/libANGLE/Context_gl_2_autogen.h":
......@@ -73,6 +73,8 @@
"dfad80f141010395be7d0ca59ef8ee7a",
"src/libANGLE/capture/frame_capture_utils_autogen.h":
"4405cac61b4f79b893bd40c7fc452397",
"src/libANGLE/validationCL_autogen.h":
"9b030d9bb634fdd7f38b28b2dc25e0f0",
"src/libANGLE/validationEGL_autogen.h":
"3927fa260ad183fd9193d65b3f8d82c5",
"src/libANGLE/validationES1_autogen.h":
......@@ -120,7 +122,7 @@
"src/libGL/libGL_autogen.def":
"2789d87b05eea9f53d52e2aff499b785",
"src/libGLESv2/cl_stubs_autogen.h":
"3757cdaee900021bc14c21e97bd91d50",
"93e4a07e582d3ee0955d1e82bc43dd9b",
"src/libGLESv2/egl_ext_stubs_autogen.h":
"2ef3b8d087f2a97f7270b96077c93856",
"src/libGLESv2/egl_get_labeled_object_data.json":
......@@ -128,7 +130,7 @@
"src/libGLESv2/egl_stubs_autogen.h":
"6439daa350c1663e71dd0af37dcc91df",
"src/libGLESv2/entry_points_cl_autogen.cpp":
"e9310db2512fb91852dc8834717d4209",
"2c43ce51701c4499003638fa30de340e",
"src/libGLESv2/entry_points_cl_autogen.h":
"129fa7936c8bc6a20de9269da0c3c7d3",
"src/libGLESv2/entry_points_egl_autogen.cpp":
......
......@@ -253,22 +253,35 @@ void CL_API_CALL CL_{name}({params})
{packed_gl_enum_conversions}
// TODO: validate
ANGLE_CL_VALIDATE_VOID({name}{comma_if_needed}{internal_params});
cl::{name}({internal_params});
{name}({internal_params});
}}
"""
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN_ERROR = """\
cl_int CL_API_CALL CL_{name}({params})
{{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
{packed_gl_enum_conversions}
ANGLE_CL_VALIDATE_ERROR({name}{comma_if_needed}{internal_params});
return {return_cast}({name}({internal_params}));
}}
"""
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN_POINTER = """\
{return_type} CL_API_CALL CL_{name}({params})
{{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
{packed_gl_enum_conversions}
// TODO: validate
ANGLE_CL_VALIDATE_POINTER({name}{comma_if_needed}{internal_params});
return {return_cast}(cl::{name}({internal_params}));
return {return_cast}({name}({internal_params}));
}}
"""
......@@ -285,22 +298,12 @@ TEMPLATE_CL_STUBS_HEADER = """\
#ifndef LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_
#define LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_
#include "angle_cl.h"
#include "libANGLE/CLtypes.h"
#include "common/PackedCLEnums_autogen.h"
namespace cl
{{
class CommandQueue;
class Context;
class Device;
class Event;
class Kernel;
class Memory;
class Platform;
class Program;
class Sampler;
{stubs}
}} // namespace cl
#endif // LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_
......@@ -436,6 +439,30 @@ class Context;
#endif // LIBANGLE_VALIDATION_{annotation}_AUTOGEN_H_
"""
TEMPLATE_CL_VALIDATION_HEADER = """\
// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// validation{annotation}_autogen.h:
// Validation functions for the {comment} entry points.
#ifndef LIBANGLE_VALIDATION_{annotation}_AUTOGEN_H_
#define LIBANGLE_VALIDATION_{annotation}_AUTOGEN_H_
#include "libANGLE/validationCL.h"
namespace cl
{{
{prototypes}
}} // namespace cl
#endif // LIBANGLE_VALIDATION_{annotation}_AUTOGEN_H_
"""
TEMPLATE_EGL_VALIDATION_HEADER = """\
// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
......@@ -986,7 +1013,8 @@ LIBCL_SOURCE_INCLUDES = """\
#include "cl_stubs_autogen.h"
#include "entry_points_cl_utils.h"
#include "validationCL.h"
#include "libANGLE/validationCL_autogen.h"
using namespace cl;
"""
......@@ -998,7 +1026,7 @@ TEMPLATE_EVENT_COMMENT = """\
TEMPLATE_CAPTURE_PROTO = "angle::CallCapture Capture%s(%s);"
TEMPLATE_VALIDATION_PROTO = "bool Validate%s(%s);"
TEMPLATE_VALIDATION_PROTO = "%s Validate%s(%s);"
TEMPLATE_WINDOWS_DEF_FILE = """\
; GENERATED FILE - DO NOT EDIT.
......@@ -1507,18 +1535,20 @@ def get_packed_enums(api, cmd_packed_gl_enums, cmd_name, packed_param_types, par
def get_def_template(api, return_type):
if return_type.strip() == "void":
if return_type == "void":
if api == apis.EGL:
return TEMPLATE_EGL_ENTRY_POINT_NO_RETURN
elif api == apis.CL:
return TEMPLATE_CL_ENTRY_POINT_NO_RETURN
else:
return TEMPLATE_GLES_ENTRY_POINT_NO_RETURN
elif return_type == "cl_int":
return TEMPLATE_CL_ENTRY_POINT_WITH_RETURN_ERROR
else:
if api == apis.EGL:
return TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN
elif api == apis.CL:
return TEMPLATE_CL_ENTRY_POINT_WITH_RETURN
return TEMPLATE_CL_ENTRY_POINT_WITH_RETURN_POINTER
else:
return TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN
......@@ -1675,10 +1705,12 @@ def format_capture_method(api, command, cmd_name, proto, params, all_param_types
def const_pointer_type(param, packed_gl_enums):
type = just_the_type_packed(param, packed_gl_enums)
if "**" in type and "const" not in type:
if just_the_name(param) == "errcode_ret" or "(" in type:
return type
elif "**" in type and "const" not in type:
return type.replace("**", "* const *")
elif "*" in type and "const" not in type:
return "const " + type
return type.replace("*", "*const ") if "[]" in type else "const " + type
else:
return type
......@@ -1736,7 +1768,11 @@ def format_entry_point_export(cmd_name, proto, params, is_explicit_context, temp
explicit_context_internal_param="ctx" if is_explicit_context else "")
def format_validation_proto(api, cmd_name, params, cmd_packed_gl_enums, packed_param_types):
def format_validation_proto(api, cmd_name, proto, params, cmd_packed_gl_enums, packed_param_types):
if api == apis.CL:
return_type = "cl_int" if proto[:-len(cmd_name)].strip() == "cl_int" else "bool"
else:
return_type = "bool"
if api in [apis.GL, apis.GLES]:
with_extra_params = ["Context *context"] + params
elif api == apis.EGL:
......@@ -1745,7 +1781,7 @@ def format_validation_proto(api, cmd_name, params, cmd_packed_gl_enums, packed_p
with_extra_params = params
internal_params = get_validation_params(api, cmd_name, with_extra_params, cmd_packed_gl_enums,
packed_param_types)
return TEMPLATE_VALIDATION_PROTO % (strip_api_prefix(cmd_name), internal_params)
return TEMPLATE_VALIDATION_PROTO % (return_type, strip_api_prefix(cmd_name), internal_params)
def format_capture_proto(api, cmd_name, proto, params, cmd_packed_gl_enums, packed_param_types):
......@@ -1798,8 +1834,8 @@ class ANGLEEntryPoints(registry_xml.EntryPoints):
export_template))
self.validation_protos.append(
format_validation_proto(self.api, cmd_name, param_text, cmd_packed_enums,
packed_param_types))
format_validation_proto(self.api, cmd_name, proto_text, param_text,
cmd_packed_enums, packed_param_types))
self.capture_protos.append(
format_capture_proto(self.api, cmd_name, proto_text, param_text, cmd_packed_enums,
packed_param_types))
......@@ -2566,6 +2602,7 @@ def main():
'../src/libANGLE/capture/frame_capture_replay_autogen.cpp',
'../src/libANGLE/capture/frame_capture_utils_autogen.cpp',
'../src/libANGLE/capture/frame_capture_utils_autogen.h',
'../src/libANGLE/validationCL_autogen.h',
'../src/libANGLE/validationEGL_autogen.h',
'../src/libANGLE/validationES1_autogen.h',
'../src/libANGLE/validationES2_autogen.h',
......@@ -2925,6 +2962,8 @@ def main():
LIBCL_HEADER_INCLUDES, "libGLESv2", "cl.xml")
write_file("cl", "CL", TEMPLATE_ENTRY_POINT_SOURCE, "\n".join(cl_defs), "cpp",
LIBCL_SOURCE_INCLUDES, "libGLESv2", "cl.xml")
write_validation_header("CL", "CL", cl_validation_protos, "cl.xml",
TEMPLATE_CL_VALIDATION_HEADER)
write_stubs_header("CL", "cl", "CL", "cl.xml", CL_STUBS_HEADER_PATH, clxml.all_commands,
cl_commands, CLEntryPoints.get_packed_enums(), CL_PACKED_TYPES)
......@@ -3050,14 +3089,16 @@ def main():
write_context_api_decls(desktop_gl_decls, "gl")
# Entry point enum
cl_cmd_names = [strip_api_prefix(cmd) for cmd in clxml.all_cmd_names.get_all_commands()]
egl_cmd_names = [strip_api_prefix(cmd) for cmd in eglxml.all_cmd_names.get_all_commands()]
gles_cmd_names = ["Invalid"
] + [strip_api_prefix(cmd) for cmd in xml.all_cmd_names.get_all_commands()]
gl_cmd_names = [strip_api_prefix(cmd) for cmd in glxml.all_cmd_names.get_all_commands()]
wgl_cmd_names = [strip_api_prefix(cmd) for cmd in wglxml.all_cmd_names.get_all_commands()]
unsorted_enums = [("EGL%s" % cmd, "egl%s" % cmd) for cmd in egl_cmd_names] + [
("GL%s" % cmd, "gl%s" % cmd) for cmd in set(gles_cmd_names + gl_cmd_names)
] + [("WGL%s" % cmd, "wgl%s" % cmd) for cmd in wgl_cmd_names]
unsorted_enums = [("CL%s" % cmd, "cl%s" % cmd) for cmd in cl_cmd_names] + [
("EGL%s" % cmd, "egl%s" % cmd) for cmd in egl_cmd_names
] + [("GL%s" % cmd, "gl%s" % cmd) for cmd in set(gles_cmd_names + gl_cmd_names)
] + [("WGL%s" % cmd, "wgl%s" % cmd) for cmd in wgl_cmd_names]
all_enums = sorted(unsorted_enums)
entry_points_enum_header = TEMPLATE_ENTRY_POINTS_ENUM_HEADER.format(
......
......@@ -18,6 +18,234 @@ const char *GetEntryPointName(EntryPoint ep)
{
switch (ep)
{
case EntryPoint::CLBuildProgram:
return "clBuildProgram";
case EntryPoint::CLCloneKernel:
return "clCloneKernel";
case EntryPoint::CLCompileProgram:
return "clCompileProgram";
case EntryPoint::CLCreateBuffer:
return "clCreateBuffer";
case EntryPoint::CLCreateBufferWithProperties:
return "clCreateBufferWithProperties";
case EntryPoint::CLCreateCommandQueue:
return "clCreateCommandQueue";
case EntryPoint::CLCreateCommandQueueWithProperties:
return "clCreateCommandQueueWithProperties";
case EntryPoint::CLCreateContext:
return "clCreateContext";
case EntryPoint::CLCreateContextFromType:
return "clCreateContextFromType";
case EntryPoint::CLCreateImage:
return "clCreateImage";
case EntryPoint::CLCreateImage2D:
return "clCreateImage2D";
case EntryPoint::CLCreateImage3D:
return "clCreateImage3D";
case EntryPoint::CLCreateImageWithProperties:
return "clCreateImageWithProperties";
case EntryPoint::CLCreateKernel:
return "clCreateKernel";
case EntryPoint::CLCreateKernelsInProgram:
return "clCreateKernelsInProgram";
case EntryPoint::CLCreatePipe:
return "clCreatePipe";
case EntryPoint::CLCreateProgramWithBinary:
return "clCreateProgramWithBinary";
case EntryPoint::CLCreateProgramWithBuiltInKernels:
return "clCreateProgramWithBuiltInKernels";
case EntryPoint::CLCreateProgramWithIL:
return "clCreateProgramWithIL";
case EntryPoint::CLCreateProgramWithSource:
return "clCreateProgramWithSource";
case EntryPoint::CLCreateSampler:
return "clCreateSampler";
case EntryPoint::CLCreateSamplerWithProperties:
return "clCreateSamplerWithProperties";
case EntryPoint::CLCreateSubBuffer:
return "clCreateSubBuffer";
case EntryPoint::CLCreateSubDevices:
return "clCreateSubDevices";
case EntryPoint::CLCreateUserEvent:
return "clCreateUserEvent";
case EntryPoint::CLEnqueueBarrier:
return "clEnqueueBarrier";
case EntryPoint::CLEnqueueBarrierWithWaitList:
return "clEnqueueBarrierWithWaitList";
case EntryPoint::CLEnqueueCopyBuffer:
return "clEnqueueCopyBuffer";
case EntryPoint::CLEnqueueCopyBufferRect:
return "clEnqueueCopyBufferRect";
case EntryPoint::CLEnqueueCopyBufferToImage:
return "clEnqueueCopyBufferToImage";
case EntryPoint::CLEnqueueCopyImage:
return "clEnqueueCopyImage";
case EntryPoint::CLEnqueueCopyImageToBuffer:
return "clEnqueueCopyImageToBuffer";
case EntryPoint::CLEnqueueFillBuffer:
return "clEnqueueFillBuffer";
case EntryPoint::CLEnqueueFillImage:
return "clEnqueueFillImage";
case EntryPoint::CLEnqueueMapBuffer:
return "clEnqueueMapBuffer";
case EntryPoint::CLEnqueueMapImage:
return "clEnqueueMapImage";
case EntryPoint::CLEnqueueMarker:
return "clEnqueueMarker";
case EntryPoint::CLEnqueueMarkerWithWaitList:
return "clEnqueueMarkerWithWaitList";
case EntryPoint::CLEnqueueMigrateMemObjects:
return "clEnqueueMigrateMemObjects";
case EntryPoint::CLEnqueueNDRangeKernel:
return "clEnqueueNDRangeKernel";
case EntryPoint::CLEnqueueNativeKernel:
return "clEnqueueNativeKernel";
case EntryPoint::CLEnqueueReadBuffer:
return "clEnqueueReadBuffer";
case EntryPoint::CLEnqueueReadBufferRect:
return "clEnqueueReadBufferRect";
case EntryPoint::CLEnqueueReadImage:
return "clEnqueueReadImage";
case EntryPoint::CLEnqueueSVMFree:
return "clEnqueueSVMFree";
case EntryPoint::CLEnqueueSVMMap:
return "clEnqueueSVMMap";
case EntryPoint::CLEnqueueSVMMemFill:
return "clEnqueueSVMMemFill";
case EntryPoint::CLEnqueueSVMMemcpy:
return "clEnqueueSVMMemcpy";
case EntryPoint::CLEnqueueSVMMigrateMem:
return "clEnqueueSVMMigrateMem";
case EntryPoint::CLEnqueueSVMUnmap:
return "clEnqueueSVMUnmap";
case EntryPoint::CLEnqueueTask:
return "clEnqueueTask";
case EntryPoint::CLEnqueueUnmapMemObject:
return "clEnqueueUnmapMemObject";
case EntryPoint::CLEnqueueWaitForEvents:
return "clEnqueueWaitForEvents";
case EntryPoint::CLEnqueueWriteBuffer:
return "clEnqueueWriteBuffer";
case EntryPoint::CLEnqueueWriteBufferRect:
return "clEnqueueWriteBufferRect";
case EntryPoint::CLEnqueueWriteImage:
return "clEnqueueWriteImage";
case EntryPoint::CLFinish:
return "clFinish";
case EntryPoint::CLFlush:
return "clFlush";
case EntryPoint::CLGetCommandQueueInfo:
return "clGetCommandQueueInfo";
case EntryPoint::CLGetContextInfo:
return "clGetContextInfo";
case EntryPoint::CLGetDeviceAndHostTimer:
return "clGetDeviceAndHostTimer";
case EntryPoint::CLGetDeviceIDs:
return "clGetDeviceIDs";
case EntryPoint::CLGetDeviceInfo:
return "clGetDeviceInfo";
case EntryPoint::CLGetEventInfo:
return "clGetEventInfo";
case EntryPoint::CLGetEventProfilingInfo:
return "clGetEventProfilingInfo";
case EntryPoint::CLGetExtensionFunctionAddress:
return "clGetExtensionFunctionAddress";
case EntryPoint::CLGetExtensionFunctionAddressForPlatform:
return "clGetExtensionFunctionAddressForPlatform";
case EntryPoint::CLGetHostTimer:
return "clGetHostTimer";
case EntryPoint::CLGetImageInfo:
return "clGetImageInfo";
case EntryPoint::CLGetKernelArgInfo:
return "clGetKernelArgInfo";
case EntryPoint::CLGetKernelInfo:
return "clGetKernelInfo";
case EntryPoint::CLGetKernelSubGroupInfo:
return "clGetKernelSubGroupInfo";
case EntryPoint::CLGetKernelWorkGroupInfo:
return "clGetKernelWorkGroupInfo";
case EntryPoint::CLGetMemObjectInfo:
return "clGetMemObjectInfo";
case EntryPoint::CLGetPipeInfo:
return "clGetPipeInfo";
case EntryPoint::CLGetPlatformIDs:
return "clGetPlatformIDs";
case EntryPoint::CLGetPlatformInfo:
return "clGetPlatformInfo";
case EntryPoint::CLGetProgramBuildInfo:
return "clGetProgramBuildInfo";
case EntryPoint::CLGetProgramInfo:
return "clGetProgramInfo";
case EntryPoint::CLGetSamplerInfo:
return "clGetSamplerInfo";
case EntryPoint::CLGetSupportedImageFormats:
return "clGetSupportedImageFormats";
case EntryPoint::CLLinkProgram:
return "clLinkProgram";
case EntryPoint::CLReleaseCommandQueue:
return "clReleaseCommandQueue";
case EntryPoint::CLReleaseContext:
return "clReleaseContext";
case EntryPoint::CLReleaseDevice:
return "clReleaseDevice";
case EntryPoint::CLReleaseEvent:
return "clReleaseEvent";
case EntryPoint::CLReleaseKernel:
return "clReleaseKernel";
case EntryPoint::CLReleaseMemObject:
return "clReleaseMemObject";
case EntryPoint::CLReleaseProgram:
return "clReleaseProgram";
case EntryPoint::CLReleaseSampler:
return "clReleaseSampler";
case EntryPoint::CLRetainCommandQueue:
return "clRetainCommandQueue";
case EntryPoint::CLRetainContext:
return "clRetainContext";
case EntryPoint::CLRetainDevice:
return "clRetainDevice";
case EntryPoint::CLRetainEvent:
return "clRetainEvent";
case EntryPoint::CLRetainKernel:
return "clRetainKernel";
case EntryPoint::CLRetainMemObject:
return "clRetainMemObject";
case EntryPoint::CLRetainProgram:
return "clRetainProgram";
case EntryPoint::CLRetainSampler:
return "clRetainSampler";
case EntryPoint::CLSVMAlloc:
return "clSVMAlloc";
case EntryPoint::CLSVMFree:
return "clSVMFree";
case EntryPoint::CLSetCommandQueueProperty:
return "clSetCommandQueueProperty";
case EntryPoint::CLSetContextDestructorCallback:
return "clSetContextDestructorCallback";
case EntryPoint::CLSetDefaultDeviceCommandQueue:
return "clSetDefaultDeviceCommandQueue";
case EntryPoint::CLSetEventCallback:
return "clSetEventCallback";
case EntryPoint::CLSetKernelArg:
return "clSetKernelArg";
case EntryPoint::CLSetKernelArgSVMPointer:
return "clSetKernelArgSVMPointer";
case EntryPoint::CLSetKernelExecInfo:
return "clSetKernelExecInfo";
case EntryPoint::CLSetMemObjectDestructorCallback:
return "clSetMemObjectDestructorCallback";
case EntryPoint::CLSetProgramReleaseCallback:
return "clSetProgramReleaseCallback";
case EntryPoint::CLSetProgramSpecializationConstant:
return "clSetProgramSpecializationConstant";
case EntryPoint::CLSetUserEventStatus:
return "clSetUserEventStatus";
case EntryPoint::CLUnloadCompiler:
return "clUnloadCompiler";
case EntryPoint::CLUnloadPlatformCompiler:
return "clUnloadPlatformCompiler";
case EntryPoint::CLWaitForEvents:
return "clWaitForEvents";
case EntryPoint::EGLBindAPI:
return "eglBindAPI";
case EntryPoint::EGLBindTexImage:
......
......@@ -15,6 +15,120 @@ namespace angle
{
enum class EntryPoint
{
CLBuildProgram,
CLCloneKernel,
CLCompileProgram,
CLCreateBuffer,
CLCreateBufferWithProperties,
CLCreateCommandQueue,
CLCreateCommandQueueWithProperties,
CLCreateContext,
CLCreateContextFromType,
CLCreateImage,
CLCreateImage2D,
CLCreateImage3D,
CLCreateImageWithProperties,
CLCreateKernel,
CLCreateKernelsInProgram,
CLCreatePipe,
CLCreateProgramWithBinary,
CLCreateProgramWithBuiltInKernels,
CLCreateProgramWithIL,
CLCreateProgramWithSource,
CLCreateSampler,
CLCreateSamplerWithProperties,
CLCreateSubBuffer,
CLCreateSubDevices,
CLCreateUserEvent,
CLEnqueueBarrier,
CLEnqueueBarrierWithWaitList,
CLEnqueueCopyBuffer,
CLEnqueueCopyBufferRect,
CLEnqueueCopyBufferToImage,
CLEnqueueCopyImage,
CLEnqueueCopyImageToBuffer,
CLEnqueueFillBuffer,
CLEnqueueFillImage,
CLEnqueueMapBuffer,
CLEnqueueMapImage,
CLEnqueueMarker,
CLEnqueueMarkerWithWaitList,
CLEnqueueMigrateMemObjects,
CLEnqueueNDRangeKernel,
CLEnqueueNativeKernel,
CLEnqueueReadBuffer,
CLEnqueueReadBufferRect,
CLEnqueueReadImage,
CLEnqueueSVMFree,
CLEnqueueSVMMap,
CLEnqueueSVMMemFill,
CLEnqueueSVMMemcpy,
CLEnqueueSVMMigrateMem,
CLEnqueueSVMUnmap,
CLEnqueueTask,
CLEnqueueUnmapMemObject,
CLEnqueueWaitForEvents,
CLEnqueueWriteBuffer,
CLEnqueueWriteBufferRect,
CLEnqueueWriteImage,
CLFinish,
CLFlush,
CLGetCommandQueueInfo,
CLGetContextInfo,
CLGetDeviceAndHostTimer,
CLGetDeviceIDs,
CLGetDeviceInfo,
CLGetEventInfo,
CLGetEventProfilingInfo,
CLGetExtensionFunctionAddress,
CLGetExtensionFunctionAddressForPlatform,
CLGetHostTimer,
CLGetImageInfo,
CLGetKernelArgInfo,
CLGetKernelInfo,
CLGetKernelSubGroupInfo,
CLGetKernelWorkGroupInfo,
CLGetMemObjectInfo,
CLGetPipeInfo,
CLGetPlatformIDs,
CLGetPlatformInfo,
CLGetProgramBuildInfo,
CLGetProgramInfo,
CLGetSamplerInfo,
CLGetSupportedImageFormats,
CLLinkProgram,
CLReleaseCommandQueue,
CLReleaseContext,
CLReleaseDevice,
CLReleaseEvent,
CLReleaseKernel,
CLReleaseMemObject,
CLReleaseProgram,
CLReleaseSampler,
CLRetainCommandQueue,
CLRetainContext,
CLRetainDevice,
CLRetainEvent,
CLRetainKernel,
CLRetainMemObject,
CLRetainProgram,
CLRetainSampler,
CLSVMAlloc,
CLSVMFree,
CLSetCommandQueueProperty,
CLSetContextDestructorCallback,
CLSetDefaultDeviceCommandQueue,
CLSetEventCallback,
CLSetKernelArg,
CLSetKernelArgSVMPointer,
CLSetKernelExecInfo,
CLSetMemObjectDestructorCallback,
CLSetProgramReleaseCallback,
CLSetProgramSpecializationConstant,
CLSetUserEventStatus,
CLUnloadCompiler,
CLUnloadPlatformCompiler,
CLWaitForEvents,
EGLBindAPI,
EGLBindTexImage,
EGLChooseConfig,
......
......@@ -10,11 +10,14 @@
#ifndef LIBANGLE_CLCOMMANDQUEUE_H_
#define LIBANGLE_CLCOMMANDQUEUE_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class CommandQueue final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -10,11 +10,14 @@
#ifndef LIBANGLE_CLCONTEXT_H_
#define LIBANGLE_CLCONTEXT_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Context final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -10,11 +10,14 @@
#ifndef LIBANGLE_CLDEVICE_H_
#define LIBANGLE_CLDEVICE_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Device final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -10,11 +10,14 @@
#ifndef LIBANGLE_CLEVENT_H_
#define LIBANGLE_CLEVENT_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Event final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -9,11 +9,14 @@
#ifndef LIBANGLE_CLKERNEL_H_
#define LIBANGLE_CLKERNEL_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Kernel final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -4,17 +4,20 @@
// found in the LICENSE file.
//
// CLMemory.h: Defines the cl::Memory class, which is a memory object and the base class for OpenCL
// objects such as Buffer, Image and Pipe.
// CLMemory.h: Defines the cl::Memory class, which is a memory object and represents OpenCL objects
// such as buffers, images and pipes.
#ifndef LIBANGLE_CLMEMORY_H_
#define LIBANGLE_CLMEMORY_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Memory final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -10,11 +10,14 @@
#ifndef LIBANGLE_CLPLATFORM_H_
#define LIBANGLE_CLPLATFORM_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Platform final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -9,11 +9,14 @@
#ifndef LIBANGLE_CLPROGRAM_H_
#define LIBANGLE_CLPROGRAM_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Program final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
......@@ -9,11 +9,14 @@
#ifndef LIBANGLE_CLSAMPLER_H_
#define LIBANGLE_CLSAMPLER_H_
#include "libANGLE/CLtypes.h"
namespace cl
{
class Sampler final
{
public:
using IsCLObjectType = std::true_type;
};
} // namespace cl
......
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// CLtypes.h: Defines common types for the OpenCL support in ANGLE.
#ifndef LIBANGLE_CLTYPES_H_
#define LIBANGLE_CLTYPES_H_
#include "angle_cl.h"
#include <type_traits>
namespace cl
{
class CommandQueue;
class Context;
class Device;
class Event;
class Kernel;
class Memory;
class Platform;
class Program;
class Sampler;
} // namespace cl
#endif // LIBANGLE_CLTYPES_H_
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// validationCL.cpp: Validation functions for generic CL entry point parameters
#include "libANGLE/validationCL_autogen.h"
namespace cl
{
// CL 1.0
cl_int ValidateGetPlatformIDs(cl_uint num_entries,
Platform *const *platformsPacked,
const cl_uint *num_platforms)
{
return CL_SUCCESS;
}
cl_int ValidateGetPlatformInfo(const Platform *platformPacked,
PlatformInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateGetDeviceIDs(const Platform *platformPacked,
cl_device_type device_type,
cl_uint num_entries,
Device *const *devicesPacked,
const cl_uint *num_devices)
{
return CL_SUCCESS;
}
cl_int ValidateGetDeviceInfo(const Device *devicePacked,
DeviceInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
bool ValidateCreateContext(const cl_context_properties *properties,
cl_uint num_devices,
Device *const *devicesPacked,
void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info,
size_t cb,
void *user_data),
const void *user_data,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreateContextFromType(const cl_context_properties *properties,
cl_device_type device_type,
void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info,
size_t cb,
void *user_data),
const void *user_data,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateRetainContext(const Context *contextPacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseContext(const Context *contextPacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetContextInfo(const Context *contextPacked,
ContextInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateRetainCommandQueue(const CommandQueue *command_queuePacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseCommandQueue(const CommandQueue *command_queuePacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetCommandQueueInfo(const CommandQueue *command_queuePacked,
CommandQueueInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
bool ValidateCreateBuffer(const Context *contextPacked,
cl_mem_flags flags,
size_t size,
const void *host_ptr,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateRetainMemObject(const Memory *memobjPacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseMemObject(const Memory *memobjPacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetSupportedImageFormats(const Context *contextPacked,
cl_mem_flags flags,
MemObjectType image_typePacked,
cl_uint num_entries,
const cl_image_format *image_formats,
const cl_uint *num_image_formats)
{
return CL_SUCCESS;
}
cl_int ValidateGetMemObjectInfo(const Memory *memobjPacked,
MemInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateGetImageInfo(const Memory *imagePacked,
ImageInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateRetainSampler(const Sampler *samplerPacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseSampler(const Sampler *samplerPacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetSamplerInfo(const Sampler *samplerPacked,
SamplerInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
bool ValidateCreateProgramWithSource(const Context *contextPacked,
cl_uint count,
const char **strings,
const size_t *lengths,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreateProgramWithBinary(const Context *contextPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const size_t *lengths,
const unsigned char **binaries,
const cl_int *binary_status,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateRetainProgram(const Program *programPacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseProgram(const Program *programPacked)
{
return CL_SUCCESS;
}
cl_int ValidateBuildProgram(const Program *programPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *options,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
const void *user_data)
{
return CL_SUCCESS;
}
cl_int ValidateGetProgramInfo(const Program *programPacked,
ProgramInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateGetProgramBuildInfo(const Program *programPacked,
const Device *devicePacked,
ProgramBuildInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
bool ValidateCreateKernel(const Program *programPacked,
const char *kernel_name,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateCreateKernelsInProgram(const Program *programPacked,
cl_uint num_kernels,
Kernel *const *kernelsPacked,
const cl_uint *num_kernels_ret)
{
return CL_SUCCESS;
}
cl_int ValidateRetainKernel(const Kernel *kernelPacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseKernel(const Kernel *kernelPacked)
{
return CL_SUCCESS;
}
cl_int ValidateSetKernelArg(const Kernel *kernelPacked,
cl_uint arg_index,
size_t arg_size,
const void *arg_value)
{
return CL_SUCCESS;
}
cl_int ValidateGetKernelInfo(const Kernel *kernelPacked,
KernelInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateGetKernelWorkGroupInfo(const Kernel *kernelPacked,
const Device *devicePacked,
KernelWorkGroupInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateWaitForEvents(cl_uint num_events, Event *const *event_listPacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetEventInfo(const Event *eventPacked,
EventInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateRetainEvent(const Event *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseEvent(const Event *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetEventProfilingInfo(const Event *eventPacked,
ProfilingInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateFlush(const CommandQueue *command_queuePacked)
{
return CL_SUCCESS;
}
cl_int ValidateFinish(const CommandQueue *command_queuePacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueReadBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_read,
size_t offset,
size_t size,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueWriteBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_write,
size_t offset,
size_t size,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueCopyBuffer(const CommandQueue *command_queuePacked,
const Memory *src_bufferPacked,
const Memory *dst_bufferPacked,
size_t src_offset,
size_t dst_offset,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueReadImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
cl_bool blocking_read,
const size_t *origin,
const size_t *region,
size_t row_pitch,
size_t slice_pitch,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueWriteImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
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,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueCopyImage(const CommandQueue *command_queuePacked,
const Memory *src_imagePacked,
const Memory *dst_imagePacked,
const size_t *src_origin,
const size_t *dst_origin,
const size_t *region,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueCopyImageToBuffer(const CommandQueue *command_queuePacked,
const Memory *src_imagePacked,
const Memory *dst_bufferPacked,
const size_t *src_origin,
const size_t *region,
size_t dst_offset,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueCopyBufferToImage(const CommandQueue *command_queuePacked,
const Memory *src_bufferPacked,
const Memory *dst_imagePacked,
size_t src_offset,
const size_t *dst_origin,
const size_t *region,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
bool ValidateEnqueueMapBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_map,
cl_map_flags map_flags,
size_t offset,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked,
cl_int *errcode_ret)
{
return true;
}
bool ValidateEnqueueMapImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
cl_bool blocking_map,
cl_map_flags map_flags,
const size_t *origin,
const size_t *region,
const size_t *image_row_pitch,
const size_t *image_slice_pitch,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateEnqueueUnmapMemObject(const CommandQueue *command_queuePacked,
const Memory *memobjPacked,
const void *mapped_ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueNDRangeKernel(const CommandQueue *command_queuePacked,
const Kernel *kernelPacked,
cl_uint work_dim,
const size_t *global_work_offset,
const size_t *global_work_size,
const size_t *local_work_size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueNativeKernel(const CommandQueue *command_queuePacked,
void(CL_CALLBACK *user_func)(void *),
const void *args,
size_t cb_args,
cl_uint num_mem_objects,
Memory *const *mem_listPacked,
const void **args_mem_loc,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateSetCommandQueueProperty(const CommandQueue *command_queuePacked,
cl_command_queue_properties properties,
cl_bool enable,
const cl_command_queue_properties *old_properties)
{
return CL_SUCCESS;
}
bool ValidateCreateImage2D(const Context *contextPacked,
cl_mem_flags flags,
const cl_image_format *image_format,
size_t image_width,
size_t image_height,
size_t image_row_pitch,
const void *host_ptr,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreateImage3D(const Context *contextPacked,
cl_mem_flags flags,
const 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,
const void *host_ptr,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateEnqueueMarker(const CommandQueue *command_queuePacked, Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueWaitForEvents(const CommandQueue *command_queuePacked,
cl_uint num_events,
Event *const *event_listPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueBarrier(const CommandQueue *command_queuePacked)
{
return CL_SUCCESS;
}
cl_int ValidateUnloadCompiler()
{
return CL_SUCCESS;
}
bool ValidateGetExtensionFunctionAddress(const char *func_name)
{
return true;
}
bool ValidateCreateCommandQueue(const Context *contextPacked,
const Device *devicePacked,
cl_command_queue_properties properties,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreateSampler(const Context *contextPacked,
cl_bool normalized_coords,
AddressingMode addressing_modePacked,
FilterMode filter_modePacked,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateEnqueueTask(const CommandQueue *command_queuePacked,
const Kernel *kernelPacked,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
// CL 1.1
bool ValidateCreateSubBuffer(const Memory *bufferPacked,
cl_mem_flags flags,
cl_buffer_create_type buffer_create_type,
const void *buffer_create_info,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateSetMemObjectDestructorCallback(const Memory *memobjPacked,
void(CL_CALLBACK *pfn_notify)(cl_mem memobj,
void *user_data),
const void *user_data)
{
return CL_SUCCESS;
}
bool ValidateCreateUserEvent(const Context *contextPacked, cl_int *errcode_ret)
{
return true;
}
cl_int ValidateSetUserEventStatus(const Event *eventPacked, cl_int execution_status)
{
return CL_SUCCESS;
}
cl_int ValidateSetEventCallback(const Event *eventPacked,
cl_int command_exec_callback_type,
void(CL_CALLBACK *pfn_notify)(cl_event event,
cl_int event_command_status,
void *user_data),
const void *user_data)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueReadBufferRect(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_read,
const size_t *buffer_origin,
const size_t *host_origin,
const size_t *region,
size_t buffer_row_pitch,
size_t buffer_slice_pitch,
size_t host_row_pitch,
size_t host_slice_pitch,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueWriteBufferRect(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_write,
const size_t *buffer_origin,
const size_t *host_origin,
const size_t *region,
size_t buffer_row_pitch,
size_t buffer_slice_pitch,
size_t host_row_pitch,
size_t host_slice_pitch,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueCopyBufferRect(const CommandQueue *command_queuePacked,
const Memory *src_bufferPacked,
const Memory *dst_bufferPacked,
const size_t *src_origin,
const size_t *dst_origin,
const size_t *region,
size_t src_row_pitch,
size_t src_slice_pitch,
size_t dst_row_pitch,
size_t dst_slice_pitch,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
// CL 1.2
cl_int ValidateCreateSubDevices(const Device *in_devicePacked,
const cl_device_partition_property *properties,
cl_uint num_devices,
Device *const *out_devicesPacked,
const cl_uint *num_devices_ret)
{
return CL_SUCCESS;
}
cl_int ValidateRetainDevice(const Device *devicePacked)
{
return CL_SUCCESS;
}
cl_int ValidateReleaseDevice(const Device *devicePacked)
{
return CL_SUCCESS;
}
bool ValidateCreateImage(const Context *contextPacked,
cl_mem_flags flags,
const cl_image_format *image_format,
const cl_image_desc *image_desc,
const void *host_ptr,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreateProgramWithBuiltInKernels(const Context *contextPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *kernel_names,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateCompileProgram(const Program *programPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *options,
cl_uint num_input_headers,
Program *const *input_headersPacked,
const char **header_include_names,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
const void *user_data)
{
return CL_SUCCESS;
}
bool ValidateLinkProgram(const Context *contextPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *options,
cl_uint num_input_programs,
Program *const *input_programsPacked,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
const void *user_data,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateUnloadPlatformCompiler(const Platform *platformPacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetKernelArgInfo(const Kernel *kernelPacked,
cl_uint arg_index,
KernelArgInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueFillBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
const void *pattern,
size_t pattern_size,
size_t offset,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueFillImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
const void *fill_color,
const size_t *origin,
const size_t *region,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueMigrateMemObjects(const CommandQueue *command_queuePacked,
cl_uint num_mem_objects,
Memory *const *mem_objectsPacked,
cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueMarkerWithWaitList(const CommandQueue *command_queuePacked,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueBarrierWithWaitList(const CommandQueue *command_queuePacked,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
bool ValidateGetExtensionFunctionAddressForPlatform(const Platform *platformPacked,
const char *func_name)
{
return true;
}
// CL 2.0
bool ValidateCreateCommandQueueWithProperties(const Context *contextPacked,
const Device *devicePacked,
const cl_queue_properties *properties,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreatePipe(const Context *contextPacked,
cl_mem_flags flags,
cl_uint pipe_packet_size,
cl_uint pipe_max_packets,
const cl_pipe_properties *properties,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateGetPipeInfo(const Memory *pipePacked,
PipeInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
bool ValidateSVMAlloc(const Context *contextPacked,
cl_svm_mem_flags flags,
size_t size,
cl_uint alignment)
{
return true;
}
bool ValidateSVMFree(const Context *contextPacked, const void *svm_pointer)
{
return true;
}
bool ValidateCreateSamplerWithProperties(const Context *contextPacked,
const cl_sampler_properties *sampler_properties,
cl_int *errcode_ret)
{
return true;
}
cl_int ValidateSetKernelArgSVMPointer(const Kernel *kernelPacked,
cl_uint arg_index,
const void *arg_value)
{
return CL_SUCCESS;
}
cl_int ValidateSetKernelExecInfo(const Kernel *kernelPacked,
KernelExecInfo param_namePacked,
size_t param_value_size,
const void *param_value)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueSVMFree(const CommandQueue *command_queuePacked,
cl_uint num_svm_pointers,
void *const svm_pointers[],
void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue,
cl_uint num_svm_pointers,
void *svm_pointers[],
void *user_data),
const void *user_data,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueSVMMemcpy(const CommandQueue *command_queuePacked,
cl_bool blocking_copy,
const void *dst_ptr,
const void *src_ptr,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueSVMMemFill(const CommandQueue *command_queuePacked,
const void *svm_ptr,
const void *pattern,
size_t pattern_size,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueSVMMap(const CommandQueue *command_queuePacked,
cl_bool blocking_map,
cl_map_flags flags,
const void *svm_ptr,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueSVMUnmap(const CommandQueue *command_queuePacked,
const void *svm_ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
// CL 2.1
cl_int ValidateSetDefaultDeviceCommandQueue(const Context *contextPacked,
const Device *devicePacked,
const CommandQueue *command_queuePacked)
{
return CL_SUCCESS;
}
cl_int ValidateGetDeviceAndHostTimer(const Device *devicePacked,
const cl_ulong *device_timestamp,
const cl_ulong *host_timestamp)
{
return CL_SUCCESS;
}
cl_int ValidateGetHostTimer(const Device *devicePacked, const cl_ulong *host_timestamp)
{
return CL_SUCCESS;
}
bool ValidateCreateProgramWithIL(const Context *contextPacked,
const void *il,
size_t length,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCloneKernel(const Kernel *source_kernelPacked, cl_int *errcode_ret)
{
return true;
}
cl_int ValidateGetKernelSubGroupInfo(const Kernel *kernelPacked,
const Device *devicePacked,
KernelSubGroupInfo param_namePacked,
size_t input_value_size,
const void *input_value,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret)
{
return CL_SUCCESS;
}
cl_int ValidateEnqueueSVMMigrateMem(const CommandQueue *command_queuePacked,
cl_uint num_svm_pointers,
const void **svm_pointers,
const size_t *sizes,
cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked)
{
return CL_SUCCESS;
}
// CL 2.2
cl_int ValidateSetProgramReleaseCallback(const Program *programPacked,
void(CL_CALLBACK *pfn_notify)(cl_program program,
void *user_data),
const void *user_data)
{
return CL_SUCCESS;
}
cl_int ValidateSetProgramSpecializationConstant(const Program *programPacked,
cl_uint spec_id,
size_t spec_size,
const void *spec_value)
{
return CL_SUCCESS;
}
// CL 3.0
cl_int ValidateSetContextDestructorCallback(const Context *contextPacked,
void(CL_CALLBACK *pfn_notify)(cl_context context,
void *user_data),
const void *user_data)
{
return CL_SUCCESS;
}
bool ValidateCreateBufferWithProperties(const Context *contextPacked,
const cl_mem_properties *properties,
cl_mem_flags flags,
size_t size,
const void *host_ptr,
cl_int *errcode_ret)
{
return true;
}
bool ValidateCreateImageWithProperties(const Context *contextPacked,
const cl_mem_properties *properties,
cl_mem_flags flags,
const cl_image_format *image_format,
const cl_image_desc *image_desc,
const void *host_ptr,
cl_int *errcode_ret)
{
return true;
}
} // namespace cl
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// validationCL.h: Validation functions for generic CL entry point parameters
#ifndef LIBANGLE_VALIDATIONCL_H_
#define LIBANGLE_VALIDATIONCL_H_
#include "libANGLE/CLCommandQueue.h"
#include "libANGLE/CLContext.h"
#include "libANGLE/CLDevice.h"
#include "libANGLE/CLEvent.h"
#include "libANGLE/CLKernel.h"
#include "libANGLE/CLMemory.h"
#include "libANGLE/CLPlatform.h"
#include "libANGLE/CLProgram.h"
#include "libANGLE/CLSampler.h"
#include "common/PackedCLEnums_autogen.h"
#define ANGLE_CL_VALIDATE_VOID(EP, ...) \
do \
{ \
if (!Validate##EP(__VA_ARGS__)) \
{ \
return; \
} \
} while (0)
#define ANGLE_CL_VALIDATE_ERROR(EP, ...) \
do \
{ \
cl_int errorCode = Validate##EP(__VA_ARGS__); \
if (errorCode != CL_SUCCESS) \
{ \
return errorCode; \
} \
} while (0)
#define ANGLE_CL_VALIDATE_POINTER(EP, ...) \
do \
{ \
if (!Validate##EP(__VA_ARGS__)) \
{ \
return nullptr; \
} \
} while (0)
#endif // LIBANGLE_VALIDATIONCL_H_
// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from cl.xml.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// validationCL_autogen.h:
// Validation functions for the CL entry points.
#ifndef LIBANGLE_VALIDATION_CL_AUTOGEN_H_
#define LIBANGLE_VALIDATION_CL_AUTOGEN_H_
#include "libANGLE/validationCL.h"
namespace cl
{
// CL 1.0
cl_int ValidateGetPlatformIDs(cl_uint num_entries,
Platform *const *platformsPacked,
const cl_uint *num_platforms);
cl_int ValidateGetPlatformInfo(const Platform *platformPacked,
PlatformInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateGetDeviceIDs(const Platform *platformPacked,
cl_device_type device_type,
cl_uint num_entries,
Device *const *devicesPacked,
const cl_uint *num_devices);
cl_int ValidateGetDeviceInfo(const Device *devicePacked,
DeviceInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
bool ValidateCreateContext(const cl_context_properties *properties,
cl_uint num_devices,
Device *const *devicesPacked,
void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info,
size_t cb,
void *user_data),
const void *user_data,
cl_int *errcode_ret);
bool ValidateCreateContextFromType(const cl_context_properties *properties,
cl_device_type device_type,
void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info,
size_t cb,
void *user_data),
const void *user_data,
cl_int *errcode_ret);
cl_int ValidateRetainContext(const Context *contextPacked);
cl_int ValidateReleaseContext(const Context *contextPacked);
cl_int ValidateGetContextInfo(const Context *contextPacked,
ContextInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateRetainCommandQueue(const CommandQueue *command_queuePacked);
cl_int ValidateReleaseCommandQueue(const CommandQueue *command_queuePacked);
cl_int ValidateGetCommandQueueInfo(const CommandQueue *command_queuePacked,
CommandQueueInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
bool ValidateCreateBuffer(const Context *contextPacked,
cl_mem_flags flags,
size_t size,
const void *host_ptr,
cl_int *errcode_ret);
cl_int ValidateRetainMemObject(const Memory *memobjPacked);
cl_int ValidateReleaseMemObject(const Memory *memobjPacked);
cl_int ValidateGetSupportedImageFormats(const Context *contextPacked,
cl_mem_flags flags,
MemObjectType image_typePacked,
cl_uint num_entries,
const cl_image_format *image_formats,
const cl_uint *num_image_formats);
cl_int ValidateGetMemObjectInfo(const Memory *memobjPacked,
MemInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateGetImageInfo(const Memory *imagePacked,
ImageInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateRetainSampler(const Sampler *samplerPacked);
cl_int ValidateReleaseSampler(const Sampler *samplerPacked);
cl_int ValidateGetSamplerInfo(const Sampler *samplerPacked,
SamplerInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
bool ValidateCreateProgramWithSource(const Context *contextPacked,
cl_uint count,
const char **strings,
const size_t *lengths,
cl_int *errcode_ret);
bool ValidateCreateProgramWithBinary(const Context *contextPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const size_t *lengths,
const unsigned char **binaries,
const cl_int *binary_status,
cl_int *errcode_ret);
cl_int ValidateRetainProgram(const Program *programPacked);
cl_int ValidateReleaseProgram(const Program *programPacked);
cl_int ValidateBuildProgram(const Program *programPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *options,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
const void *user_data);
cl_int ValidateGetProgramInfo(const Program *programPacked,
ProgramInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateGetProgramBuildInfo(const Program *programPacked,
const Device *devicePacked,
ProgramBuildInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
bool ValidateCreateKernel(const Program *programPacked,
const char *kernel_name,
cl_int *errcode_ret);
cl_int ValidateCreateKernelsInProgram(const Program *programPacked,
cl_uint num_kernels,
Kernel *const *kernelsPacked,
const cl_uint *num_kernels_ret);
cl_int ValidateRetainKernel(const Kernel *kernelPacked);
cl_int ValidateReleaseKernel(const Kernel *kernelPacked);
cl_int ValidateSetKernelArg(const Kernel *kernelPacked,
cl_uint arg_index,
size_t arg_size,
const void *arg_value);
cl_int ValidateGetKernelInfo(const Kernel *kernelPacked,
KernelInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateGetKernelWorkGroupInfo(const Kernel *kernelPacked,
const Device *devicePacked,
KernelWorkGroupInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateWaitForEvents(cl_uint num_events, Event *const *event_listPacked);
cl_int ValidateGetEventInfo(const Event *eventPacked,
EventInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateRetainEvent(const Event *eventPacked);
cl_int ValidateReleaseEvent(const Event *eventPacked);
cl_int ValidateGetEventProfilingInfo(const Event *eventPacked,
ProfilingInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateFlush(const CommandQueue *command_queuePacked);
cl_int ValidateFinish(const CommandQueue *command_queuePacked);
cl_int ValidateEnqueueReadBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_read,
size_t offset,
size_t size,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueWriteBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_write,
size_t offset,
size_t size,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueCopyBuffer(const CommandQueue *command_queuePacked,
const Memory *src_bufferPacked,
const Memory *dst_bufferPacked,
size_t src_offset,
size_t dst_offset,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueReadImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
cl_bool blocking_read,
const size_t *origin,
const size_t *region,
size_t row_pitch,
size_t slice_pitch,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueWriteImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
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,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueCopyImage(const CommandQueue *command_queuePacked,
const Memory *src_imagePacked,
const Memory *dst_imagePacked,
const size_t *src_origin,
const size_t *dst_origin,
const size_t *region,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueCopyImageToBuffer(const CommandQueue *command_queuePacked,
const Memory *src_imagePacked,
const Memory *dst_bufferPacked,
const size_t *src_origin,
const size_t *region,
size_t dst_offset,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueCopyBufferToImage(const CommandQueue *command_queuePacked,
const Memory *src_bufferPacked,
const Memory *dst_imagePacked,
size_t src_offset,
const size_t *dst_origin,
const size_t *region,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
bool ValidateEnqueueMapBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_map,
cl_map_flags map_flags,
size_t offset,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked,
cl_int *errcode_ret);
bool ValidateEnqueueMapImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
cl_bool blocking_map,
cl_map_flags map_flags,
const size_t *origin,
const size_t *region,
const size_t *image_row_pitch,
const size_t *image_slice_pitch,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked,
cl_int *errcode_ret);
cl_int ValidateEnqueueUnmapMemObject(const CommandQueue *command_queuePacked,
const Memory *memobjPacked,
const void *mapped_ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueNDRangeKernel(const CommandQueue *command_queuePacked,
const Kernel *kernelPacked,
cl_uint work_dim,
const size_t *global_work_offset,
const size_t *global_work_size,
const size_t *local_work_size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueNativeKernel(const CommandQueue *command_queuePacked,
void(CL_CALLBACK *user_func)(void *),
const void *args,
size_t cb_args,
cl_uint num_mem_objects,
Memory *const *mem_listPacked,
const void **args_mem_loc,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateSetCommandQueueProperty(const CommandQueue *command_queuePacked,
cl_command_queue_properties properties,
cl_bool enable,
const cl_command_queue_properties *old_properties);
bool ValidateCreateImage2D(const Context *contextPacked,
cl_mem_flags flags,
const cl_image_format *image_format,
size_t image_width,
size_t image_height,
size_t image_row_pitch,
const void *host_ptr,
cl_int *errcode_ret);
bool ValidateCreateImage3D(const Context *contextPacked,
cl_mem_flags flags,
const 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,
const void *host_ptr,
cl_int *errcode_ret);
cl_int ValidateEnqueueMarker(const CommandQueue *command_queuePacked, Event *const *eventPacked);
cl_int ValidateEnqueueWaitForEvents(const CommandQueue *command_queuePacked,
cl_uint num_events,
Event *const *event_listPacked);
cl_int ValidateEnqueueBarrier(const CommandQueue *command_queuePacked);
cl_int ValidateUnloadCompiler();
bool ValidateGetExtensionFunctionAddress(const char *func_name);
bool ValidateCreateCommandQueue(const Context *contextPacked,
const Device *devicePacked,
cl_command_queue_properties properties,
cl_int *errcode_ret);
bool ValidateCreateSampler(const Context *contextPacked,
cl_bool normalized_coords,
AddressingMode addressing_modePacked,
FilterMode filter_modePacked,
cl_int *errcode_ret);
cl_int ValidateEnqueueTask(const CommandQueue *command_queuePacked,
const Kernel *kernelPacked,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
// CL 1.1
bool ValidateCreateSubBuffer(const Memory *bufferPacked,
cl_mem_flags flags,
cl_buffer_create_type buffer_create_type,
const void *buffer_create_info,
cl_int *errcode_ret);
cl_int ValidateSetMemObjectDestructorCallback(const Memory *memobjPacked,
void(CL_CALLBACK *pfn_notify)(cl_mem memobj,
void *user_data),
const void *user_data);
bool ValidateCreateUserEvent(const Context *contextPacked, cl_int *errcode_ret);
cl_int ValidateSetUserEventStatus(const Event *eventPacked, cl_int execution_status);
cl_int ValidateSetEventCallback(const Event *eventPacked,
cl_int command_exec_callback_type,
void(CL_CALLBACK *pfn_notify)(cl_event event,
cl_int event_command_status,
void *user_data),
const void *user_data);
cl_int ValidateEnqueueReadBufferRect(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_read,
const size_t *buffer_origin,
const size_t *host_origin,
const size_t *region,
size_t buffer_row_pitch,
size_t buffer_slice_pitch,
size_t host_row_pitch,
size_t host_slice_pitch,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueWriteBufferRect(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
cl_bool blocking_write,
const size_t *buffer_origin,
const size_t *host_origin,
const size_t *region,
size_t buffer_row_pitch,
size_t buffer_slice_pitch,
size_t host_row_pitch,
size_t host_slice_pitch,
const void *ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueCopyBufferRect(const CommandQueue *command_queuePacked,
const Memory *src_bufferPacked,
const Memory *dst_bufferPacked,
const size_t *src_origin,
const size_t *dst_origin,
const size_t *region,
size_t src_row_pitch,
size_t src_slice_pitch,
size_t dst_row_pitch,
size_t dst_slice_pitch,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
// CL 1.2
cl_int ValidateCreateSubDevices(const Device *in_devicePacked,
const cl_device_partition_property *properties,
cl_uint num_devices,
Device *const *out_devicesPacked,
const cl_uint *num_devices_ret);
cl_int ValidateRetainDevice(const Device *devicePacked);
cl_int ValidateReleaseDevice(const Device *devicePacked);
bool ValidateCreateImage(const Context *contextPacked,
cl_mem_flags flags,
const cl_image_format *image_format,
const cl_image_desc *image_desc,
const void *host_ptr,
cl_int *errcode_ret);
bool ValidateCreateProgramWithBuiltInKernels(const Context *contextPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *kernel_names,
cl_int *errcode_ret);
cl_int ValidateCompileProgram(const Program *programPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *options,
cl_uint num_input_headers,
Program *const *input_headersPacked,
const char **header_include_names,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
const void *user_data);
bool ValidateLinkProgram(const Context *contextPacked,
cl_uint num_devices,
Device *const *device_listPacked,
const char *options,
cl_uint num_input_programs,
Program *const *input_programsPacked,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
const void *user_data,
cl_int *errcode_ret);
cl_int ValidateUnloadPlatformCompiler(const Platform *platformPacked);
cl_int ValidateGetKernelArgInfo(const Kernel *kernelPacked,
cl_uint arg_index,
KernelArgInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateEnqueueFillBuffer(const CommandQueue *command_queuePacked,
const Memory *bufferPacked,
const void *pattern,
size_t pattern_size,
size_t offset,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueFillImage(const CommandQueue *command_queuePacked,
const Memory *imagePacked,
const void *fill_color,
const size_t *origin,
const size_t *region,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueMigrateMemObjects(const CommandQueue *command_queuePacked,
cl_uint num_mem_objects,
Memory *const *mem_objectsPacked,
cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueMarkerWithWaitList(const CommandQueue *command_queuePacked,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueBarrierWithWaitList(const CommandQueue *command_queuePacked,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
bool ValidateGetExtensionFunctionAddressForPlatform(const Platform *platformPacked,
const char *func_name);
// CL 2.0
bool ValidateCreateCommandQueueWithProperties(const Context *contextPacked,
const Device *devicePacked,
const cl_queue_properties *properties,
cl_int *errcode_ret);
bool ValidateCreatePipe(const Context *contextPacked,
cl_mem_flags flags,
cl_uint pipe_packet_size,
cl_uint pipe_max_packets,
const cl_pipe_properties *properties,
cl_int *errcode_ret);
cl_int ValidateGetPipeInfo(const Memory *pipePacked,
PipeInfo param_namePacked,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
bool ValidateSVMAlloc(const Context *contextPacked,
cl_svm_mem_flags flags,
size_t size,
cl_uint alignment);
bool ValidateSVMFree(const Context *contextPacked, const void *svm_pointer);
bool ValidateCreateSamplerWithProperties(const Context *contextPacked,
const cl_sampler_properties *sampler_properties,
cl_int *errcode_ret);
cl_int ValidateSetKernelArgSVMPointer(const Kernel *kernelPacked,
cl_uint arg_index,
const void *arg_value);
cl_int ValidateSetKernelExecInfo(const Kernel *kernelPacked,
KernelExecInfo param_namePacked,
size_t param_value_size,
const void *param_value);
cl_int ValidateEnqueueSVMFree(const CommandQueue *command_queuePacked,
cl_uint num_svm_pointers,
void *const svm_pointers[],
void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue,
cl_uint num_svm_pointers,
void *svm_pointers[],
void *user_data),
const void *user_data,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueSVMMemcpy(const CommandQueue *command_queuePacked,
cl_bool blocking_copy,
const void *dst_ptr,
const void *src_ptr,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueSVMMemFill(const CommandQueue *command_queuePacked,
const void *svm_ptr,
const void *pattern,
size_t pattern_size,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueSVMMap(const CommandQueue *command_queuePacked,
cl_bool blocking_map,
cl_map_flags flags,
const void *svm_ptr,
size_t size,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
cl_int ValidateEnqueueSVMUnmap(const CommandQueue *command_queuePacked,
const void *svm_ptr,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
// CL 2.1
cl_int ValidateSetDefaultDeviceCommandQueue(const Context *contextPacked,
const Device *devicePacked,
const CommandQueue *command_queuePacked);
cl_int ValidateGetDeviceAndHostTimer(const Device *devicePacked,
const cl_ulong *device_timestamp,
const cl_ulong *host_timestamp);
cl_int ValidateGetHostTimer(const Device *devicePacked, const cl_ulong *host_timestamp);
bool ValidateCreateProgramWithIL(const Context *contextPacked,
const void *il,
size_t length,
cl_int *errcode_ret);
bool ValidateCloneKernel(const Kernel *source_kernelPacked, cl_int *errcode_ret);
cl_int ValidateGetKernelSubGroupInfo(const Kernel *kernelPacked,
const Device *devicePacked,
KernelSubGroupInfo param_namePacked,
size_t input_value_size,
const void *input_value,
size_t param_value_size,
const void *param_value,
const size_t *param_value_size_ret);
cl_int ValidateEnqueueSVMMigrateMem(const CommandQueue *command_queuePacked,
cl_uint num_svm_pointers,
const void **svm_pointers,
const size_t *sizes,
cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list,
Event *const *event_wait_listPacked,
Event *const *eventPacked);
// CL 2.2
cl_int ValidateSetProgramReleaseCallback(const Program *programPacked,
void(CL_CALLBACK *pfn_notify)(cl_program program,
void *user_data),
const void *user_data);
cl_int ValidateSetProgramSpecializationConstant(const Program *programPacked,
cl_uint spec_id,
size_t spec_size,
const void *spec_value);
// CL 3.0
cl_int ValidateSetContextDestructorCallback(const Context *contextPacked,
void(CL_CALLBACK *pfn_notify)(cl_context context,
void *user_data),
const void *user_data);
bool ValidateCreateBufferWithProperties(const Context *contextPacked,
const cl_mem_properties *properties,
cl_mem_flags flags,
size_t size,
const void *host_ptr,
cl_int *errcode_ret);
bool ValidateCreateImageWithProperties(const Context *contextPacked,
const cl_mem_properties *properties,
cl_mem_flags flags,
const cl_image_format *image_format,
const cl_image_desc *image_desc,
const void *host_ptr,
cl_int *errcode_ret);
} // namespace cl
#endif // LIBANGLE_VALIDATION_CL_AUTOGEN_H_
......@@ -6,7 +6,7 @@
// validationEGL.cpp: Validation functions for generic EGL entry point parameters
#include "libANGLE/validationEGL.h"
#include "libANGLE/validationEGL_autogen.h"
#include "common/utilities.h"
#include "libANGLE/Config.h"
......
......@@ -459,6 +459,9 @@ libangle_cl_headers = [
"src/libANGLE/CLPlatform.h",
"src/libANGLE/CLProgram.h",
"src/libANGLE/CLSampler.h",
"src/libANGLE/CLtypes.h",
"src/libANGLE/validationCL.h",
"src/libANGLE/validationCL_autogen.h",
]
libangle_cl_sources = [
......@@ -471,6 +474,7 @@ libangle_cl_sources = [
"src/libANGLE/CLPlatform.cpp",
"src/libANGLE/CLProgram.cpp",
"src/libANGLE/CLSampler.cpp",
"src/libANGLE/validationCL.cpp",
]
libangle_mac_sources = [
......@@ -575,7 +579,6 @@ libglesv2_cl_sources = [
"src/libGLESv2/entry_points_cl_autogen.cpp",
"src/libGLESv2/entry_points_cl_autogen.h",
"src/libGLESv2/entry_points_cl_utils.h",
"src/libGLESv2/validationCL.h",
]
if (is_win) {
......
......@@ -10,22 +10,12 @@
#ifndef LIBGLESV2_CL_STUBS_AUTOGEN_H_
#define LIBGLESV2_CL_STUBS_AUTOGEN_H_
#include "angle_cl.h"
#include "libANGLE/CLtypes.h"
#include "common/PackedCLEnums_autogen.h"
namespace cl
{
class CommandQueue;
class Context;
class Device;
class Event;
class Kernel;
class Memory;
class Platform;
class Program;
class Sampler;
cl_int GetPlatformIDs(cl_uint num_entries, Platform **platformsPacked, cl_uint *num_platforms);
cl_int GetPlatformInfo(Platform *platformPacked,
PlatformInfo param_namePacked,
......
......@@ -12,7 +12,8 @@
#include "cl_stubs_autogen.h"
#include "entry_points_cl_utils.h"
#include "validationCL.h"
#include "libANGLE/validationCL_autogen.h"
using namespace cl;
......@@ -29,9 +30,9 @@ cl_int CL_API_CALL CL_GetPlatformIDs(cl_uint num_entries,
Platform **platformsPacked = PackParam<Platform **>(platforms);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetPlatformIDs, num_entries, platformsPacked, num_platforms);
return (cl::GetPlatformIDs(num_entries, platformsPacked, num_platforms));
return (GetPlatformIDs(num_entries, platformsPacked, num_platforms));
}
cl_int CL_API_CALL CL_GetPlatformInfo(cl_platform_id platform,
......@@ -50,10 +51,11 @@ cl_int CL_API_CALL CL_GetPlatformInfo(cl_platform_id platform,
Platform *platformPacked = PackParam<Platform *>(platform);
PlatformInfo param_namePacked = PackParam<PlatformInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetPlatformInfo, platformPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetPlatformInfo(platformPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetPlatformInfo(platformPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_GetDeviceIDs(cl_platform_id platform,
......@@ -72,9 +74,10 @@ cl_int CL_API_CALL CL_GetDeviceIDs(cl_platform_id platform,
Platform *platformPacked = PackParam<Platform *>(platform);
Device **devicesPacked = PackParam<Device **>(devices);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetDeviceIDs, platformPacked, device_type, num_entries, devicesPacked,
num_devices);
return (cl::GetDeviceIDs(platformPacked, device_type, num_entries, devicesPacked, num_devices));
return (GetDeviceIDs(platformPacked, device_type, num_entries, devicesPacked, num_devices));
}
cl_int CL_API_CALL CL_GetDeviceInfo(cl_device_id device,
......@@ -93,10 +96,11 @@ cl_int CL_API_CALL CL_GetDeviceInfo(cl_device_id device,
Device *devicePacked = PackParam<Device *>(device);
DeviceInfo param_namePacked = PackParam<DeviceInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetDeviceInfo, devicePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetDeviceInfo(devicePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetDeviceInfo(devicePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_context CL_API_CALL CL_CreateContext(const cl_context_properties *properties,
......@@ -118,10 +122,11 @@ cl_context CL_API_CALL CL_CreateContext(const cl_context_properties *properties,
Device *const *devicesPacked = PackParam<Device *const *>(devices);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateContext, properties, num_devices, devicesPacked, pfn_notify,
user_data, errcode_ret);
return UnpackParam<cl_context>(cl::CreateContext(properties, num_devices, devicesPacked,
pfn_notify, user_data, errcode_ret));
return UnpackParam<cl_context>(
CreateContext(properties, num_devices, devicesPacked, pfn_notify, user_data, errcode_ret));
}
cl_context CL_API_CALL
......@@ -140,10 +145,11 @@ CL_CreateContextFromType(const cl_context_properties *properties,
(uintptr_t)properties, device_type, (uintptr_t)pfn_notify, (uintptr_t)user_data,
(uintptr_t)errcode_ret);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateContextFromType, properties, device_type, pfn_notify, user_data,
errcode_ret);
return UnpackParam<cl_context>(
cl::CreateContextFromType(properties, device_type, pfn_notify, user_data, errcode_ret));
CreateContextFromType(properties, device_type, pfn_notify, user_data, errcode_ret));
}
cl_int CL_API_CALL CL_RetainContext(cl_context context)
......@@ -152,9 +158,9 @@ cl_int CL_API_CALL CL_RetainContext(cl_context context)
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainContext, contextPacked);
return (cl::RetainContext(contextPacked));
return (RetainContext(contextPacked));
}
cl_int CL_API_CALL CL_ReleaseContext(cl_context context)
......@@ -163,9 +169,9 @@ cl_int CL_API_CALL CL_ReleaseContext(cl_context context)
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseContext, contextPacked);
return (cl::ReleaseContext(contextPacked));
return (ReleaseContext(contextPacked));
}
cl_int CL_API_CALL CL_GetContextInfo(cl_context context,
......@@ -184,10 +190,11 @@ cl_int CL_API_CALL CL_GetContextInfo(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
ContextInfo param_namePacked = PackParam<ContextInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetContextInfo, contextPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetContextInfo(contextPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetContextInfo(contextPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_RetainCommandQueue(cl_command_queue command_queue)
......@@ -196,9 +203,9 @@ cl_int CL_API_CALL CL_RetainCommandQueue(cl_command_queue command_queue)
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainCommandQueue, command_queuePacked);
return (cl::RetainCommandQueue(command_queuePacked));
return (RetainCommandQueue(command_queuePacked));
}
cl_int CL_API_CALL CL_ReleaseCommandQueue(cl_command_queue command_queue)
......@@ -207,9 +214,9 @@ cl_int CL_API_CALL CL_ReleaseCommandQueue(cl_command_queue command_queue)
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseCommandQueue, command_queuePacked);
return (cl::ReleaseCommandQueue(command_queuePacked));
return (ReleaseCommandQueue(command_queuePacked));
}
cl_int CL_API_CALL CL_GetCommandQueueInfo(cl_command_queue command_queue,
......@@ -228,10 +235,11 @@ cl_int CL_API_CALL CL_GetCommandQueueInfo(cl_command_queue command_queue,
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
CommandQueueInfo param_namePacked = PackParam<CommandQueueInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetCommandQueueInfo, command_queuePacked, param_namePacked,
param_value_size, param_value, param_value_size_ret);
return (cl::GetCommandQueueInfo(command_queuePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret));
return (GetCommandQueueInfo(command_queuePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret));
}
cl_mem CL_API_CALL CL_CreateBuffer(cl_context context,
......@@ -247,9 +255,9 @@ cl_mem CL_API_CALL CL_CreateBuffer(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateBuffer, contextPacked, flags, size, host_ptr, errcode_ret);
return UnpackParam<cl_mem>(cl::CreateBuffer(contextPacked, flags, size, host_ptr, errcode_ret));
return UnpackParam<cl_mem>(CreateBuffer(contextPacked, flags, size, host_ptr, errcode_ret));
}
cl_int CL_API_CALL CL_RetainMemObject(cl_mem memobj)
......@@ -258,9 +266,9 @@ cl_int CL_API_CALL CL_RetainMemObject(cl_mem memobj)
Memory *memobjPacked = PackParam<Memory *>(memobj);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainMemObject, memobjPacked);
return (cl::RetainMemObject(memobjPacked));
return (RetainMemObject(memobjPacked));
}
cl_int CL_API_CALL CL_ReleaseMemObject(cl_mem memobj)
......@@ -269,9 +277,9 @@ cl_int CL_API_CALL CL_ReleaseMemObject(cl_mem memobj)
Memory *memobjPacked = PackParam<Memory *>(memobj);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseMemObject, memobjPacked);
return (cl::ReleaseMemObject(memobjPacked));
return (ReleaseMemObject(memobjPacked));
}
cl_int CL_API_CALL CL_GetSupportedImageFormats(cl_context context,
......@@ -291,10 +299,11 @@ cl_int CL_API_CALL CL_GetSupportedImageFormats(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
MemObjectType image_typePacked = PackParam<MemObjectType>(image_type);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetSupportedImageFormats, contextPacked, flags, image_typePacked,
num_entries, image_formats, num_image_formats);
return (cl::GetSupportedImageFormats(contextPacked, flags, image_typePacked, num_entries,
image_formats, num_image_formats));
return (GetSupportedImageFormats(contextPacked, flags, image_typePacked, num_entries,
image_formats, num_image_formats));
}
cl_int CL_API_CALL CL_GetMemObjectInfo(cl_mem memobj,
......@@ -313,10 +322,11 @@ cl_int CL_API_CALL CL_GetMemObjectInfo(cl_mem memobj,
Memory *memobjPacked = PackParam<Memory *>(memobj);
MemInfo param_namePacked = PackParam<MemInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetMemObjectInfo, memobjPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetMemObjectInfo(memobjPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetMemObjectInfo(memobjPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_GetImageInfo(cl_mem image,
......@@ -335,10 +345,11 @@ cl_int CL_API_CALL CL_GetImageInfo(cl_mem image,
Memory *imagePacked = PackParam<Memory *>(image);
ImageInfo param_namePacked = PackParam<ImageInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetImageInfo, imagePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetImageInfo(imagePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetImageInfo(imagePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_RetainSampler(cl_sampler sampler)
......@@ -347,9 +358,9 @@ cl_int CL_API_CALL CL_RetainSampler(cl_sampler sampler)
Sampler *samplerPacked = PackParam<Sampler *>(sampler);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainSampler, samplerPacked);
return (cl::RetainSampler(samplerPacked));
return (RetainSampler(samplerPacked));
}
cl_int CL_API_CALL CL_ReleaseSampler(cl_sampler sampler)
......@@ -358,9 +369,9 @@ cl_int CL_API_CALL CL_ReleaseSampler(cl_sampler sampler)
Sampler *samplerPacked = PackParam<Sampler *>(sampler);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseSampler, samplerPacked);
return (cl::ReleaseSampler(samplerPacked));
return (ReleaseSampler(samplerPacked));
}
cl_int CL_API_CALL CL_GetSamplerInfo(cl_sampler sampler,
......@@ -379,10 +390,11 @@ cl_int CL_API_CALL CL_GetSamplerInfo(cl_sampler sampler,
Sampler *samplerPacked = PackParam<Sampler *>(sampler);
SamplerInfo param_namePacked = PackParam<SamplerInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetSamplerInfo, samplerPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetSamplerInfo(samplerPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetSamplerInfo(samplerPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_program CL_API_CALL CL_CreateProgramWithSource(cl_context context,
......@@ -399,10 +411,11 @@ cl_program CL_API_CALL CL_CreateProgramWithSource(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateProgramWithSource, contextPacked, count, strings, lengths,
errcode_ret);
return UnpackParam<cl_program>(
cl::CreateProgramWithSource(contextPacked, count, strings, lengths, errcode_ret));
CreateProgramWithSource(contextPacked, count, strings, lengths, errcode_ret));
}
cl_program CL_API_CALL CL_CreateProgramWithBinary(cl_context context,
......@@ -423,11 +436,12 @@ cl_program CL_API_CALL CL_CreateProgramWithBinary(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateProgramWithBinary, contextPacked, num_devices,
device_listPacked, lengths, binaries, binary_status, errcode_ret);
return UnpackParam<cl_program>(cl::CreateProgramWithBinary(contextPacked, num_devices,
device_listPacked, lengths, binaries,
binary_status, errcode_ret));
return UnpackParam<cl_program>(CreateProgramWithBinary(contextPacked, num_devices,
device_listPacked, lengths, binaries,
binary_status, errcode_ret));
}
cl_int CL_API_CALL CL_RetainProgram(cl_program program)
......@@ -436,9 +450,9 @@ cl_int CL_API_CALL CL_RetainProgram(cl_program program)
Program *programPacked = PackParam<Program *>(program);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainProgram, programPacked);
return (cl::RetainProgram(programPacked));
return (RetainProgram(programPacked));
}
cl_int CL_API_CALL CL_ReleaseProgram(cl_program program)
......@@ -447,9 +461,9 @@ cl_int CL_API_CALL CL_ReleaseProgram(cl_program program)
Program *programPacked = PackParam<Program *>(program);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseProgram, programPacked);
return (cl::ReleaseProgram(programPacked));
return (ReleaseProgram(programPacked));
}
cl_int CL_API_CALL CL_BuildProgram(cl_program program,
......@@ -470,10 +484,11 @@ cl_int CL_API_CALL CL_BuildProgram(cl_program program,
Program *programPacked = PackParam<Program *>(program);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(BuildProgram, programPacked, num_devices, device_listPacked, options,
pfn_notify, user_data);
return (cl::BuildProgram(programPacked, num_devices, device_listPacked, options, pfn_notify,
user_data));
return (BuildProgram(programPacked, num_devices, device_listPacked, options, pfn_notify,
user_data));
}
cl_int CL_API_CALL CL_GetProgramInfo(cl_program program,
......@@ -492,10 +507,11 @@ cl_int CL_API_CALL CL_GetProgramInfo(cl_program program,
Program *programPacked = PackParam<Program *>(program);
ProgramInfo param_namePacked = PackParam<ProgramInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetProgramInfo, programPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetProgramInfo(programPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetProgramInfo(programPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_GetProgramBuildInfo(cl_program program,
......@@ -516,10 +532,11 @@ cl_int CL_API_CALL CL_GetProgramBuildInfo(cl_program program,
Device *devicePacked = PackParam<Device *>(device);
ProgramBuildInfo param_namePacked = PackParam<ProgramBuildInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetProgramBuildInfo, programPacked, devicePacked, param_namePacked,
param_value_size, param_value, param_value_size_ret);
return (cl::GetProgramBuildInfo(programPacked, devicePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret));
return (GetProgramBuildInfo(programPacked, devicePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret));
}
cl_kernel CL_API_CALL CL_CreateKernel(cl_program program,
......@@ -533,9 +550,9 @@ cl_kernel CL_API_CALL CL_CreateKernel(cl_program program,
Program *programPacked = PackParam<Program *>(program);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateKernel, programPacked, kernel_name, errcode_ret);
return UnpackParam<cl_kernel>(cl::CreateKernel(programPacked, kernel_name, errcode_ret));
return UnpackParam<cl_kernel>(CreateKernel(programPacked, kernel_name, errcode_ret));
}
cl_int CL_API_CALL CL_CreateKernelsInProgram(cl_program program,
......@@ -551,9 +568,10 @@ cl_int CL_API_CALL CL_CreateKernelsInProgram(cl_program program,
Program *programPacked = PackParam<Program *>(program);
Kernel **kernelsPacked = PackParam<Kernel **>(kernels);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(CreateKernelsInProgram, programPacked, num_kernels, kernelsPacked,
num_kernels_ret);
return (cl::CreateKernelsInProgram(programPacked, num_kernels, kernelsPacked, num_kernels_ret));
return (CreateKernelsInProgram(programPacked, num_kernels, kernelsPacked, num_kernels_ret));
}
cl_int CL_API_CALL CL_RetainKernel(cl_kernel kernel)
......@@ -562,9 +580,9 @@ cl_int CL_API_CALL CL_RetainKernel(cl_kernel kernel)
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainKernel, kernelPacked);
return (cl::RetainKernel(kernelPacked));
return (RetainKernel(kernelPacked));
}
cl_int CL_API_CALL CL_ReleaseKernel(cl_kernel kernel)
......@@ -573,9 +591,9 @@ cl_int CL_API_CALL CL_ReleaseKernel(cl_kernel kernel)
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseKernel, kernelPacked);
return (cl::ReleaseKernel(kernelPacked));
return (ReleaseKernel(kernelPacked));
}
cl_int CL_API_CALL CL_SetKernelArg(cl_kernel kernel,
......@@ -590,9 +608,9 @@ cl_int CL_API_CALL CL_SetKernelArg(cl_kernel kernel,
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetKernelArg, kernelPacked, arg_index, arg_size, arg_value);
return (cl::SetKernelArg(kernelPacked, arg_index, arg_size, arg_value));
return (SetKernelArg(kernelPacked, arg_index, arg_size, arg_value));
}
cl_int CL_API_CALL CL_GetKernelInfo(cl_kernel kernel,
......@@ -611,10 +629,11 @@ cl_int CL_API_CALL CL_GetKernelInfo(cl_kernel kernel,
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
KernelInfo param_namePacked = PackParam<KernelInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetKernelInfo, kernelPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetKernelInfo(kernelPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetKernelInfo(kernelPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_GetKernelWorkGroupInfo(cl_kernel kernel,
......@@ -635,10 +654,11 @@ cl_int CL_API_CALL CL_GetKernelWorkGroupInfo(cl_kernel kernel,
Device *devicePacked = PackParam<Device *>(device);
KernelWorkGroupInfo param_namePacked = PackParam<KernelWorkGroupInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetKernelWorkGroupInfo, kernelPacked, devicePacked, param_namePacked,
param_value_size, param_value, param_value_size_ret);
return (cl::GetKernelWorkGroupInfo(kernelPacked, devicePacked, param_namePacked,
param_value_size, param_value, param_value_size_ret));
return (GetKernelWorkGroupInfo(kernelPacked, devicePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret));
}
cl_int CL_API_CALL CL_WaitForEvents(cl_uint num_events, const cl_event *event_list)
......@@ -648,9 +668,9 @@ cl_int CL_API_CALL CL_WaitForEvents(cl_uint num_events, const cl_event *event_li
Event *const *event_listPacked = PackParam<Event *const *>(event_list);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(WaitForEvents, num_events, event_listPacked);
return (cl::WaitForEvents(num_events, event_listPacked));
return (WaitForEvents(num_events, event_listPacked));
}
cl_int CL_API_CALL CL_GetEventInfo(cl_event event,
......@@ -669,10 +689,11 @@ cl_int CL_API_CALL CL_GetEventInfo(cl_event event,
Event *eventPacked = PackParam<Event *>(event);
EventInfo param_namePacked = PackParam<EventInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetEventInfo, eventPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetEventInfo(eventPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetEventInfo(eventPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_RetainEvent(cl_event event)
......@@ -681,9 +702,9 @@ cl_int CL_API_CALL CL_RetainEvent(cl_event event)
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainEvent, eventPacked);
return (cl::RetainEvent(eventPacked));
return (RetainEvent(eventPacked));
}
cl_int CL_API_CALL CL_ReleaseEvent(cl_event event)
......@@ -692,9 +713,9 @@ cl_int CL_API_CALL CL_ReleaseEvent(cl_event event)
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseEvent, eventPacked);
return (cl::ReleaseEvent(eventPacked));
return (ReleaseEvent(eventPacked));
}
cl_int CL_API_CALL CL_GetEventProfilingInfo(cl_event event,
......@@ -713,10 +734,11 @@ cl_int CL_API_CALL CL_GetEventProfilingInfo(cl_event event,
Event *eventPacked = PackParam<Event *>(event);
ProfilingInfo param_namePacked = PackParam<ProfilingInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetEventProfilingInfo, eventPacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetEventProfilingInfo(eventPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetEventProfilingInfo(eventPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_Flush(cl_command_queue command_queue)
......@@ -725,9 +747,9 @@ cl_int CL_API_CALL CL_Flush(cl_command_queue command_queue)
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(Flush, command_queuePacked);
return (cl::Flush(command_queuePacked));
return (Flush(command_queuePacked));
}
cl_int CL_API_CALL CL_Finish(cl_command_queue command_queue)
......@@ -736,9 +758,9 @@ cl_int CL_API_CALL CL_Finish(cl_command_queue command_queue)
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(Finish, command_queuePacked);
return (cl::Finish(command_queuePacked));
return (Finish(command_queuePacked));
}
cl_int CL_API_CALL CL_EnqueueReadBuffer(cl_command_queue command_queue,
......@@ -764,11 +786,12 @@ cl_int CL_API_CALL CL_EnqueueReadBuffer(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueReadBuffer, command_queuePacked, bufferPacked, blocking_read,
offset, size, ptr, num_events_in_wait_list, event_wait_listPacked,
eventPacked);
return (cl::EnqueueReadBuffer(command_queuePacked, bufferPacked, blocking_read, offset, size,
ptr, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueReadBuffer(command_queuePacked, bufferPacked, blocking_read, offset, size, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueWriteBuffer(cl_command_queue command_queue,
......@@ -794,11 +817,12 @@ cl_int CL_API_CALL CL_EnqueueWriteBuffer(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueWriteBuffer, command_queuePacked, bufferPacked, blocking_write,
offset, size, ptr, num_events_in_wait_list, event_wait_listPacked,
eventPacked);
return (cl::EnqueueWriteBuffer(command_queuePacked, bufferPacked, blocking_write, offset, size,
ptr, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueWriteBuffer(command_queuePacked, bufferPacked, blocking_write, offset, size, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueCopyBuffer(cl_command_queue command_queue,
......@@ -826,11 +850,13 @@ cl_int CL_API_CALL CL_EnqueueCopyBuffer(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueCopyBuffer, command_queuePacked, src_bufferPacked,
dst_bufferPacked, src_offset, dst_offset, size, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueCopyBuffer(command_queuePacked, src_bufferPacked, dst_bufferPacked,
src_offset, dst_offset, size, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueCopyBuffer(command_queuePacked, src_bufferPacked, dst_bufferPacked, src_offset,
dst_offset, size, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
}
cl_int CL_API_CALL CL_EnqueueReadImage(cl_command_queue command_queue,
......@@ -860,11 +886,13 @@ cl_int CL_API_CALL CL_EnqueueReadImage(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueReadImage, command_queuePacked, imagePacked, blocking_read,
origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueReadImage(command_queuePacked, imagePacked, blocking_read, origin, region,
row_pitch, slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueReadImage(command_queuePacked, imagePacked, blocking_read, origin, region,
row_pitch, slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueWriteImage(cl_command_queue command_queue,
......@@ -894,11 +922,13 @@ cl_int CL_API_CALL CL_EnqueueWriteImage(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueWriteImage, command_queuePacked, imagePacked, blocking_write,
origin, region, input_row_pitch, input_slice_pitch, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueWriteImage(command_queuePacked, imagePacked, blocking_write, origin, region,
input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueWriteImage(command_queuePacked, imagePacked, blocking_write, origin, region,
input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueCopyImage(cl_command_queue command_queue,
......@@ -927,11 +957,13 @@ cl_int CL_API_CALL CL_EnqueueCopyImage(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueCopyImage, command_queuePacked, src_imagePacked, dst_imagePacked,
src_origin, dst_origin, region, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueCopyImage(command_queuePacked, src_imagePacked, dst_imagePacked, src_origin,
dst_origin, region, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueCopyImage(command_queuePacked, src_imagePacked, dst_imagePacked, src_origin,
dst_origin, region, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
}
cl_int CL_API_CALL CL_EnqueueCopyImageToBuffer(cl_command_queue command_queue,
......@@ -960,11 +992,13 @@ cl_int CL_API_CALL CL_EnqueueCopyImageToBuffer(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueCopyImageToBuffer, command_queuePacked, src_imagePacked,
dst_bufferPacked, src_origin, region, dst_offset,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueCopyImageToBuffer(command_queuePacked, src_imagePacked, dst_bufferPacked,
src_origin, region, dst_offset, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueCopyImageToBuffer(command_queuePacked, src_imagePacked, dst_bufferPacked,
src_origin, region, dst_offset, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueCopyBufferToImage(cl_command_queue command_queue,
......@@ -993,11 +1027,13 @@ cl_int CL_API_CALL CL_EnqueueCopyBufferToImage(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueCopyBufferToImage, command_queuePacked, src_bufferPacked,
dst_imagePacked, src_offset, dst_origin, region,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueCopyBufferToImage(command_queuePacked, src_bufferPacked, dst_imagePacked,
src_offset, dst_origin, region, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueCopyBufferToImage(command_queuePacked, src_bufferPacked, dst_imagePacked,
src_offset, dst_origin, region, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
void *CL_API_CALL CL_EnqueueMapBuffer(cl_command_queue command_queue,
......@@ -1025,11 +1061,13 @@ void *CL_API_CALL CL_EnqueueMapBuffer(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(EnqueueMapBuffer, command_queuePacked, bufferPacked, blocking_map,
map_flags, offset, size, num_events_in_wait_list,
event_wait_listPacked, eventPacked, errcode_ret);
return (cl::EnqueueMapBuffer(command_queuePacked, bufferPacked, blocking_map, map_flags, offset,
size, num_events_in_wait_list, event_wait_listPacked, eventPacked,
errcode_ret));
return (EnqueueMapBuffer(command_queuePacked, bufferPacked, blocking_map, map_flags, offset,
size, num_events_in_wait_list, event_wait_listPacked, eventPacked,
errcode_ret));
}
void *CL_API_CALL CL_EnqueueMapImage(cl_command_queue command_queue,
......@@ -1062,11 +1100,14 @@ void *CL_API_CALL CL_EnqueueMapImage(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(EnqueueMapImage, command_queuePacked, imagePacked, blocking_map,
map_flags, origin, region, image_row_pitch, image_slice_pitch,
num_events_in_wait_list, event_wait_listPacked, eventPacked,
errcode_ret);
return (cl::EnqueueMapImage(command_queuePacked, imagePacked, blocking_map, map_flags, origin,
region, image_row_pitch, image_slice_pitch, num_events_in_wait_list,
event_wait_listPacked, eventPacked, errcode_ret));
return (EnqueueMapImage(command_queuePacked, imagePacked, blocking_map, map_flags, origin,
region, image_row_pitch, image_slice_pitch, num_events_in_wait_list,
event_wait_listPacked, eventPacked, errcode_ret));
}
cl_int CL_API_CALL CL_EnqueueUnmapMemObject(cl_command_queue command_queue,
......@@ -1089,10 +1130,11 @@ cl_int CL_API_CALL CL_EnqueueUnmapMemObject(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueUnmapMemObject, command_queuePacked, memobjPacked, mapped_ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueUnmapMemObject(command_queuePacked, memobjPacked, mapped_ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueUnmapMemObject(command_queuePacked, memobjPacked, mapped_ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueNDRangeKernel(cl_command_queue command_queue,
......@@ -1120,11 +1162,13 @@ cl_int CL_API_CALL CL_EnqueueNDRangeKernel(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueNDRangeKernel, command_queuePacked, kernelPacked, work_dim,
global_work_offset, global_work_size, local_work_size,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueNDRangeKernel(command_queuePacked, kernelPacked, work_dim,
global_work_offset, global_work_size, local_work_size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueNDRangeKernel(command_queuePacked, kernelPacked, work_dim, global_work_offset,
global_work_size, local_work_size, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueNativeKernel(cl_command_queue command_queue,
......@@ -1154,11 +1198,13 @@ cl_int CL_API_CALL CL_EnqueueNativeKernel(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueNativeKernel, command_queuePacked, user_func, args, cb_args,
num_mem_objects, mem_listPacked, args_mem_loc, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueNativeKernel(command_queuePacked, user_func, args, cb_args, num_mem_objects,
mem_listPacked, args_mem_loc, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueNativeKernel(command_queuePacked, user_func, args, cb_args, num_mem_objects,
mem_listPacked, args_mem_loc, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_SetCommandQueueProperty(cl_command_queue command_queue,
......@@ -1173,9 +1219,10 @@ cl_int CL_API_CALL CL_SetCommandQueueProperty(cl_command_queue command_queue,
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetCommandQueueProperty, command_queuePacked, properties, enable,
old_properties);
return (cl::SetCommandQueueProperty(command_queuePacked, properties, enable, old_properties));
return (SetCommandQueueProperty(command_queuePacked, properties, enable, old_properties));
}
cl_mem CL_API_CALL CL_CreateImage2D(cl_context context,
......@@ -1197,11 +1244,11 @@ cl_mem CL_API_CALL CL_CreateImage2D(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateImage2D, contextPacked, flags, image_format, image_width,
image_height, image_row_pitch, host_ptr, errcode_ret);
return UnpackParam<cl_mem>(cl::CreateImage2D(contextPacked, flags, image_format, image_width,
image_height, image_row_pitch, host_ptr,
errcode_ret));
return UnpackParam<cl_mem>(CreateImage2D(contextPacked, flags, image_format, image_width,
image_height, image_row_pitch, host_ptr, errcode_ret));
}
cl_mem CL_API_CALL CL_CreateImage3D(cl_context context,
......@@ -1225,11 +1272,13 @@ cl_mem CL_API_CALL CL_CreateImage3D(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateImage3D, contextPacked, flags, image_format, image_width,
image_height, image_depth, image_row_pitch, image_slice_pitch,
host_ptr, errcode_ret);
return UnpackParam<cl_mem>(cl::CreateImage3D(contextPacked, flags, image_format, image_width,
image_height, image_depth, image_row_pitch,
image_slice_pitch, host_ptr, errcode_ret));
return UnpackParam<cl_mem>(CreateImage3D(contextPacked, flags, image_format, image_width,
image_height, image_depth, image_row_pitch,
image_slice_pitch, host_ptr, errcode_ret));
}
cl_int CL_API_CALL CL_EnqueueMarker(cl_command_queue command_queue, cl_event *event)
......@@ -1240,9 +1289,9 @@ cl_int CL_API_CALL CL_EnqueueMarker(cl_command_queue command_queue, cl_event *ev
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueMarker, command_queuePacked, eventPacked);
return (cl::EnqueueMarker(command_queuePacked, eventPacked));
return (EnqueueMarker(command_queuePacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueWaitForEvents(cl_command_queue command_queue,
......@@ -1256,9 +1305,10 @@ cl_int CL_API_CALL CL_EnqueueWaitForEvents(cl_command_queue command_queue,
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_listPacked = PackParam<Event *const *>(event_list);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueWaitForEvents, command_queuePacked, num_events,
event_listPacked);
return (cl::EnqueueWaitForEvents(command_queuePacked, num_events, event_listPacked));
return (EnqueueWaitForEvents(command_queuePacked, num_events, event_listPacked));
}
cl_int CL_API_CALL CL_EnqueueBarrier(cl_command_queue command_queue)
......@@ -1267,27 +1317,27 @@ cl_int CL_API_CALL CL_EnqueueBarrier(cl_command_queue command_queue)
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueBarrier, command_queuePacked);
return (cl::EnqueueBarrier(command_queuePacked));
return (EnqueueBarrier(command_queuePacked));
}
cl_int CL_API_CALL CL_UnloadCompiler()
{
CL_EVENT(UnloadCompiler, "");
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(UnloadCompiler);
return (cl::UnloadCompiler());
return (UnloadCompiler());
}
void *CL_API_CALL CL_GetExtensionFunctionAddress(const char *func_name)
{
CL_EVENT(GetExtensionFunctionAddress, "func_name = 0x%016" PRIxPTR "", (uintptr_t)func_name);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(GetExtensionFunctionAddress, func_name);
return (cl::GetExtensionFunctionAddress(func_name));
return (GetExtensionFunctionAddress(func_name));
}
cl_command_queue CL_API_CALL CL_CreateCommandQueue(cl_context context,
......@@ -1303,10 +1353,11 @@ cl_command_queue CL_API_CALL CL_CreateCommandQueue(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateCommandQueue, contextPacked, devicePacked, properties,
errcode_ret);
return UnpackParam<cl_command_queue>(
cl::CreateCommandQueue(contextPacked, devicePacked, properties, errcode_ret));
CreateCommandQueue(contextPacked, devicePacked, properties, errcode_ret));
}
cl_sampler CL_API_CALL CL_CreateSampler(cl_context context,
......@@ -1326,9 +1377,10 @@ cl_sampler CL_API_CALL CL_CreateSampler(cl_context context,
AddressingMode addressing_modePacked = PackParam<AddressingMode>(addressing_mode);
FilterMode filter_modePacked = PackParam<FilterMode>(filter_mode);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateSampler, contextPacked, normalized_coords,
addressing_modePacked, filter_modePacked, errcode_ret);
return UnpackParam<cl_sampler>(cl::CreateSampler(
return UnpackParam<cl_sampler>(CreateSampler(
contextPacked, normalized_coords, addressing_modePacked, filter_modePacked, errcode_ret));
}
......@@ -1350,10 +1402,11 @@ cl_int CL_API_CALL CL_EnqueueTask(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueTask, command_queuePacked, kernelPacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueTask(command_queuePacked, kernelPacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueTask(command_queuePacked, kernelPacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
// CL 1.1
......@@ -1372,10 +1425,11 @@ cl_mem CL_API_CALL CL_CreateSubBuffer(cl_mem buffer,
Memory *bufferPacked = PackParam<Memory *>(buffer);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateSubBuffer, bufferPacked, flags, buffer_create_type,
buffer_create_info, errcode_ret);
return UnpackParam<cl_mem>(cl::CreateSubBuffer(bufferPacked, flags, buffer_create_type,
buffer_create_info, errcode_ret));
return UnpackParam<cl_mem>(
CreateSubBuffer(bufferPacked, flags, buffer_create_type, buffer_create_info, errcode_ret));
}
cl_int CL_API_CALL CL_SetMemObjectDestructorCallback(cl_mem memobj,
......@@ -1390,9 +1444,9 @@ cl_int CL_API_CALL CL_SetMemObjectDestructorCallback(cl_mem memobj,
Memory *memobjPacked = PackParam<Memory *>(memobj);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetMemObjectDestructorCallback, memobjPacked, pfn_notify, user_data);
return (cl::SetMemObjectDestructorCallback(memobjPacked, pfn_notify, user_data));
return (SetMemObjectDestructorCallback(memobjPacked, pfn_notify, user_data));
}
cl_event CL_API_CALL CL_CreateUserEvent(cl_context context, cl_int *errcode_ret)
......@@ -1402,9 +1456,9 @@ cl_event CL_API_CALL CL_CreateUserEvent(cl_context context, cl_int *errcode_ret)
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateUserEvent, contextPacked, errcode_ret);
return UnpackParam<cl_event>(cl::CreateUserEvent(contextPacked, errcode_ret));
return UnpackParam<cl_event>(CreateUserEvent(contextPacked, errcode_ret));
}
cl_int CL_API_CALL CL_SetUserEventStatus(cl_event event, cl_int execution_status)
......@@ -1414,9 +1468,9 @@ cl_int CL_API_CALL CL_SetUserEventStatus(cl_event event, cl_int execution_status
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetUserEventStatus, eventPacked, execution_status);
return (cl::SetUserEventStatus(eventPacked, execution_status));
return (SetUserEventStatus(eventPacked, execution_status));
}
cl_int CL_API_CALL CL_SetEventCallback(cl_event event,
......@@ -1434,9 +1488,10 @@ cl_int CL_API_CALL CL_SetEventCallback(cl_event event,
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetEventCallback, eventPacked, command_exec_callback_type, pfn_notify,
user_data);
return (cl::SetEventCallback(eventPacked, command_exec_callback_type, pfn_notify, user_data));
return (SetEventCallback(eventPacked, command_exec_callback_type, pfn_notify, user_data));
}
cl_int CL_API_CALL CL_EnqueueReadBufferRect(cl_command_queue command_queue,
......@@ -1472,12 +1527,15 @@ cl_int CL_API_CALL CL_EnqueueReadBufferRect(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueReadBufferRect, command_queuePacked, bufferPacked, blocking_read,
buffer_origin, host_origin, region, buffer_row_pitch,
buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueReadBufferRect(command_queuePacked, bufferPacked, blocking_read,
buffer_origin, host_origin, region, buffer_row_pitch,
buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueReadBufferRect(command_queuePacked, bufferPacked, blocking_read, buffer_origin,
host_origin, region, buffer_row_pitch, buffer_slice_pitch,
host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueWriteBufferRect(cl_command_queue command_queue,
......@@ -1513,12 +1571,15 @@ cl_int CL_API_CALL CL_EnqueueWriteBufferRect(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueWriteBufferRect, command_queuePacked, bufferPacked,
blocking_write, buffer_origin, host_origin, region, buffer_row_pitch,
buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueWriteBufferRect(
command_queuePacked, bufferPacked, blocking_write, buffer_origin, host_origin, region,
buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueWriteBufferRect(command_queuePacked, bufferPacked, blocking_write, buffer_origin,
host_origin, region, buffer_row_pitch, buffer_slice_pitch,
host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueCopyBufferRect(cl_command_queue command_queue,
......@@ -1553,12 +1614,15 @@ cl_int CL_API_CALL CL_EnqueueCopyBufferRect(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueCopyBufferRect, command_queuePacked, src_bufferPacked,
dst_bufferPacked, src_origin, dst_origin, region, src_row_pitch,
src_slice_pitch, dst_row_pitch, dst_slice_pitch,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueCopyBufferRect(command_queuePacked, src_bufferPacked, dst_bufferPacked,
src_origin, dst_origin, region, src_row_pitch,
src_slice_pitch, dst_row_pitch, dst_slice_pitch,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueCopyBufferRect(command_queuePacked, src_bufferPacked, dst_bufferPacked,
src_origin, dst_origin, region, src_row_pitch, src_slice_pitch,
dst_row_pitch, dst_slice_pitch, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
// CL 1.2
......@@ -1578,10 +1642,11 @@ cl_int CL_API_CALL CL_CreateSubDevices(cl_device_id in_device,
Device *in_devicePacked = PackParam<Device *>(in_device);
Device **out_devicesPacked = PackParam<Device **>(out_devices);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(CreateSubDevices, in_devicePacked, properties, num_devices,
out_devicesPacked, num_devices_ret);
return (cl::CreateSubDevices(in_devicePacked, properties, num_devices, out_devicesPacked,
num_devices_ret));
return (CreateSubDevices(in_devicePacked, properties, num_devices, out_devicesPacked,
num_devices_ret));
}
cl_int CL_API_CALL CL_RetainDevice(cl_device_id device)
......@@ -1590,9 +1655,9 @@ cl_int CL_API_CALL CL_RetainDevice(cl_device_id device)
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(RetainDevice, devicePacked);
return (cl::RetainDevice(devicePacked));
return (RetainDevice(devicePacked));
}
cl_int CL_API_CALL CL_ReleaseDevice(cl_device_id device)
......@@ -1601,9 +1666,9 @@ cl_int CL_API_CALL CL_ReleaseDevice(cl_device_id device)
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(ReleaseDevice, devicePacked);
return (cl::ReleaseDevice(devicePacked));
return (ReleaseDevice(devicePacked));
}
cl_mem CL_API_CALL CL_CreateImage(cl_context context,
......@@ -1622,10 +1687,11 @@ cl_mem CL_API_CALL CL_CreateImage(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateImage, contextPacked, flags, image_format, image_desc, host_ptr,
errcode_ret);
return UnpackParam<cl_mem>(
cl::CreateImage(contextPacked, flags, image_format, image_desc, host_ptr, errcode_ret));
CreateImage(contextPacked, flags, image_format, image_desc, host_ptr, errcode_ret));
}
cl_program CL_API_CALL CL_CreateProgramWithBuiltInKernels(cl_context context,
......@@ -1643,9 +1709,10 @@ cl_program CL_API_CALL CL_CreateProgramWithBuiltInKernels(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateProgramWithBuiltInKernels, contextPacked, num_devices,
device_listPacked, kernel_names, errcode_ret);
return UnpackParam<cl_program>(cl::CreateProgramWithBuiltInKernels(
return UnpackParam<cl_program>(CreateProgramWithBuiltInKernels(
contextPacked, num_devices, device_listPacked, kernel_names, errcode_ret));
}
......@@ -1673,11 +1740,13 @@ cl_int CL_API_CALL CL_CompileProgram(cl_program program,
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
Program *const *input_headersPacked = PackParam<Program *const *>(input_headers);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(CompileProgram, programPacked, num_devices, device_listPacked, options,
num_input_headers, input_headersPacked, header_include_names,
pfn_notify, user_data);
return (cl::CompileProgram(programPacked, num_devices, device_listPacked, options,
num_input_headers, input_headersPacked, header_include_names,
pfn_notify, user_data));
return (CompileProgram(programPacked, num_devices, device_listPacked, options,
num_input_headers, input_headersPacked, header_include_names, pfn_notify,
user_data));
}
cl_program CL_API_CALL CL_LinkProgram(cl_context context,
......@@ -1705,11 +1774,13 @@ cl_program CL_API_CALL CL_LinkProgram(cl_context context,
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
Program *const *input_programsPacked = PackParam<Program *const *>(input_programs);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(LinkProgram, contextPacked, num_devices, device_listPacked, options,
num_input_programs, input_programsPacked, pfn_notify, user_data,
errcode_ret);
return UnpackParam<cl_program>(
cl::LinkProgram(contextPacked, num_devices, device_listPacked, options, num_input_programs,
input_programsPacked, pfn_notify, user_data, errcode_ret));
return UnpackParam<cl_program>(LinkProgram(contextPacked, num_devices, device_listPacked,
options, num_input_programs, input_programsPacked,
pfn_notify, user_data, errcode_ret));
}
cl_int CL_API_CALL CL_UnloadPlatformCompiler(cl_platform_id platform)
......@@ -1718,9 +1789,9 @@ cl_int CL_API_CALL CL_UnloadPlatformCompiler(cl_platform_id platform)
Platform *platformPacked = PackParam<Platform *>(platform);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(UnloadPlatformCompiler, platformPacked);
return (cl::UnloadPlatformCompiler(platformPacked));
return (UnloadPlatformCompiler(platformPacked));
}
cl_int CL_API_CALL CL_GetKernelArgInfo(cl_kernel kernel,
......@@ -1741,10 +1812,11 @@ cl_int CL_API_CALL CL_GetKernelArgInfo(cl_kernel kernel,
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
KernelArgInfo param_namePacked = PackParam<KernelArgInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetKernelArgInfo, kernelPacked, arg_index, param_namePacked,
param_value_size, param_value, param_value_size_ret);
return (cl::GetKernelArgInfo(kernelPacked, arg_index, param_namePacked, param_value_size,
param_value, param_value_size_ret));
return (GetKernelArgInfo(kernelPacked, arg_index, param_namePacked, param_value_size,
param_value, param_value_size_ret));
}
cl_int CL_API_CALL CL_EnqueueFillBuffer(cl_command_queue command_queue,
......@@ -1770,11 +1842,12 @@ cl_int CL_API_CALL CL_EnqueueFillBuffer(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueFillBuffer, command_queuePacked, bufferPacked, pattern,
pattern_size, offset, size, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueFillBuffer(command_queuePacked, bufferPacked, pattern, pattern_size, offset,
size, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueFillBuffer(command_queuePacked, bufferPacked, pattern, pattern_size, offset,
size, num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueFillImage(cl_command_queue command_queue,
......@@ -1800,10 +1873,11 @@ cl_int CL_API_CALL CL_EnqueueFillImage(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueFillImage, command_queuePacked, imagePacked, fill_color, origin,
region, num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueFillImage(command_queuePacked, imagePacked, fill_color, origin, region,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueFillImage(command_queuePacked, imagePacked, fill_color, origin, region,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueMigrateMemObjects(cl_command_queue command_queue,
......@@ -1826,11 +1900,12 @@ cl_int CL_API_CALL CL_EnqueueMigrateMemObjects(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueMigrateMemObjects, command_queuePacked, num_mem_objects,
mem_objectsPacked, flags, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueMigrateMemObjects(command_queuePacked, num_mem_objects, mem_objectsPacked,
flags, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueMigrateMemObjects(command_queuePacked, num_mem_objects, mem_objectsPacked, flags,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueMarkerWithWaitList(cl_command_queue command_queue,
......@@ -1849,10 +1924,11 @@ cl_int CL_API_CALL CL_EnqueueMarkerWithWaitList(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueMarkerWithWaitList, command_queuePacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueMarkerWithWaitList(command_queuePacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueMarkerWithWaitList(command_queuePacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueBarrierWithWaitList(cl_command_queue command_queue,
......@@ -1871,10 +1947,11 @@ cl_int CL_API_CALL CL_EnqueueBarrierWithWaitList(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueBarrierWithWaitList, command_queuePacked,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueBarrierWithWaitList(command_queuePacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueBarrierWithWaitList(command_queuePacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
void *CL_API_CALL CL_GetExtensionFunctionAddressForPlatform(cl_platform_id platform,
......@@ -1886,9 +1963,9 @@ void *CL_API_CALL CL_GetExtensionFunctionAddressForPlatform(cl_platform_id platf
Platform *platformPacked = PackParam<Platform *>(platform);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(GetExtensionFunctionAddressForPlatform, platformPacked, func_name);
return (cl::GetExtensionFunctionAddressForPlatform(platformPacked, func_name));
return (GetExtensionFunctionAddressForPlatform(platformPacked, func_name));
}
// CL 2.0
......@@ -1906,10 +1983,11 @@ CL_CreateCommandQueueWithProperties(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateCommandQueueWithProperties, contextPacked, devicePacked,
properties, errcode_ret);
return UnpackParam<cl_command_queue>(
cl::CreateCommandQueueWithProperties(contextPacked, devicePacked, properties, errcode_ret));
CreateCommandQueueWithProperties(contextPacked, devicePacked, properties, errcode_ret));
}
cl_mem CL_API_CALL CL_CreatePipe(cl_context context,
......@@ -1929,10 +2007,11 @@ cl_mem CL_API_CALL CL_CreatePipe(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreatePipe, contextPacked, flags, pipe_packet_size, pipe_max_packets,
properties, errcode_ret);
return UnpackParam<cl_mem>(cl::CreatePipe(contextPacked, flags, pipe_packet_size,
pipe_max_packets, properties, errcode_ret));
return UnpackParam<cl_mem>(CreatePipe(contextPacked, flags, pipe_packet_size, pipe_max_packets,
properties, errcode_ret));
}
cl_int CL_API_CALL CL_GetPipeInfo(cl_mem pipe,
......@@ -1951,10 +2030,11 @@ cl_int CL_API_CALL CL_GetPipeInfo(cl_mem pipe,
Memory *pipePacked = PackParam<Memory *>(pipe);
PipeInfo param_namePacked = PackParam<PipeInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetPipeInfo, pipePacked, param_namePacked, param_value_size,
param_value, param_value_size_ret);
return (cl::GetPipeInfo(pipePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
return (GetPipeInfo(pipePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret));
}
void *CL_API_CALL CL_SVMAlloc(cl_context context,
......@@ -1967,9 +2047,9 @@ void *CL_API_CALL CL_SVMAlloc(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(SVMAlloc, contextPacked, flags, size, alignment);
return (cl::SVMAlloc(contextPacked, flags, size, alignment));
return (SVMAlloc(contextPacked, flags, size, alignment));
}
void CL_API_CALL CL_SVMFree(cl_context context, void *svm_pointer)
......@@ -1979,9 +2059,9 @@ void CL_API_CALL CL_SVMFree(cl_context context, void *svm_pointer)
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_VOID(SVMFree, contextPacked, svm_pointer);
cl::SVMFree(contextPacked, svm_pointer);
SVMFree(contextPacked, svm_pointer);
}
cl_sampler CL_API_CALL
......@@ -1996,10 +2076,11 @@ CL_CreateSamplerWithProperties(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateSamplerWithProperties, contextPacked, sampler_properties,
errcode_ret);
return UnpackParam<cl_sampler>(
cl::CreateSamplerWithProperties(contextPacked, sampler_properties, errcode_ret));
CreateSamplerWithProperties(contextPacked, sampler_properties, errcode_ret));
}
cl_int CL_API_CALL CL_SetKernelArgSVMPointer(cl_kernel kernel,
......@@ -2012,9 +2093,9 @@ cl_int CL_API_CALL CL_SetKernelArgSVMPointer(cl_kernel kernel,
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetKernelArgSVMPointer, kernelPacked, arg_index, arg_value);
return (cl::SetKernelArgSVMPointer(kernelPacked, arg_index, arg_value));
return (SetKernelArgSVMPointer(kernelPacked, arg_index, arg_value));
}
cl_int CL_API_CALL CL_SetKernelExecInfo(cl_kernel kernel,
......@@ -2030,9 +2111,10 @@ cl_int CL_API_CALL CL_SetKernelExecInfo(cl_kernel kernel,
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
KernelExecInfo param_namePacked = PackParam<KernelExecInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetKernelExecInfo, kernelPacked, param_namePacked, param_value_size,
param_value);
return (cl::SetKernelExecInfo(kernelPacked, param_namePacked, param_value_size, param_value));
return (SetKernelExecInfo(kernelPacked, param_namePacked, param_value_size, param_value));
}
cl_int CL_API_CALL CL_EnqueueSVMFree(cl_command_queue command_queue,
......@@ -2061,11 +2143,12 @@ cl_int CL_API_CALL CL_EnqueueSVMFree(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueSVMFree, command_queuePacked, num_svm_pointers, svm_pointers,
pfn_free_func, user_data, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueSVMFree(command_queuePacked, num_svm_pointers, svm_pointers, pfn_free_func,
user_data, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueSVMFree(command_queuePacked, num_svm_pointers, svm_pointers, pfn_free_func,
user_data, num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueSVMMemcpy(cl_command_queue command_queue,
......@@ -2089,10 +2172,11 @@ cl_int CL_API_CALL CL_EnqueueSVMMemcpy(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueSVMMemcpy, command_queuePacked, blocking_copy, dst_ptr, src_ptr,
size, num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueSVMMemcpy(command_queuePacked, blocking_copy, dst_ptr, src_ptr, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueSVMMemcpy(command_queuePacked, blocking_copy, dst_ptr, src_ptr, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueSVMMemFill(cl_command_queue command_queue,
......@@ -2116,10 +2200,11 @@ cl_int CL_API_CALL CL_EnqueueSVMMemFill(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueSVMMemFill, command_queuePacked, svm_ptr, pattern, pattern_size,
size, num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueSVMMemFill(command_queuePacked, svm_ptr, pattern, pattern_size, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueSVMMemFill(command_queuePacked, svm_ptr, pattern, pattern_size, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueSVMMap(cl_command_queue command_queue,
......@@ -2143,10 +2228,11 @@ cl_int CL_API_CALL CL_EnqueueSVMMap(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueSVMMap, command_queuePacked, blocking_map, flags, svm_ptr, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked);
return (cl::EnqueueSVMMap(command_queuePacked, blocking_map, flags, svm_ptr, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
return (EnqueueSVMMap(command_queuePacked, blocking_map, flags, svm_ptr, size,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
cl_int CL_API_CALL CL_EnqueueSVMUnmap(cl_command_queue command_queue,
......@@ -2166,10 +2252,11 @@ cl_int CL_API_CALL CL_EnqueueSVMUnmap(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueSVMUnmap, command_queuePacked, svm_ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueSVMUnmap(command_queuePacked, svm_ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
return (EnqueueSVMUnmap(command_queuePacked, svm_ptr, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
}
// CL 2.1
......@@ -2186,9 +2273,10 @@ cl_int CL_API_CALL CL_SetDefaultDeviceCommandQueue(cl_context context,
Device *devicePacked = PackParam<Device *>(device);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetDefaultDeviceCommandQueue, contextPacked, devicePacked,
command_queuePacked);
return (cl::SetDefaultDeviceCommandQueue(contextPacked, devicePacked, command_queuePacked));
return (SetDefaultDeviceCommandQueue(contextPacked, devicePacked, command_queuePacked));
}
cl_int CL_API_CALL CL_GetDeviceAndHostTimer(cl_device_id device,
......@@ -2202,9 +2290,9 @@ cl_int CL_API_CALL CL_GetDeviceAndHostTimer(cl_device_id device,
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetDeviceAndHostTimer, devicePacked, device_timestamp, host_timestamp);
return (cl::GetDeviceAndHostTimer(devicePacked, device_timestamp, host_timestamp));
return (GetDeviceAndHostTimer(devicePacked, device_timestamp, host_timestamp));
}
cl_int CL_API_CALL CL_GetHostTimer(cl_device_id device, cl_ulong *host_timestamp)
......@@ -2214,9 +2302,9 @@ cl_int CL_API_CALL CL_GetHostTimer(cl_device_id device, cl_ulong *host_timestamp
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetHostTimer, devicePacked, host_timestamp);
return (cl::GetHostTimer(devicePacked, host_timestamp));
return (GetHostTimer(devicePacked, host_timestamp));
}
cl_program CL_API_CALL CL_CreateProgramWithIL(cl_context context,
......@@ -2231,9 +2319,9 @@ cl_program CL_API_CALL CL_CreateProgramWithIL(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateProgramWithIL, contextPacked, il, length, errcode_ret);
return UnpackParam<cl_program>(cl::CreateProgramWithIL(contextPacked, il, length, errcode_ret));
return UnpackParam<cl_program>(CreateProgramWithIL(contextPacked, il, length, errcode_ret));
}
cl_kernel CL_API_CALL CL_CloneKernel(cl_kernel source_kernel, cl_int *errcode_ret)
......@@ -2243,9 +2331,9 @@ cl_kernel CL_API_CALL CL_CloneKernel(cl_kernel source_kernel, cl_int *errcode_re
Kernel *source_kernelPacked = PackParam<Kernel *>(source_kernel);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CloneKernel, source_kernelPacked, errcode_ret);
return UnpackParam<cl_kernel>(cl::CloneKernel(source_kernelPacked, errcode_ret));
return UnpackParam<cl_kernel>(CloneKernel(source_kernelPacked, errcode_ret));
}
cl_int CL_API_CALL CL_GetKernelSubGroupInfo(cl_kernel kernel,
......@@ -2270,11 +2358,13 @@ cl_int CL_API_CALL CL_GetKernelSubGroupInfo(cl_kernel kernel,
Device *devicePacked = PackParam<Device *>(device);
KernelSubGroupInfo param_namePacked = PackParam<KernelSubGroupInfo>(param_name);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(GetKernelSubGroupInfo, kernelPacked, devicePacked, param_namePacked,
input_value_size, input_value, param_value_size, param_value,
param_value_size_ret);
return (cl::GetKernelSubGroupInfo(kernelPacked, devicePacked, param_namePacked,
input_value_size, input_value, param_value_size, param_value,
param_value_size_ret));
return (GetKernelSubGroupInfo(kernelPacked, devicePacked, param_namePacked, input_value_size,
input_value, param_value_size, param_value,
param_value_size_ret));
}
cl_int CL_API_CALL CL_EnqueueSVMMigrateMem(cl_command_queue command_queue,
......@@ -2298,11 +2388,12 @@ cl_int CL_API_CALL CL_EnqueueSVMMigrateMem(cl_command_queue command_queue,
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(EnqueueSVMMigrateMem, command_queuePacked, num_svm_pointers,
svm_pointers, sizes, flags, num_events_in_wait_list,
event_wait_listPacked, eventPacked);
return (cl::EnqueueSVMMigrateMem(command_queuePacked, num_svm_pointers, svm_pointers, sizes,
flags, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
return (EnqueueSVMMigrateMem(command_queuePacked, num_svm_pointers, svm_pointers, sizes, flags,
num_events_in_wait_list, event_wait_listPacked, eventPacked));
}
// CL 2.2
......@@ -2318,9 +2409,9 @@ cl_int CL_API_CALL CL_SetProgramReleaseCallback(cl_program program,
Program *programPacked = PackParam<Program *>(program);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetProgramReleaseCallback, programPacked, pfn_notify, user_data);
return (cl::SetProgramReleaseCallback(programPacked, pfn_notify, user_data));
return (SetProgramReleaseCallback(programPacked, pfn_notify, user_data));
}
cl_int CL_API_CALL CL_SetProgramSpecializationConstant(cl_program program,
......@@ -2335,9 +2426,10 @@ cl_int CL_API_CALL CL_SetProgramSpecializationConstant(cl_program program,
Program *programPacked = PackParam<Program *>(program);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetProgramSpecializationConstant, programPacked, spec_id, spec_size,
spec_value);
return (cl::SetProgramSpecializationConstant(programPacked, spec_id, spec_size, spec_value));
return (SetProgramSpecializationConstant(programPacked, spec_id, spec_size, spec_value));
}
// CL 3.0
......@@ -2353,9 +2445,9 @@ cl_int CL_API_CALL CL_SetContextDestructorCallback(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_ERROR(SetContextDestructorCallback, contextPacked, pfn_notify, user_data);
return (cl::SetContextDestructorCallback(contextPacked, pfn_notify, user_data));
return (SetContextDestructorCallback(contextPacked, pfn_notify, user_data));
}
cl_mem CL_API_CALL CL_CreateBufferWithProperties(cl_context context,
......@@ -2374,10 +2466,11 @@ cl_mem CL_API_CALL CL_CreateBufferWithProperties(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateBufferWithProperties, contextPacked, properties, flags, size,
host_ptr, errcode_ret);
return UnpackParam<cl_mem>(cl::CreateBufferWithProperties(contextPacked, properties, flags,
size, host_ptr, errcode_ret));
return UnpackParam<cl_mem>(
CreateBufferWithProperties(contextPacked, properties, flags, size, host_ptr, errcode_ret));
}
cl_mem CL_API_CALL CL_CreateImageWithProperties(cl_context context,
......@@ -2397,9 +2490,10 @@ cl_mem CL_API_CALL CL_CreateImageWithProperties(cl_context context,
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate
ANGLE_CL_VALIDATE_POINTER(CreateImageWithProperties, contextPacked, properties, flags,
image_format, image_desc, host_ptr, errcode_ret);
return UnpackParam<cl_mem>(cl::CreateImageWithProperties(
return UnpackParam<cl_mem>(CreateImageWithProperties(
contextPacked, properties, flags, image_format, image_desc, host_ptr, errcode_ret));
}
......
......@@ -11,6 +11,7 @@
#include <cinttypes>
#include <cstdio>
#include <type_traits>
#if defined(ANGLE_TRACE_ENABLED)
# define CL_EVENT(entryPoint, ...) \
......@@ -20,4 +21,39 @@
# define CL_EVENT(entryPoint, ...) (void(0))
#endif
namespace cl
{
// First case: handling packed enums.
template <typename PackedT, typename FromT>
typename std::enable_if_t<std::is_enum<PackedT>::value, PackedT> PackParam(FromT from)
{
return FromCLenum<PackedT>(from);
}
// Cast CL object types to ANGLE types marked with 'using IsCLObjectType = std::true_type;'
template <typename PackedT, typename FromT>
inline std::enable_if_t<
std::remove_pointer_t<std::remove_pointer_t<PackedT>>::IsCLObjectType::value,
PackedT>
PackParam(FromT from)
{
return reinterpret_cast<PackedT>(from);
}
// First case: handling packed enums.
template <typename UnpackedT, typename FromT>
typename std::enable_if_t<std::is_enum<FromT>::value, UnpackedT> UnpackParam(FromT from)
{
return ToCLenum(from);
}
// Cast ANGLE types marked with 'using IsCLObjectType = std::true_type;' to CL object types
template <typename UnpackedT, typename FromT>
inline typename std::enable_if_t<std::remove_pointer_t<FromT>::IsCLObjectType::value, UnpackedT>
UnpackParam(FromT from)
{
return reinterpret_cast<UnpackedT>(from);
}
} // namespace cl
#endif // LIBGLESV2_ENTRY_POINTS_CL_UTILS_H_
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// validationCL.h: Validation functions for generic CL entry point parameters
#ifndef LIBGLESV2_VALIDATIONCL_H_
#define LIBGLESV2_VALIDATIONCL_H_
#include "common/PackedCLEnums_autogen.h"
#include <type_traits>
namespace cl
{
// First case: handling packed enums.
template <typename PackedT, typename FromT>
typename std::enable_if<std::is_enum<PackedT>::value, PackedT>::type PackParam(FromT from)
{
return FromCLenum<PackedT>(from);
}
template <typename PackedT, typename FromT>
inline typename std::enable_if<!std::is_enum<PackedT>::value,
typename std::remove_reference<PackedT>::type>::type
PackParam(FromT from)
{
return reinterpret_cast<PackedT>(from);
}
// First case: handling packed enums.
template <typename UnpackedT, typename FromT>
typename std::enable_if<std::is_enum<FromT>::value, UnpackedT>::type UnpackParam(FromT from)
{
return ToCLenum(from);
}
template <typename UnpackedT, typename FromT>
inline typename std::enable_if<!std::is_enum<FromT>::value, UnpackedT>::type UnpackParam(FromT from)
{
return reinterpret_cast<UnpackedT>(from);
}
} // namespace cl
#endif // LIBGLESV2_VALIDATIONCL_H_
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