Commit e25f3b10 by John Plate Committed by Commit Bot

Generate empty CL object classes

Bug: angleproject:5886 Change-Id: I01566f40e85bd7f5531536fdc1df42965622a939 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2844969Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
parent f2b47418
...@@ -56,9 +56,11 @@ if (angle_build_all) { ...@@ -56,9 +56,11 @@ if (angle_build_all) {
":translator_fuzzer", ":translator_fuzzer",
":xxhash_fuzzer", ":xxhash_fuzzer",
"$angle_root/samples:angle_samples", "$angle_root/samples:angle_samples",
"$angle_root/src/libOpenCL:angle_cl",
"$angle_root/src/tests:angle_tests", "$angle_root/src/tests:angle_tests",
] ]
if (angle_enable_cl) {
deps += [ "$angle_root/src/libOpenCL:angle_cl" ]
}
} }
} }
...@@ -265,9 +267,16 @@ config("angle_uwp_env") { ...@@ -265,9 +267,16 @@ config("angle_uwp_env") {
} }
} }
angle_source_set("cl_includes") {
sources = cl_includes
}
angle_source_set("includes") { angle_source_set("includes") {
sources = libangle_includes sources = libangle_includes
public_configs = [ ":includes_config" ] public_configs = [ ":includes_config" ]
if (angle_enable_cl) {
public_deps = [ ":cl_includes" ]
}
} }
angle_static_library("preprocessor") { angle_static_library("preprocessor") {
...@@ -725,6 +734,9 @@ config("libANGLE_config") { ...@@ -725,6 +734,9 @@ config("libANGLE_config") {
angle_source_set("libANGLE_headers") { angle_source_set("libANGLE_headers") {
sources = libangle_headers sources = libangle_headers
if (angle_enable_cl) {
sources += libangle_cl_headers
}
public_deps = [ public_deps = [
":angle_common", ":angle_common",
":angle_translator_headers", ":angle_translator_headers",
...@@ -772,6 +784,9 @@ if (is_win) { ...@@ -772,6 +784,9 @@ if (is_win) {
angle_source_set("libANGLE_base") { angle_source_set("libANGLE_base") {
sources = libangle_sources sources = libangle_sources
if (angle_enable_cl) {
sources += libangle_cl_sources
}
include_dirs = [] include_dirs = []
libs = [] libs = []
...@@ -1027,6 +1042,9 @@ set_defaults("angle_libGLESv2") { ...@@ -1027,6 +1042,9 @@ set_defaults("angle_libGLESv2") {
template("angle_libGLESv2") { template("angle_libGLESv2") {
angle_shared_library(target_name) { angle_shared_library(target_name) {
sources = libglesv2_sources + invoker.sources sources = libglesv2_sources + invoker.sources
if (angle_enable_cl) {
sources += libglesv2_cl_sources
}
if (is_win) { if (is_win) {
sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ] sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
...@@ -1096,6 +1114,9 @@ if (is_win && !angle_is_winuwp) { ...@@ -1096,6 +1114,9 @@ if (is_win && !angle_is_winuwp) {
angle_static_library("libGLESv2_static") { angle_static_library("libGLESv2_static") {
sources = libglesv2_sources sources = libglesv2_sources
if (angle_enable_cl) {
sources += libglesv2_cl_sources
}
configs += [ ":debug_annotations_config" ] configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_static" ] public_configs += [ ":angle_static" ]
......
...@@ -184,6 +184,11 @@ declare_args() { ...@@ -184,6 +184,11 @@ declare_args() {
angle_has_histograms = angle_has_build angle_has_histograms = angle_has_build
} }
declare_args() {
# Build OpenCL support by default.
angle_enable_cl = true
}
if (!defined(angle_zlib_compression_utils_dir)) { if (!defined(angle_zlib_compression_utils_dir)) {
angle_zlib_compression_utils_dir = "//third_party/zlib/google" angle_zlib_compression_utils_dir = "//third_party/zlib/google"
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679", "4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"6be5ee077187f1ec68e8e6035bcd2cae", "992b715af193e3c5667e6c2b3240d4e6",
"scripts/gl.xml": "scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6", "2a73a58a7e26d8676a2c0af6d528cae6",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
"src/libGL/libGL_autogen.def": "src/libGL/libGL_autogen.def":
"2789d87b05eea9f53d52e2aff499b785", "2789d87b05eea9f53d52e2aff499b785",
"src/libGLESv2/cl_stubs_autogen.h": "src/libGLESv2/cl_stubs_autogen.h":
"a20a5e774c40e4230878b90e76fe4f82", "3757cdaee900021bc14c21e97bd91d50",
"src/libGLESv2/egl_ext_stubs_autogen.h": "src/libGLESv2/egl_ext_stubs_autogen.h":
"2ef3b8d087f2a97f7270b96077c93856", "2ef3b8d087f2a97f7270b96077c93856",
"src/libGLESv2/egl_get_labeled_object_data.json": "src/libGLESv2/egl_get_labeled_object_data.json":
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
"src/libGLESv2/egl_stubs_autogen.h": "src/libGLESv2/egl_stubs_autogen.h":
"6439daa350c1663e71dd0af37dcc91df", "6439daa350c1663e71dd0af37dcc91df",
"src/libGLESv2/entry_points_cl_autogen.cpp": "src/libGLESv2/entry_points_cl_autogen.cpp":
"3a65b1fd9a07a192819df70e7b8ec292", "e9310db2512fb91852dc8834717d4209",
"src/libGLESv2/entry_points_cl_autogen.h": "src/libGLESv2/entry_points_cl_autogen.h":
"129fa7936c8bc6a20de9269da0c3c7d3", "129fa7936c8bc6a20de9269da0c3c7d3",
"src/libGLESv2/entry_points_egl_autogen.cpp": "src/libGLESv2/entry_points_egl_autogen.cpp":
......
...@@ -159,7 +159,7 @@ extern "C" {{ ...@@ -159,7 +159,7 @@ extern "C" {{
}} // extern "C" }} // extern "C"
""" """
TEMPLATE_ENTRY_POINT_DECL = """ANGLE_EXPORT {return_type}{export_def} {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params});""" TEMPLATE_ENTRY_POINT_DECL = """ANGLE_EXPORT {return_type} {export_def} {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params});"""
TEMPLATE_GLES_ENTRY_POINT_NO_RETURN = """\ TEMPLATE_GLES_ENTRY_POINT_NO_RETURN = """\
void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params}) void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
...@@ -185,7 +185,7 @@ void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{exp ...@@ -185,7 +185,7 @@ void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{exp
""" """
TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN = """\
{return_type}GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params}) {return_type} GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{ {{
Context *context = {context_getter}; Context *context = {context_getter};
{event_comment}EVENT(context, GL{name}, "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params}); {event_comment}EVENT(context, GL{name}, "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params});
...@@ -231,7 +231,7 @@ void EGLAPIENTRY EGL_{name}({params}) ...@@ -231,7 +231,7 @@ void EGLAPIENTRY EGL_{name}({params})
""" """
TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\
{return_type}EGLAPIENTRY EGL_{name}({params}) {return_type} EGLAPIENTRY EGL_{name}({params})
{{ {{
ANGLE_SCOPED_GLOBAL_LOCK(); ANGLE_SCOPED_GLOBAL_LOCK();
EGL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params}); EGL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
...@@ -260,7 +260,7 @@ void CL_API_CALL CL_{name}({params}) ...@@ -260,7 +260,7 @@ void CL_API_CALL CL_{name}({params})
""" """
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
{return_type}CL_API_CALL CL_{name}({params}) {return_type} CL_API_CALL CL_{name}({params})
{{ {{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params}); CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
...@@ -268,7 +268,7 @@ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\ ...@@ -268,7 +268,7 @@ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
// TODO: validate // TODO: validate
return cl::{name}({internal_params}); return {return_cast}(cl::{name}({internal_params}));
}} }}
""" """
...@@ -291,6 +291,16 @@ TEMPLATE_CL_STUBS_HEADER = """\ ...@@ -291,6 +291,16 @@ TEMPLATE_CL_STUBS_HEADER = """\
namespace cl namespace cl
{{ {{
class CommandQueue;
class Context;
class Device;
class Event;
class Kernel;
class Memory;
class Platform;
class Program;
class Sampler;
{stubs} {stubs}
}} // namespace cl }} // namespace cl
#endif // LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_ #endif // LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_
...@@ -366,14 +376,14 @@ TEMPLATE_CL_ENTRY_POINT_EXPORT = """\ ...@@ -366,14 +376,14 @@ TEMPLATE_CL_ENTRY_POINT_EXPORT = """\
""" """
TEMPLATE_GL_ENTRY_POINT_EXPORT = """\ TEMPLATE_GL_ENTRY_POINT_EXPORT = """\
{return_type}GL_APIENTRY gl{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params}) {return_type} GL_APIENTRY gl{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{ {{
return GL_{name}{explicit_context_suffix}({explicit_context_internal_param}{explicit_context_comma}{internal_params}); return GL_{name}{explicit_context_suffix}({explicit_context_internal_param}{explicit_context_comma}{internal_params});
}} }}
""" """
TEMPLATE_EGL_ENTRY_POINT_EXPORT = """\ TEMPLATE_EGL_ENTRY_POINT_EXPORT = """\
{return_type}EGLAPIENTRY egl{name}({params}) {return_type} EGLAPIENTRY egl{name}({params})
{{ {{
EnsureEGLLoaded(); EnsureEGLLoaded();
return EGL_{name}({internal_params}); return EGL_{name}({internal_params});
...@@ -1194,6 +1204,7 @@ TEMPLATE_RESOURCE_ID_TYPE_NAME_CASE = """\ ...@@ -1194,6 +1204,7 @@ TEMPLATE_RESOURCE_ID_TYPE_NAME_CASE = """\
return "{resource_id_type}";""" return "{resource_id_type}";"""
CL_PACKED_TYPES = { CL_PACKED_TYPES = {
# Enums
"cl_platform_info": "PlatformInfo", "cl_platform_info": "PlatformInfo",
"cl_device_info": "DeviceInfo", "cl_device_info": "DeviceInfo",
"cl_context_info": "ContextInfo", "cl_context_info": "ContextInfo",
...@@ -1214,6 +1225,24 @@ CL_PACKED_TYPES = { ...@@ -1214,6 +1225,24 @@ CL_PACKED_TYPES = {
"cl_kernel_exec_info": "KernelExecInfo", "cl_kernel_exec_info": "KernelExecInfo",
"cl_event_info": "EventInfo", "cl_event_info": "EventInfo",
"cl_profiling_info": "ProfilingInfo", "cl_profiling_info": "ProfilingInfo",
# Objects
"cl_platform_id": "Platform *",
"cl_platform_id*": "Platform **",
"cl_device_id": "Device *",
"cl_device_id*": "Device **",
"const cl_device_id*": "Device *const *",
"cl_context": "Context *",
"cl_command_queue": "CommandQueue *",
"cl_mem": "Memory *",
"const cl_mem*": "Memory *const *",
"cl_program": "Program *",
"const cl_program*": "Program *const *",
"cl_kernel": "Kernel *",
"cl_kernel*": "Kernel **",
"cl_event": "Event *",
"cl_event*": "Event **",
"const cl_event*": "Event *const *",
"cl_sampler": "Sampler *",
} }
EGL_PACKED_TYPES = { EGL_PACKED_TYPES = {
...@@ -1265,7 +1294,7 @@ def format_entry_point_decl(api, cmd_name, proto, params, is_explicit_context): ...@@ -1265,7 +1294,7 @@ def format_entry_point_decl(api, cmd_name, proto, params, is_explicit_context):
return TEMPLATE_ENTRY_POINT_DECL.format( return TEMPLATE_ENTRY_POINT_DECL.format(
export_def=get_api_entry_def(api), export_def=get_api_entry_def(api),
name="%s_%s" % (entry_point_prefix(api), stripped), name="%s_%s" % (entry_point_prefix(api), stripped),
return_type=proto[:-len(cmd_name)], return_type=proto[:-len(cmd_name)].strip(),
params=", ".join(params), params=", ".join(params),
comma_if_needed=comma_if_needed, comma_if_needed=comma_if_needed,
explicit_context_suffix="ContextANGLE" if is_explicit_context else "", explicit_context_suffix="ContextANGLE" if is_explicit_context else "",
...@@ -1511,8 +1540,9 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic ...@@ -1511,8 +1540,9 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic
pass_params = [param_print_argument(command_node, param) for param in params] pass_params = [param_print_argument(command_node, param) for param in params]
format_params = [param_format_string(param) for param in params] format_params = [param_format_string(param) for param in params]
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)].strip()
default_return = default_return_value(cmd_name, return_type.strip()) return_cast = "UnpackParam<" + return_type + ">" if return_type in packed_param_types else ""
default_return = default_return_value(cmd_name, return_type)
event_comment = TEMPLATE_EVENT_COMMENT if cmd_name in NO_EVENT_MARKER_EXCEPTIONS_LIST else "" event_comment = TEMPLATE_EVENT_COMMENT if cmd_name in NO_EVENT_MARKER_EXCEPTIONS_LIST else ""
name_lower_no_suffix = strip_suffix(api, cmd_name[2:3].lower() + cmd_name[3:]) name_lower_no_suffix = strip_suffix(api, cmd_name[2:3].lower() + cmd_name[3:])
...@@ -1523,6 +1553,8 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic ...@@ -1523,6 +1553,8 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic
name_lower_no_suffix, name_lower_no_suffix,
"return_type": "return_type":
return_type, return_type,
"return_cast":
return_cast,
"params": "params":
", ".join(params), ", ".join(params),
"internal_params": "internal_params":
...@@ -1676,7 +1708,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en ...@@ -1676,7 +1708,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en
internal_params = get_internal_params(api, cmd_name, params, cmd_packed_gl_enums, internal_params = get_internal_params(api, cmd_name, params, cmd_packed_gl_enums,
packed_param_types) packed_param_types)
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)].strip()
name_lower_no_suffix = cmd_name[2:3].lower() + cmd_name[3:] name_lower_no_suffix = cmd_name[2:3].lower() + cmd_name[3:]
name_lower_no_suffix = strip_suffix(api, name_lower_no_suffix) name_lower_no_suffix = strip_suffix(api, name_lower_no_suffix)
maybe_const = " const" if name_lower_no_suffix.startswith( maybe_const = " const" if name_lower_no_suffix.startswith(
...@@ -1691,7 +1723,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en ...@@ -1691,7 +1723,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en
def format_entry_point_export(cmd_name, proto, params, is_explicit_context, template): def format_entry_point_export(cmd_name, proto, params, is_explicit_context, template):
internal_params = [just_the_name(param) for param in params] internal_params = [just_the_name(param) for param in params]
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)].strip()
return template.format( return template.format(
name=strip_api_prefix(cmd_name), name=strip_api_prefix(cmd_name),
...@@ -2471,6 +2503,8 @@ def write_stubs_header(api, annotation, title, data_source, out_file, all_comman ...@@ -2471,6 +2503,8 @@ def write_stubs_header(api, annotation, title, data_source, out_file, all_comman
params = [] if api == apis.CL else ["Thread *thread"] params = [] if api == apis.CL else ["Thread *thread"]
params += ["".join(param.itertext()) for param in command.findall('param')] params += ["".join(param.itertext()) for param in command.findall('param')]
return_type = proto_text[:-len(cmd_name)].strip() return_type = proto_text[:-len(cmd_name)].strip()
if api == apis.CL and return_type in packed_param_types:
return_type = packed_param_types[return_type]
internal_params = get_internal_params(api, cmd_name, params, cmd_packed_egl_enums, internal_params = get_internal_params(api, cmd_name, params, cmd_packed_egl_enums,
packed_param_types) packed_param_types)
......
//
// 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.
//
// CLCommandQueue.cpp: Implements the cl::CommandQueue class.
#include "libANGLE/CLCommandQueue.h"
namespace cl
{
// TODO
} // 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.
//
// CLCommandQueue.h: Defines the cl::CommandQueue class, which can be used to queue a set of OpenCL
// operations.
#ifndef LIBANGLE_CLCOMMANDQUEUE_H_
#define LIBANGLE_CLCOMMANDQUEUE_H_
namespace cl
{
class CommandQueue final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLCOMMANDQUEUE_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.
//
// CLContext.cpp: Implements the cl::Context class.
#include "libANGLE/CLContext.h"
namespace cl
{
// TODO
} // 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.
//
// CLContext.h: Defines the cl::Context class, which manages OpenCL objects such as command-queues,
// memory, program and kernel objects and for executing kernels on one or more devices.
#ifndef LIBANGLE_CLCONTEXT_H_
#define LIBANGLE_CLCONTEXT_H_
namespace cl
{
class Context final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLCONTEXT_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.
//
// CLDevice.cpp: Implements the cl::Device class.
#include "libANGLE/CLDevice.h"
namespace cl
{
// TODO
} // 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.
//
// CLDevice.h: Defines the cl::Device class, which provides information about OpenCL device
// configurations.
#ifndef LIBANGLE_CLDEVICE_H_
#define LIBANGLE_CLDEVICE_H_
namespace cl
{
class Device final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLDEVICE_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.
//
// CLEvent.cpp: Implements the cl::Event class.
#include "libANGLE/CLEvent.h"
namespace cl
{
// TODO
} // 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.
//
// CLEvent.h: Defines the cl::Event class, which can be used to track the execution status of an
// OpenCL command.
#ifndef LIBANGLE_CLEVENT_H_
#define LIBANGLE_CLEVENT_H_
namespace cl
{
class Event final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLEVENT_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.
//
// CLKernel.cpp: Implements the cl::Kernel class.
#include "libANGLE/CLKernel.h"
namespace cl
{
// TODO
} // 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.
//
// CLKernel.h: Defines the cl::Kernel class, which is a function declared in an OpenCL program.
#ifndef LIBANGLE_CLKERNEL_H_
#define LIBANGLE_CLKERNEL_H_
namespace cl
{
class Kernel final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLKERNEL_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.
//
// CLMemory.cpp: Implements the cl::Memory class.
#include "libANGLE/CLMemory.h"
namespace cl
{
// TODO
} // 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.
//
// 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.
#ifndef LIBANGLE_CLMEMORY_H_
#define LIBANGLE_CLMEMORY_H_
namespace cl
{
class Memory final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLMEMORY_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.
//
// CLPlatform.cpp: Implements the cl::Platform class.
#include "libANGLE/CLPlatform.h"
namespace cl
{
// TODO
} // 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.
//
// CLPlatform.h: Defines the cl::Platform class, which provides information about platform-specific
// OpenCL features.
#ifndef LIBANGLE_CLPLATFORM_H_
#define LIBANGLE_CLPLATFORM_H_
namespace cl
{
class Platform final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLPLATFORM_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.
//
// CLProgram.cpp: Implements the cl::Program class.
#include "libANGLE/CLProgram.h"
namespace cl
{
// TODO
} // 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.
//
// CLProgram.h: Defines the cl::Program class, which consists of a set of OpenCL kernels.
#ifndef LIBANGLE_CLPROGRAM_H_
#define LIBANGLE_CLPROGRAM_H_
namespace cl
{
class Program final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLPROGRAM_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.
//
// CLSampler.cpp: Implements the cl::Sampler class.
#include "libANGLE/CLSampler.h"
namespace cl
{
// TODO
} // 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.
//
// CLSampler.h: Defines the cl::Sampler class, which describes how to sample an OpenCL Image.
#ifndef LIBANGLE_CLSAMPLER_H_
#define LIBANGLE_CLSAMPLER_H_
namespace cl
{
class Sampler final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLSAMPLER_H_
...@@ -159,26 +159,8 @@ libangle_gpu_info_util_ios_sources = [ ...@@ -159,26 +159,8 @@ libangle_gpu_info_util_ios_sources = [
] ]
libangle_includes = [ libangle_includes = [
"include/angle_cl.h",
"include/angle_gl.h", "include/angle_gl.h",
"include/export.h", "include/export.h",
"include/CL/cl.h",
"include/CL/cl_d3d10.h",
"include/CL/cl_d3d11.h",
"include/CL/cl_dx9_media_sharing.h",
"include/CL/cl_dx9_media_sharing_intel.h",
"include/CL/cl_egl.h",
"include/CL/cl_ext.h",
"include/CL/cl_ext_intel.h",
"include/CL/cl_gl.h",
"include/CL/cl_gl_ext.h",
"include/CL/cl_half.h",
"include/CL/cl_icd.h",
"include/CL/cl_layer.h",
"include/CL/cl_platform.h",
"include/CL/cl_va_api_media_sharing_intel.h",
"include/CL/cl_version.h",
"include/CL/opencl.h",
"include/EGL/egl.h", "include/EGL/egl.h",
"include/EGL/eglext.h", "include/EGL/eglext.h",
"include/EGL/eglext_angle.h", "include/EGL/eglext_angle.h",
...@@ -445,6 +427,52 @@ libangle_sources = [ ...@@ -445,6 +427,52 @@ libangle_sources = [
"src/libANGLE/validationGL4.cpp", "src/libANGLE/validationGL4.cpp",
] ]
cl_includes = [
"include/angle_cl.h",
"include/export.h",
"include/CL/cl.h",
"include/CL/cl_d3d10.h",
"include/CL/cl_d3d11.h",
"include/CL/cl_dx9_media_sharing.h",
"include/CL/cl_dx9_media_sharing_intel.h",
"include/CL/cl_egl.h",
"include/CL/cl_ext.h",
"include/CL/cl_ext_intel.h",
"include/CL/cl_gl.h",
"include/CL/cl_gl_ext.h",
"include/CL/cl_half.h",
"include/CL/cl_icd.h",
"include/CL/cl_layer.h",
"include/CL/cl_platform.h",
"include/CL/cl_va_api_media_sharing_intel.h",
"include/CL/cl_version.h",
"include/CL/opencl.h",
]
libangle_cl_headers = [
"src/libANGLE/CLCommandQueue.h",
"src/libANGLE/CLContext.h",
"src/libANGLE/CLDevice.h",
"src/libANGLE/CLEvent.h",
"src/libANGLE/CLKernel.h",
"src/libANGLE/CLMemory.h",
"src/libANGLE/CLPlatform.h",
"src/libANGLE/CLProgram.h",
"src/libANGLE/CLSampler.h",
]
libangle_cl_sources = [
"src/libANGLE/CLCommandQueue.cpp",
"src/libANGLE/CLContext.cpp",
"src/libANGLE/CLDevice.cpp",
"src/libANGLE/CLEvent.cpp",
"src/libANGLE/CLKernel.cpp",
"src/libANGLE/CLMemory.cpp",
"src/libANGLE/CLPlatform.cpp",
"src/libANGLE/CLProgram.cpp",
"src/libANGLE/CLSampler.cpp",
]
libangle_mac_sources = [ libangle_mac_sources = [
"src/libANGLE/renderer/driver_utils_mac.mm", "src/libANGLE/renderer/driver_utils_mac.mm",
"src/libANGLE/renderer/gl/apple/DisplayApple_api.cpp", "src/libANGLE/renderer/gl/apple/DisplayApple_api.cpp",
...@@ -513,15 +541,10 @@ if (is_win) { ...@@ -513,15 +541,10 @@ if (is_win) {
} }
libglesv2_sources = [ libglesv2_sources = [
"src/libGLESv2/cl_stubs.cpp",
"src/libGLESv2/cl_stubs_autogen.h",
"src/libGLESv2/egl_ext_stubs.cpp", "src/libGLESv2/egl_ext_stubs.cpp",
"src/libGLESv2/egl_ext_stubs_autogen.h", "src/libGLESv2/egl_ext_stubs_autogen.h",
"src/libGLESv2/egl_stubs.cpp", "src/libGLESv2/egl_stubs.cpp",
"src/libGLESv2/egl_stubs_autogen.h", "src/libGLESv2/egl_stubs_autogen.h",
"src/libGLESv2/entry_points_cl_autogen.cpp",
"src/libGLESv2/entry_points_cl_autogen.h",
"src/libGLESv2/entry_points_cl_utils.h",
"src/libGLESv2/entry_points_egl_autogen.cpp", "src/libGLESv2/entry_points_egl_autogen.cpp",
"src/libGLESv2/entry_points_egl_autogen.h", "src/libGLESv2/entry_points_egl_autogen.h",
"src/libGLESv2/entry_points_egl_ext_autogen.cpp", "src/libGLESv2/entry_points_egl_ext_autogen.cpp",
...@@ -544,6 +567,14 @@ libglesv2_sources = [ ...@@ -544,6 +567,14 @@ libglesv2_sources = [
"src/libGLESv2/proc_table_egl.h", "src/libGLESv2/proc_table_egl.h",
"src/libGLESv2/proc_table_egl_autogen.cpp", "src/libGLESv2/proc_table_egl_autogen.cpp",
"src/libGLESv2/resource.h", "src/libGLESv2/resource.h",
]
libglesv2_cl_sources = [
"src/libGLESv2/cl_stubs.cpp",
"src/libGLESv2/cl_stubs_autogen.h",
"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", "src/libGLESv2/validationCL.h",
] ]
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
namespace cl namespace cl
{ {
cl_int GetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms) cl_int GetPlatformIDs(cl_uint num_entries, Platform **platforms, cl_uint *num_platforms)
{ {
return 0; return 0;
} }
cl_int GetPlatformInfo(cl_platform_id platform, cl_int GetPlatformInfo(Platform *platform,
PlatformInfo param_name, PlatformInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -24,16 +24,16 @@ cl_int GetPlatformInfo(cl_platform_id platform, ...@@ -24,16 +24,16 @@ cl_int GetPlatformInfo(cl_platform_id platform,
return 0; return 0;
} }
cl_int GetDeviceIDs(cl_platform_id platform, cl_int GetDeviceIDs(Platform *platform,
cl_device_type device_type, cl_device_type device_type,
cl_uint num_entries, cl_uint num_entries,
cl_device_id *devices, Device **devices,
cl_uint *num_devices) cl_uint *num_devices)
{ {
return 0; return 0;
} }
cl_int GetDeviceInfo(cl_device_id device, cl_int GetDeviceInfo(Device *device,
DeviceInfo param_name, DeviceInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -42,80 +42,76 @@ cl_int GetDeviceInfo(cl_device_id device, ...@@ -42,80 +42,76 @@ cl_int GetDeviceInfo(cl_device_id device,
return 0; return 0;
} }
cl_int CreateSubDevices(cl_device_id in_device, cl_int CreateSubDevices(Device *in_device,
const cl_device_partition_property *properties, const cl_device_partition_property *properties,
cl_uint num_devices, cl_uint num_devices,
cl_device_id *out_devices, Device **out_devices,
cl_uint *num_devices_ret) cl_uint *num_devices_ret)
{ {
return 0; return 0;
} }
cl_int RetainDevice(cl_device_id device) cl_int RetainDevice(Device *device)
{ {
return 0; return 0;
} }
cl_int ReleaseDevice(cl_device_id device) cl_int ReleaseDevice(Device *device)
{ {
return 0; return 0;
} }
cl_int SetDefaultDeviceCommandQueue(cl_context context, cl_int SetDefaultDeviceCommandQueue(Context *context, Device *device, CommandQueue *command_queue)
cl_device_id device,
cl_command_queue command_queue)
{ {
return 0; return 0;
} }
cl_int GetDeviceAndHostTimer(cl_device_id device, cl_int GetDeviceAndHostTimer(Device *device, cl_ulong *device_timestamp, cl_ulong *host_timestamp)
cl_ulong *device_timestamp,
cl_ulong *host_timestamp)
{ {
return 0; return 0;
} }
cl_int GetHostTimer(cl_device_id device, cl_ulong *host_timestamp) cl_int GetHostTimer(Device *device, cl_ulong *host_timestamp)
{ {
return 0; return 0;
} }
cl_context CreateContext(const cl_context_properties *properties, Context *CreateContext(const cl_context_properties *properties,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *devices, Device *const *devices,
void(CL_CALLBACK *pfn_notify)(const char *errinfo, void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info, const void *private_info,
size_t cb, size_t cb,
void *user_data), void *user_data),
void *user_data, void *user_data,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_context CreateContextFromType(const cl_context_properties *properties, Context *CreateContextFromType(const cl_context_properties *properties,
cl_device_type device_type, cl_device_type device_type,
void(CL_CALLBACK *pfn_notify)(const char *errinfo, void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info, const void *private_info,
size_t cb, size_t cb,
void *user_data), void *user_data),
void *user_data, void *user_data,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainContext(cl_context context) cl_int RetainContext(Context *context)
{ {
return 0; return 0;
} }
cl_int ReleaseContext(cl_context context) cl_int ReleaseContext(Context *context)
{ {
return 0; return 0;
} }
cl_int GetContextInfo(cl_context context, cl_int GetContextInfo(Context *context,
ContextInfo param_name, ContextInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -124,7 +120,7 @@ cl_int GetContextInfo(cl_context context, ...@@ -124,7 +120,7 @@ cl_int GetContextInfo(cl_context context,
return 0; return 0;
} }
cl_int SetContextDestructorCallback(cl_context context, cl_int SetContextDestructorCallback(Context *context,
void(CL_CALLBACK *pfn_notify)(cl_context context, void(CL_CALLBACK *pfn_notify)(cl_context context,
void *user_data), void *user_data),
void *user_data) void *user_data)
...@@ -132,25 +128,25 @@ cl_int SetContextDestructorCallback(cl_context context, ...@@ -132,25 +128,25 @@ cl_int SetContextDestructorCallback(cl_context context,
return 0; return 0;
} }
cl_command_queue CreateCommandQueueWithProperties(cl_context context, CommandQueue *CreateCommandQueueWithProperties(Context *context,
cl_device_id device, Device *device,
const cl_queue_properties *properties, const cl_queue_properties *properties,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainCommandQueue(cl_command_queue command_queue) cl_int RetainCommandQueue(CommandQueue *command_queue)
{ {
return 0; return 0;
} }
cl_int ReleaseCommandQueue(cl_command_queue command_queue) cl_int ReleaseCommandQueue(CommandQueue *command_queue)
{ {
return 0; return 0;
} }
cl_int GetCommandQueueInfo(cl_command_queue command_queue, cl_int GetCommandQueueInfo(CommandQueue *command_queue,
CommandQueueInfo param_name, CommandQueueInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -159,76 +155,76 @@ cl_int GetCommandQueueInfo(cl_command_queue command_queue, ...@@ -159,76 +155,76 @@ cl_int GetCommandQueueInfo(cl_command_queue command_queue,
return 0; return 0;
} }
cl_mem CreateBuffer(cl_context context, Memory *CreateBuffer(Context *context,
cl_mem_flags flags, cl_mem_flags flags,
size_t size, size_t size,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_mem CreateBufferWithProperties(cl_context context, Memory *CreateBufferWithProperties(Context *context,
const cl_mem_properties *properties, const cl_mem_properties *properties,
cl_mem_flags flags, cl_mem_flags flags,
size_t size, size_t size,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_mem CreateSubBuffer(cl_mem buffer, Memory *CreateSubBuffer(Memory *buffer,
cl_mem_flags flags, cl_mem_flags flags,
cl_buffer_create_type buffer_create_type, cl_buffer_create_type buffer_create_type,
const void *buffer_create_info, const void *buffer_create_info,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_mem CreateImage(cl_context context, Memory *CreateImage(Context *context,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, const cl_image_format *image_format,
const cl_image_desc *image_desc, const cl_image_desc *image_desc,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_mem CreateImageWithProperties(cl_context context, Memory *CreateImageWithProperties(Context *context,
const cl_mem_properties *properties, const cl_mem_properties *properties,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, const cl_image_format *image_format,
const cl_image_desc *image_desc, const cl_image_desc *image_desc,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_mem CreatePipe(cl_context context, Memory *CreatePipe(Context *context,
cl_mem_flags flags, cl_mem_flags flags,
cl_uint pipe_packet_size, cl_uint pipe_packet_size,
cl_uint pipe_max_packets, cl_uint pipe_max_packets,
const cl_pipe_properties *properties, const cl_pipe_properties *properties,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainMemObject(cl_mem memobj) cl_int RetainMemObject(Memory *memobj)
{ {
return 0; return 0;
} }
cl_int ReleaseMemObject(cl_mem memobj) cl_int ReleaseMemObject(Memory *memobj)
{ {
return 0; return 0;
} }
cl_int GetSupportedImageFormats(cl_context context, cl_int GetSupportedImageFormats(Context *context,
cl_mem_flags flags, cl_mem_flags flags,
MemObjectType image_type, MemObjectType image_type,
cl_uint num_entries, cl_uint num_entries,
...@@ -238,7 +234,7 @@ cl_int GetSupportedImageFormats(cl_context context, ...@@ -238,7 +234,7 @@ cl_int GetSupportedImageFormats(cl_context context,
return 0; return 0;
} }
cl_int GetMemObjectInfo(cl_mem memobj, cl_int GetMemObjectInfo(Memory *memobj,
MemInfo param_name, MemInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -247,7 +243,7 @@ cl_int GetMemObjectInfo(cl_mem memobj, ...@@ -247,7 +243,7 @@ cl_int GetMemObjectInfo(cl_mem memobj,
return 0; return 0;
} }
cl_int GetImageInfo(cl_mem image, cl_int GetImageInfo(Memory *image,
ImageInfo param_name, ImageInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -256,7 +252,7 @@ cl_int GetImageInfo(cl_mem image, ...@@ -256,7 +252,7 @@ cl_int GetImageInfo(cl_mem image,
return 0; return 0;
} }
cl_int GetPipeInfo(cl_mem pipe, cl_int GetPipeInfo(Memory *pipe,
PipeInfo param_name, PipeInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -265,38 +261,38 @@ cl_int GetPipeInfo(cl_mem pipe, ...@@ -265,38 +261,38 @@ cl_int GetPipeInfo(cl_mem pipe,
return 0; return 0;
} }
cl_int SetMemObjectDestructorCallback(cl_mem memobj, cl_int SetMemObjectDestructorCallback(Memory *memobj,
void(CL_CALLBACK *pfn_notify)(cl_mem memobj, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_mem memobj, void *user_data),
void *user_data) void *user_data)
{ {
return 0; return 0;
} }
void *SVMAlloc(cl_context context, cl_svm_mem_flags flags, size_t size, cl_uint alignment) void *SVMAlloc(Context *context, cl_svm_mem_flags flags, size_t size, cl_uint alignment)
{ {
return 0; return 0;
} }
void SVMFree(cl_context context, void *svm_pointer) {} void SVMFree(Context *context, void *svm_pointer) {}
cl_sampler CreateSamplerWithProperties(cl_context context, Sampler *CreateSamplerWithProperties(Context *context,
const cl_sampler_properties *sampler_properties, const cl_sampler_properties *sampler_properties,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainSampler(cl_sampler sampler) cl_int RetainSampler(Sampler *sampler)
{ {
return 0; return 0;
} }
cl_int ReleaseSampler(cl_sampler sampler) cl_int ReleaseSampler(Sampler *sampler)
{ {
return 0; return 0;
} }
cl_int GetSamplerInfo(cl_sampler sampler, cl_int GetSamplerInfo(Sampler *sampler,
SamplerInfo param_name, SamplerInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -305,56 +301,53 @@ cl_int GetSamplerInfo(cl_sampler sampler, ...@@ -305,56 +301,53 @@ cl_int GetSamplerInfo(cl_sampler sampler,
return 0; return 0;
} }
cl_program CreateProgramWithSource(cl_context context, Program *CreateProgramWithSource(Context *context,
cl_uint count, cl_uint count,
const char **strings, const char **strings,
const size_t *lengths, const size_t *lengths,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_program CreateProgramWithBinary(cl_context context, Program *CreateProgramWithBinary(Context *context,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_list,
const size_t *lengths, const size_t *lengths,
const unsigned char **binaries, const unsigned char **binaries,
cl_int *binary_status, cl_int *binary_status,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_program CreateProgramWithBuiltInKernels(cl_context context, Program *CreateProgramWithBuiltInKernels(Context *context,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_list,
const char *kernel_names, const char *kernel_names,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_program CreateProgramWithIL(cl_context context, Program *CreateProgramWithIL(Context *context, const void *il, size_t length, cl_int *errcode_ret)
const void *il,
size_t length,
cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainProgram(cl_program program) cl_int RetainProgram(Program *program)
{ {
return 0; return 0;
} }
cl_int ReleaseProgram(cl_program program) cl_int ReleaseProgram(Program *program)
{ {
return 0; return 0;
} }
cl_int BuildProgram(cl_program program, cl_int BuildProgram(Program *program,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_list,
const char *options, const char *options,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data) void *user_data)
...@@ -362,12 +355,12 @@ cl_int BuildProgram(cl_program program, ...@@ -362,12 +355,12 @@ cl_int BuildProgram(cl_program program,
return 0; return 0;
} }
cl_int CompileProgram(cl_program program, cl_int CompileProgram(Program *program,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_list,
const char *options, const char *options,
cl_uint num_input_headers, cl_uint num_input_headers,
const cl_program *input_headers, Program *const *input_headers,
const char **header_include_names, const char **header_include_names,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data) void *user_data)
...@@ -375,27 +368,27 @@ cl_int CompileProgram(cl_program program, ...@@ -375,27 +368,27 @@ cl_int CompileProgram(cl_program program,
return 0; return 0;
} }
cl_program LinkProgram(cl_context context, Program *LinkProgram(Context *context,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_list,
const char *options, const char *options,
cl_uint num_input_programs, cl_uint num_input_programs,
const cl_program *input_programs, Program *const *input_programs,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data, void *user_data,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int SetProgramReleaseCallback(cl_program program, cl_int SetProgramReleaseCallback(Program *program,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data) void *user_data)
{ {
return 0; return 0;
} }
cl_int SetProgramSpecializationConstant(cl_program program, cl_int SetProgramSpecializationConstant(Program *program,
cl_uint spec_id, cl_uint spec_id,
size_t spec_size, size_t spec_size,
const void *spec_value) const void *spec_value)
...@@ -403,12 +396,12 @@ cl_int SetProgramSpecializationConstant(cl_program program, ...@@ -403,12 +396,12 @@ cl_int SetProgramSpecializationConstant(cl_program program,
return 0; return 0;
} }
cl_int UnloadPlatformCompiler(cl_platform_id platform) cl_int UnloadPlatformCompiler(Platform *platform)
{ {
return 0; return 0;
} }
cl_int GetProgramInfo(cl_program program, cl_int GetProgramInfo(Program *program,
ProgramInfo param_name, ProgramInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -417,8 +410,8 @@ cl_int GetProgramInfo(cl_program program, ...@@ -417,8 +410,8 @@ cl_int GetProgramInfo(cl_program program,
return 0; return 0;
} }
cl_int GetProgramBuildInfo(cl_program program, cl_int GetProgramBuildInfo(Program *program,
cl_device_id device, Device *device,
ProgramBuildInfo param_name, ProgramBuildInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -427,45 +420,45 @@ cl_int GetProgramBuildInfo(cl_program program, ...@@ -427,45 +420,45 @@ cl_int GetProgramBuildInfo(cl_program program,
return 0; return 0;
} }
cl_kernel CreateKernel(cl_program program, const char *kernel_name, cl_int *errcode_ret) Kernel *CreateKernel(Program *program, const char *kernel_name, cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int CreateKernelsInProgram(cl_program program, cl_int CreateKernelsInProgram(Program *program,
cl_uint num_kernels, cl_uint num_kernels,
cl_kernel *kernels, Kernel **kernels,
cl_uint *num_kernels_ret) cl_uint *num_kernels_ret)
{ {
return 0; return 0;
} }
cl_kernel CloneKernel(cl_kernel source_kernel, cl_int *errcode_ret) Kernel *CloneKernel(Kernel *source_kernel, cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainKernel(cl_kernel kernel) cl_int RetainKernel(Kernel *kernel)
{ {
return 0; return 0;
} }
cl_int ReleaseKernel(cl_kernel kernel) cl_int ReleaseKernel(Kernel *kernel)
{ {
return 0; return 0;
} }
cl_int SetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value) cl_int SetKernelArg(Kernel *kernel, cl_uint arg_index, size_t arg_size, const void *arg_value)
{ {
return 0; return 0;
} }
cl_int SetKernelArgSVMPointer(cl_kernel kernel, cl_uint arg_index, const void *arg_value) cl_int SetKernelArgSVMPointer(Kernel *kernel, cl_uint arg_index, const void *arg_value)
{ {
return 0; return 0;
} }
cl_int SetKernelExecInfo(cl_kernel kernel, cl_int SetKernelExecInfo(Kernel *kernel,
KernelExecInfo param_name, KernelExecInfo param_name,
size_t param_value_size, size_t param_value_size,
const void *param_value) const void *param_value)
...@@ -473,7 +466,7 @@ cl_int SetKernelExecInfo(cl_kernel kernel, ...@@ -473,7 +466,7 @@ cl_int SetKernelExecInfo(cl_kernel kernel,
return 0; return 0;
} }
cl_int GetKernelInfo(cl_kernel kernel, cl_int GetKernelInfo(Kernel *kernel,
KernelInfo param_name, KernelInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -482,7 +475,7 @@ cl_int GetKernelInfo(cl_kernel kernel, ...@@ -482,7 +475,7 @@ cl_int GetKernelInfo(cl_kernel kernel,
return 0; return 0;
} }
cl_int GetKernelArgInfo(cl_kernel kernel, cl_int GetKernelArgInfo(Kernel *kernel,
cl_uint arg_index, cl_uint arg_index,
KernelArgInfo param_name, KernelArgInfo param_name,
size_t param_value_size, size_t param_value_size,
...@@ -492,8 +485,8 @@ cl_int GetKernelArgInfo(cl_kernel kernel, ...@@ -492,8 +485,8 @@ cl_int GetKernelArgInfo(cl_kernel kernel,
return 0; return 0;
} }
cl_int GetKernelWorkGroupInfo(cl_kernel kernel, cl_int GetKernelWorkGroupInfo(Kernel *kernel,
cl_device_id device, Device *device,
KernelWorkGroupInfo param_name, KernelWorkGroupInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -502,8 +495,8 @@ cl_int GetKernelWorkGroupInfo(cl_kernel kernel, ...@@ -502,8 +495,8 @@ cl_int GetKernelWorkGroupInfo(cl_kernel kernel,
return 0; return 0;
} }
cl_int GetKernelSubGroupInfo(cl_kernel kernel, cl_int GetKernelSubGroupInfo(Kernel *kernel,
cl_device_id device, Device *device,
KernelSubGroupInfo param_name, KernelSubGroupInfo param_name,
size_t input_value_size, size_t input_value_size,
const void *input_value, const void *input_value,
...@@ -514,12 +507,12 @@ cl_int GetKernelSubGroupInfo(cl_kernel kernel, ...@@ -514,12 +507,12 @@ cl_int GetKernelSubGroupInfo(cl_kernel kernel,
return 0; return 0;
} }
cl_int WaitForEvents(cl_uint num_events, const cl_event *event_list) cl_int WaitForEvents(cl_uint num_events, Event *const *event_list)
{ {
return 0; return 0;
} }
cl_int GetEventInfo(cl_event event, cl_int GetEventInfo(Event *event,
EventInfo param_name, EventInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -528,27 +521,27 @@ cl_int GetEventInfo(cl_event event, ...@@ -528,27 +521,27 @@ cl_int GetEventInfo(cl_event event,
return 0; return 0;
} }
cl_event CreateUserEvent(cl_context context, cl_int *errcode_ret) Event *CreateUserEvent(Context *context, cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int RetainEvent(cl_event event) cl_int RetainEvent(Event *event)
{ {
return 0; return 0;
} }
cl_int ReleaseEvent(cl_event event) cl_int ReleaseEvent(Event *event)
{ {
return 0; return 0;
} }
cl_int SetUserEventStatus(cl_event event, cl_int execution_status) cl_int SetUserEventStatus(Event *event, cl_int execution_status)
{ {
return 0; return 0;
} }
cl_int SetEventCallback(cl_event event, cl_int SetEventCallback(Event *event,
cl_int command_exec_callback_type, cl_int command_exec_callback_type,
void(CL_CALLBACK *pfn_notify)(cl_event event, void(CL_CALLBACK *pfn_notify)(cl_event event,
cl_int event_command_status, cl_int event_command_status,
...@@ -558,7 +551,7 @@ cl_int SetEventCallback(cl_event event, ...@@ -558,7 +551,7 @@ cl_int SetEventCallback(cl_event event,
return 0; return 0;
} }
cl_int GetEventProfilingInfo(cl_event event, cl_int GetEventProfilingInfo(Event *event,
ProfilingInfo param_name, ProfilingInfo param_name,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
...@@ -567,31 +560,31 @@ cl_int GetEventProfilingInfo(cl_event event, ...@@ -567,31 +560,31 @@ cl_int GetEventProfilingInfo(cl_event event,
return 0; return 0;
} }
cl_int Flush(cl_command_queue command_queue) cl_int Flush(CommandQueue *command_queue)
{ {
return 0; return 0;
} }
cl_int Finish(cl_command_queue command_queue) cl_int Finish(CommandQueue *command_queue)
{ {
return 0; return 0;
} }
cl_int EnqueueReadBuffer(cl_command_queue command_queue, cl_int EnqueueReadBuffer(CommandQueue *command_queue,
cl_mem buffer, Memory *buffer,
cl_bool blocking_read, cl_bool blocking_read,
size_t offset, size_t offset,
size_t size, size_t size,
void *ptr, void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueReadBufferRect(cl_command_queue command_queue, cl_int EnqueueReadBufferRect(CommandQueue *command_queue,
cl_mem buffer, Memory *buffer,
cl_bool blocking_read, cl_bool blocking_read,
const size_t *buffer_origin, const size_t *buffer_origin,
const size_t *host_origin, const size_t *host_origin,
...@@ -602,27 +595,27 @@ cl_int EnqueueReadBufferRect(cl_command_queue command_queue, ...@@ -602,27 +595,27 @@ cl_int EnqueueReadBufferRect(cl_command_queue command_queue,
size_t host_slice_pitch, size_t host_slice_pitch,
void *ptr, void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueWriteBuffer(cl_command_queue command_queue, cl_int EnqueueWriteBuffer(CommandQueue *command_queue,
cl_mem buffer, Memory *buffer,
cl_bool blocking_write, cl_bool blocking_write,
size_t offset, size_t offset,
size_t size, size_t size,
const void *ptr, const void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueWriteBufferRect(cl_command_queue command_queue, cl_int EnqueueWriteBufferRect(CommandQueue *command_queue,
cl_mem buffer, Memory *buffer,
cl_bool blocking_write, cl_bool blocking_write,
const size_t *buffer_origin, const size_t *buffer_origin,
const size_t *host_origin, const size_t *host_origin,
...@@ -633,41 +626,41 @@ cl_int EnqueueWriteBufferRect(cl_command_queue command_queue, ...@@ -633,41 +626,41 @@ cl_int EnqueueWriteBufferRect(cl_command_queue command_queue,
size_t host_slice_pitch, size_t host_slice_pitch,
const void *ptr, const void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueFillBuffer(cl_command_queue command_queue, cl_int EnqueueFillBuffer(CommandQueue *command_queue,
cl_mem buffer, Memory *buffer,
const void *pattern, const void *pattern,
size_t pattern_size, size_t pattern_size,
size_t offset, size_t offset,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueCopyBuffer(cl_command_queue command_queue, cl_int EnqueueCopyBuffer(CommandQueue *command_queue,
cl_mem src_buffer, Memory *src_buffer,
cl_mem dst_buffer, Memory *dst_buffer,
size_t src_offset, size_t src_offset,
size_t dst_offset, size_t dst_offset,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueCopyBufferRect(cl_command_queue command_queue, cl_int EnqueueCopyBufferRect(CommandQueue *command_queue,
cl_mem src_buffer, Memory *src_buffer,
cl_mem dst_buffer, Memory *dst_buffer,
const size_t *src_origin, const size_t *src_origin,
const size_t *dst_origin, const size_t *dst_origin,
const size_t *region, const size_t *region,
...@@ -676,14 +669,14 @@ cl_int EnqueueCopyBufferRect(cl_command_queue command_queue, ...@@ -676,14 +669,14 @@ cl_int EnqueueCopyBufferRect(cl_command_queue command_queue,
size_t dst_row_pitch, size_t dst_row_pitch,
size_t dst_slice_pitch, size_t dst_slice_pitch,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueReadImage(cl_command_queue command_queue, cl_int EnqueueReadImage(CommandQueue *command_queue,
cl_mem image, Memory *image,
cl_bool blocking_read, cl_bool blocking_read,
const size_t *origin, const size_t *origin,
const size_t *region, const size_t *region,
...@@ -691,14 +684,14 @@ cl_int EnqueueReadImage(cl_command_queue command_queue, ...@@ -691,14 +684,14 @@ cl_int EnqueueReadImage(cl_command_queue command_queue,
size_t slice_pitch, size_t slice_pitch,
void *ptr, void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueWriteImage(cl_command_queue command_queue, cl_int EnqueueWriteImage(CommandQueue *command_queue,
cl_mem image, Memory *image,
cl_bool blocking_write, cl_bool blocking_write,
const size_t *origin, const size_t *origin,
const size_t *region, const size_t *region,
...@@ -706,79 +699,79 @@ cl_int EnqueueWriteImage(cl_command_queue command_queue, ...@@ -706,79 +699,79 @@ cl_int EnqueueWriteImage(cl_command_queue command_queue,
size_t input_slice_pitch, size_t input_slice_pitch,
const void *ptr, const void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueFillImage(cl_command_queue command_queue, cl_int EnqueueFillImage(CommandQueue *command_queue,
cl_mem image, Memory *image,
const void *fill_color, const void *fill_color,
const size_t *origin, const size_t *origin,
const size_t *region, const size_t *region,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueCopyImage(cl_command_queue command_queue, cl_int EnqueueCopyImage(CommandQueue *command_queue,
cl_mem src_image, Memory *src_image,
cl_mem dst_image, Memory *dst_image,
const size_t *src_origin, const size_t *src_origin,
const size_t *dst_origin, const size_t *dst_origin,
const size_t *region, const size_t *region,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueCopyImageToBuffer(cl_command_queue command_queue, cl_int EnqueueCopyImageToBuffer(CommandQueue *command_queue,
cl_mem src_image, Memory *src_image,
cl_mem dst_buffer, Memory *dst_buffer,
const size_t *src_origin, const size_t *src_origin,
const size_t *region, const size_t *region,
size_t dst_offset, size_t dst_offset,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueCopyBufferToImage(cl_command_queue command_queue, cl_int EnqueueCopyBufferToImage(CommandQueue *command_queue,
cl_mem src_buffer, Memory *src_buffer,
cl_mem dst_image, Memory *dst_image,
size_t src_offset, size_t src_offset,
const size_t *dst_origin, const size_t *dst_origin,
const size_t *region, const size_t *region,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
void *EnqueueMapBuffer(cl_command_queue command_queue, void *EnqueueMapBuffer(CommandQueue *command_queue,
cl_mem buffer, Memory *buffer,
cl_bool blocking_map, cl_bool blocking_map,
cl_map_flags map_flags, cl_map_flags map_flags,
size_t offset, size_t offset,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event, Event **event,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
void *EnqueueMapImage(cl_command_queue command_queue, void *EnqueueMapImage(CommandQueue *command_queue,
cl_mem image, Memory *image,
cl_bool blocking_map, cl_bool blocking_map,
cl_map_flags map_flags, cl_map_flags map_flags,
const size_t *origin, const size_t *origin,
...@@ -786,78 +779,78 @@ void *EnqueueMapImage(cl_command_queue command_queue, ...@@ -786,78 +779,78 @@ void *EnqueueMapImage(cl_command_queue command_queue,
size_t *image_row_pitch, size_t *image_row_pitch,
size_t *image_slice_pitch, size_t *image_slice_pitch,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event, Event **event,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int EnqueueUnmapMemObject(cl_command_queue command_queue, cl_int EnqueueUnmapMemObject(CommandQueue *command_queue,
cl_mem memobj, Memory *memobj,
void *mapped_ptr, void *mapped_ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueMigrateMemObjects(cl_command_queue command_queue, cl_int EnqueueMigrateMemObjects(CommandQueue *command_queue,
cl_uint num_mem_objects, cl_uint num_mem_objects,
const cl_mem *mem_objects, Memory *const *mem_objects,
cl_mem_migration_flags flags, cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueNDRangeKernel(cl_command_queue command_queue, cl_int EnqueueNDRangeKernel(CommandQueue *command_queue,
cl_kernel kernel, Kernel *kernel,
cl_uint work_dim, cl_uint work_dim,
const size_t *global_work_offset, const size_t *global_work_offset,
const size_t *global_work_size, const size_t *global_work_size,
const size_t *local_work_size, const size_t *local_work_size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueNativeKernel(cl_command_queue command_queue, cl_int EnqueueNativeKernel(CommandQueue *command_queue,
void(CL_CALLBACK *user_func)(void *), void(CL_CALLBACK *user_func)(void *),
void *args, void *args,
size_t cb_args, size_t cb_args,
cl_uint num_mem_objects, cl_uint num_mem_objects,
const cl_mem *mem_list, Memory *const *mem_list,
const void **args_mem_loc, const void **args_mem_loc,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueMarkerWithWaitList(cl_command_queue command_queue, cl_int EnqueueMarkerWithWaitList(CommandQueue *command_queue,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueBarrierWithWaitList(cl_command_queue command_queue, cl_int EnqueueBarrierWithWaitList(CommandQueue *command_queue,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueSVMFree(cl_command_queue command_queue, cl_int EnqueueSVMFree(CommandQueue *command_queue,
cl_uint num_svm_pointers, cl_uint num_svm_pointers,
void *svm_pointers[], void *svm_pointers[],
void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue, void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue,
...@@ -866,75 +859,75 @@ cl_int EnqueueSVMFree(cl_command_queue command_queue, ...@@ -866,75 +859,75 @@ cl_int EnqueueSVMFree(cl_command_queue command_queue,
void *user_data), void *user_data),
void *user_data, void *user_data,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueSVMMemcpy(cl_command_queue command_queue, cl_int EnqueueSVMMemcpy(CommandQueue *command_queue,
cl_bool blocking_copy, cl_bool blocking_copy,
void *dst_ptr, void *dst_ptr,
const void *src_ptr, const void *src_ptr,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueSVMMemFill(cl_command_queue command_queue, cl_int EnqueueSVMMemFill(CommandQueue *command_queue,
void *svm_ptr, void *svm_ptr,
const void *pattern, const void *pattern,
size_t pattern_size, size_t pattern_size,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueSVMMap(cl_command_queue command_queue, cl_int EnqueueSVMMap(CommandQueue *command_queue,
cl_bool blocking_map, cl_bool blocking_map,
cl_map_flags flags, cl_map_flags flags,
void *svm_ptr, void *svm_ptr,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueSVMUnmap(cl_command_queue command_queue, cl_int EnqueueSVMUnmap(CommandQueue *command_queue,
void *svm_ptr, void *svm_ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueSVMMigrateMem(cl_command_queue command_queue, cl_int EnqueueSVMMigrateMem(CommandQueue *command_queue,
cl_uint num_svm_pointers, cl_uint num_svm_pointers,
const void **svm_pointers, const void **svm_pointers,
const size_t *sizes, const size_t *sizes,
cl_mem_migration_flags flags, cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
void *GetExtensionFunctionAddressForPlatform(cl_platform_id platform, const char *func_name) void *GetExtensionFunctionAddressForPlatform(Platform *platform, const char *func_name)
{ {
return 0; return 0;
} }
cl_int SetCommandQueueProperty(cl_command_queue command_queue, cl_int SetCommandQueueProperty(CommandQueue *command_queue,
cl_command_queue_properties properties, cl_command_queue_properties properties,
cl_bool enable, cl_bool enable,
cl_command_queue_properties *old_properties) cl_command_queue_properties *old_properties)
...@@ -942,45 +935,45 @@ cl_int SetCommandQueueProperty(cl_command_queue command_queue, ...@@ -942,45 +935,45 @@ cl_int SetCommandQueueProperty(cl_command_queue command_queue,
return 0; return 0;
} }
cl_mem CreateImage2D(cl_context context, Memory *CreateImage2D(Context *context,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, const cl_image_format *image_format,
size_t image_width, size_t image_width,
size_t image_height, size_t image_height,
size_t image_row_pitch, size_t image_row_pitch,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_mem CreateImage3D(cl_context context, Memory *CreateImage3D(Context *context,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, const cl_image_format *image_format,
size_t image_width, size_t image_width,
size_t image_height, size_t image_height,
size_t image_depth, size_t image_depth,
size_t image_row_pitch, size_t image_row_pitch,
size_t image_slice_pitch, size_t image_slice_pitch,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int EnqueueMarker(cl_command_queue command_queue, cl_event *event) cl_int EnqueueMarker(CommandQueue *command_queue, Event **event)
{ {
return 0; return 0;
} }
cl_int EnqueueWaitForEvents(cl_command_queue command_queue, cl_int EnqueueWaitForEvents(CommandQueue *command_queue,
cl_uint num_events, cl_uint num_events,
const cl_event *event_list) Event *const *event_list)
{ {
return 0; return 0;
} }
cl_int EnqueueBarrier(cl_command_queue command_queue) cl_int EnqueueBarrier(CommandQueue *command_queue)
{ {
return 0; return 0;
} }
...@@ -995,28 +988,28 @@ void *GetExtensionFunctionAddress(const char *func_name) ...@@ -995,28 +988,28 @@ void *GetExtensionFunctionAddress(const char *func_name)
return 0; return 0;
} }
cl_command_queue CreateCommandQueue(cl_context context, CommandQueue *CreateCommandQueue(Context *context,
cl_device_id device, Device *device,
cl_command_queue_properties properties, cl_command_queue_properties properties,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_sampler CreateSampler(cl_context context, Sampler *CreateSampler(Context *context,
cl_bool normalized_coords, cl_bool normalized_coords,
AddressingMode addressing_mode, AddressingMode addressing_mode,
FilterMode filter_mode, FilterMode filter_mode,
cl_int *errcode_ret) cl_int *errcode_ret)
{ {
return 0; return 0;
} }
cl_int EnqueueTask(cl_command_queue command_queue, cl_int EnqueueTask(CommandQueue *command_queue,
cl_kernel kernel, Kernel *kernel,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_list,
cl_event *event) Event **event)
{ {
return 0; return 0;
} }
......
...@@ -16,287 +16,300 @@ ...@@ -16,287 +16,300 @@
namespace cl namespace cl
{ {
cl_int GetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms); class CommandQueue;
cl_int GetPlatformInfo(cl_platform_id platform, 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, PlatformInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetDeviceIDs(cl_platform_id platform, cl_int GetDeviceIDs(Platform *platformPacked,
cl_device_type device_type, cl_device_type device_type,
cl_uint num_entries, cl_uint num_entries,
cl_device_id *devices, Device **devicesPacked,
cl_uint *num_devices); cl_uint *num_devices);
cl_int GetDeviceInfo(cl_device_id device, cl_int GetDeviceInfo(Device *devicePacked,
DeviceInfo param_namePacked, DeviceInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int CreateSubDevices(cl_device_id in_device, cl_int CreateSubDevices(Device *in_devicePacked,
const cl_device_partition_property *properties, const cl_device_partition_property *properties,
cl_uint num_devices, cl_uint num_devices,
cl_device_id *out_devices, Device **out_devicesPacked,
cl_uint *num_devices_ret); cl_uint *num_devices_ret);
cl_int RetainDevice(cl_device_id device); cl_int RetainDevice(Device *devicePacked);
cl_int ReleaseDevice(cl_device_id device); cl_int ReleaseDevice(Device *devicePacked);
cl_int SetDefaultDeviceCommandQueue(cl_context context, cl_int SetDefaultDeviceCommandQueue(Context *contextPacked,
cl_device_id device, Device *devicePacked,
cl_command_queue command_queue); CommandQueue *command_queuePacked);
cl_int GetDeviceAndHostTimer(cl_device_id device, cl_int GetDeviceAndHostTimer(Device *devicePacked,
cl_ulong *device_timestamp, cl_ulong *device_timestamp,
cl_ulong *host_timestamp); cl_ulong *host_timestamp);
cl_int GetHostTimer(cl_device_id device, cl_ulong *host_timestamp); cl_int GetHostTimer(Device *devicePacked, cl_ulong *host_timestamp);
cl_context CreateContext(const cl_context_properties *properties, Context *CreateContext(const cl_context_properties *properties,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *devices, Device *const *devicesPacked,
void(CL_CALLBACK *pfn_notify)(const char *errinfo, void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info, const void *private_info,
size_t cb, size_t cb,
void *user_data), void *user_data),
void *user_data, void *user_data,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_context CreateContextFromType(const cl_context_properties *properties, Context *CreateContextFromType(const cl_context_properties *properties,
cl_device_type device_type, cl_device_type device_type,
void(CL_CALLBACK *pfn_notify)(const char *errinfo, void(CL_CALLBACK *pfn_notify)(const char *errinfo,
const void *private_info, const void *private_info,
size_t cb, size_t cb,
void *user_data), void *user_data),
void *user_data, void *user_data,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int RetainContext(cl_context context); cl_int RetainContext(Context *contextPacked);
cl_int ReleaseContext(cl_context context); cl_int ReleaseContext(Context *contextPacked);
cl_int GetContextInfo(cl_context context, cl_int GetContextInfo(Context *contextPacked,
ContextInfo param_namePacked, ContextInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int SetContextDestructorCallback(cl_context context, cl_int SetContextDestructorCallback(Context *contextPacked,
void(CL_CALLBACK *pfn_notify)(cl_context context, void(CL_CALLBACK *pfn_notify)(cl_context context,
void *user_data), void *user_data),
void *user_data); void *user_data);
cl_command_queue CreateCommandQueueWithProperties(cl_context context, CommandQueue *CreateCommandQueueWithProperties(Context *contextPacked,
cl_device_id device, Device *devicePacked,
const cl_queue_properties *properties, const cl_queue_properties *properties,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int RetainCommandQueue(cl_command_queue command_queue); cl_int RetainCommandQueue(CommandQueue *command_queuePacked);
cl_int ReleaseCommandQueue(cl_command_queue command_queue); cl_int ReleaseCommandQueue(CommandQueue *command_queuePacked);
cl_int GetCommandQueueInfo(cl_command_queue command_queue, cl_int GetCommandQueueInfo(CommandQueue *command_queuePacked,
CommandQueueInfo param_namePacked, CommandQueueInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_mem CreateBuffer(cl_context context, Memory *CreateBuffer(Context *contextPacked,
cl_mem_flags flags,
size_t size,
void *host_ptr,
cl_int *errcode_ret);
Memory *CreateBufferWithProperties(Context *contextPacked,
const cl_mem_properties *properties,
cl_mem_flags flags,
size_t size,
void *host_ptr,
cl_int *errcode_ret);
Memory *CreateSubBuffer(Memory *bufferPacked,
cl_mem_flags flags,
cl_buffer_create_type buffer_create_type,
const void *buffer_create_info,
cl_int *errcode_ret);
Memory *CreateImage(Context *contextPacked,
cl_mem_flags flags, cl_mem_flags flags,
size_t size, const cl_image_format *image_format,
const cl_image_desc *image_desc,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_mem CreateBufferWithProperties(cl_context context, Memory *CreateImageWithProperties(Context *contextPacked,
const cl_mem_properties *properties, const cl_mem_properties *properties,
cl_mem_flags flags, cl_mem_flags flags,
size_t size, const cl_image_format *image_format,
const cl_image_desc *image_desc,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_mem CreateSubBuffer(cl_mem buffer, Memory *CreatePipe(Context *contextPacked,
cl_mem_flags flags,
cl_buffer_create_type buffer_create_type,
const void *buffer_create_info,
cl_int *errcode_ret);
cl_mem CreateImage(cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, cl_uint pipe_packet_size,
const cl_image_desc *image_desc, cl_uint pipe_max_packets,
void *host_ptr, const cl_pipe_properties *properties,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_mem CreateImageWithProperties(cl_context context, cl_int RetainMemObject(Memory *memobjPacked);
const cl_mem_properties *properties, cl_int ReleaseMemObject(Memory *memobjPacked);
cl_mem_flags flags, cl_int GetSupportedImageFormats(Context *contextPacked,
const cl_image_format *image_format,
const cl_image_desc *image_desc,
void *host_ptr,
cl_int *errcode_ret);
cl_mem CreatePipe(cl_context context,
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 RetainMemObject(cl_mem memobj);
cl_int ReleaseMemObject(cl_mem memobj);
cl_int GetSupportedImageFormats(cl_context context,
cl_mem_flags flags, cl_mem_flags flags,
MemObjectType image_typePacked, MemObjectType image_typePacked,
cl_uint num_entries, cl_uint num_entries,
cl_image_format *image_formats, cl_image_format *image_formats,
cl_uint *num_image_formats); cl_uint *num_image_formats);
cl_int GetMemObjectInfo(cl_mem memobj, cl_int GetMemObjectInfo(Memory *memobjPacked,
MemInfo param_namePacked, MemInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetImageInfo(cl_mem image, cl_int GetImageInfo(Memory *imagePacked,
ImageInfo param_namePacked, ImageInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetPipeInfo(cl_mem pipe, cl_int GetPipeInfo(Memory *pipePacked,
PipeInfo param_namePacked, PipeInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int SetMemObjectDestructorCallback(cl_mem memobj, cl_int SetMemObjectDestructorCallback(Memory *memobjPacked,
void(CL_CALLBACK *pfn_notify)(cl_mem memobj, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_mem memobj, void *user_data),
void *user_data); void *user_data);
void *SVMAlloc(cl_context context, cl_svm_mem_flags flags, size_t size, cl_uint alignment); void *SVMAlloc(Context *contextPacked, cl_svm_mem_flags flags, size_t size, cl_uint alignment);
void SVMFree(cl_context context, void *svm_pointer); void SVMFree(Context *contextPacked, void *svm_pointer);
cl_sampler CreateSamplerWithProperties(cl_context context, Sampler *CreateSamplerWithProperties(Context *contextPacked,
const cl_sampler_properties *sampler_properties, const cl_sampler_properties *sampler_properties,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int RetainSampler(cl_sampler sampler); cl_int RetainSampler(Sampler *samplerPacked);
cl_int ReleaseSampler(cl_sampler sampler); cl_int ReleaseSampler(Sampler *samplerPacked);
cl_int GetSamplerInfo(cl_sampler sampler, cl_int GetSamplerInfo(Sampler *samplerPacked,
SamplerInfo param_namePacked, SamplerInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_program CreateProgramWithSource(cl_context context, Program *CreateProgramWithSource(Context *contextPacked,
cl_uint count, cl_uint count,
const char **strings, const char **strings,
const size_t *lengths, const size_t *lengths,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_program CreateProgramWithBinary(cl_context context, Program *CreateProgramWithBinary(Context *contextPacked,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_listPacked,
const size_t *lengths, const size_t *lengths,
const unsigned char **binaries, const unsigned char **binaries,
cl_int *binary_status, cl_int *binary_status,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_program CreateProgramWithBuiltInKernels(cl_context context, Program *CreateProgramWithBuiltInKernels(Context *contextPacked,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_listPacked,
const char *kernel_names, const char *kernel_names,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_program CreateProgramWithIL(cl_context context, Program *CreateProgramWithIL(Context *contextPacked,
const void *il, const void *il,
size_t length, size_t length,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int RetainProgram(cl_program program); cl_int RetainProgram(Program *programPacked);
cl_int ReleaseProgram(cl_program program); cl_int ReleaseProgram(Program *programPacked);
cl_int BuildProgram(cl_program program, cl_int BuildProgram(Program *programPacked,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_listPacked,
const char *options, const char *options,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data); void *user_data);
cl_int CompileProgram(cl_program program, cl_int CompileProgram(Program *programPacked,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_listPacked,
const char *options, const char *options,
cl_uint num_input_headers, cl_uint num_input_headers,
const cl_program *input_headers, Program *const *input_headersPacked,
const char **header_include_names, const char **header_include_names,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data); void *user_data);
cl_program LinkProgram(cl_context context, Program *LinkProgram(Context *contextPacked,
cl_uint num_devices, cl_uint num_devices,
const cl_device_id *device_list, Device *const *device_listPacked,
const char *options, const char *options,
cl_uint num_input_programs, cl_uint num_input_programs,
const cl_program *input_programs, Program *const *input_programsPacked,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data, void *user_data,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int SetProgramReleaseCallback(cl_program program, cl_int SetProgramReleaseCallback(Program *programPacked,
void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
void *user_data); void *user_data);
cl_int SetProgramSpecializationConstant(cl_program program, cl_int SetProgramSpecializationConstant(Program *programPacked,
cl_uint spec_id, cl_uint spec_id,
size_t spec_size, size_t spec_size,
const void *spec_value); const void *spec_value);
cl_int UnloadPlatformCompiler(cl_platform_id platform); cl_int UnloadPlatformCompiler(Platform *platformPacked);
cl_int GetProgramInfo(cl_program program, cl_int GetProgramInfo(Program *programPacked,
ProgramInfo param_namePacked, ProgramInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetProgramBuildInfo(cl_program program, cl_int GetProgramBuildInfo(Program *programPacked,
cl_device_id device, Device *devicePacked,
ProgramBuildInfo param_namePacked, ProgramBuildInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_kernel CreateKernel(cl_program program, const char *kernel_name, cl_int *errcode_ret); Kernel *CreateKernel(Program *programPacked, const char *kernel_name, cl_int *errcode_ret);
cl_int CreateKernelsInProgram(cl_program program, cl_int CreateKernelsInProgram(Program *programPacked,
cl_uint num_kernels, cl_uint num_kernels,
cl_kernel *kernels, Kernel **kernelsPacked,
cl_uint *num_kernels_ret); cl_uint *num_kernels_ret);
cl_kernel CloneKernel(cl_kernel source_kernel, cl_int *errcode_ret); Kernel *CloneKernel(Kernel *source_kernelPacked, cl_int *errcode_ret);
cl_int RetainKernel(cl_kernel kernel); cl_int RetainKernel(Kernel *kernelPacked);
cl_int ReleaseKernel(cl_kernel kernel); cl_int ReleaseKernel(Kernel *kernelPacked);
cl_int SetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value); cl_int SetKernelArg(Kernel *kernelPacked,
cl_int SetKernelArgSVMPointer(cl_kernel kernel, cl_uint arg_index, const void *arg_value); cl_uint arg_index,
cl_int SetKernelExecInfo(cl_kernel kernel, size_t arg_size,
const void *arg_value);
cl_int SetKernelArgSVMPointer(Kernel *kernelPacked, cl_uint arg_index, const void *arg_value);
cl_int SetKernelExecInfo(Kernel *kernelPacked,
KernelExecInfo param_namePacked, KernelExecInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
const void *param_value); const void *param_value);
cl_int GetKernelInfo(cl_kernel kernel, cl_int GetKernelInfo(Kernel *kernelPacked,
KernelInfo param_namePacked, KernelInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetKernelArgInfo(cl_kernel kernel, cl_int GetKernelArgInfo(Kernel *kernelPacked,
cl_uint arg_index, cl_uint arg_index,
KernelArgInfo param_namePacked, KernelArgInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetKernelWorkGroupInfo(cl_kernel kernel, cl_int GetKernelWorkGroupInfo(Kernel *kernelPacked,
cl_device_id device, Device *devicePacked,
KernelWorkGroupInfo param_namePacked, KernelWorkGroupInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int GetKernelSubGroupInfo(cl_kernel kernel, cl_int GetKernelSubGroupInfo(Kernel *kernelPacked,
cl_device_id device, Device *devicePacked,
KernelSubGroupInfo param_namePacked, KernelSubGroupInfo param_namePacked,
size_t input_value_size, size_t input_value_size,
const void *input_value, const void *input_value,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int WaitForEvents(cl_uint num_events, const cl_event *event_list); cl_int WaitForEvents(cl_uint num_events, Event *const *event_listPacked);
cl_int GetEventInfo(cl_event event, cl_int GetEventInfo(Event *eventPacked,
EventInfo param_namePacked, EventInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_event CreateUserEvent(cl_context context, cl_int *errcode_ret); Event *CreateUserEvent(Context *contextPacked, cl_int *errcode_ret);
cl_int RetainEvent(cl_event event); cl_int RetainEvent(Event *eventPacked);
cl_int ReleaseEvent(cl_event event); cl_int ReleaseEvent(Event *eventPacked);
cl_int SetUserEventStatus(cl_event event, cl_int execution_status); cl_int SetUserEventStatus(Event *eventPacked, cl_int execution_status);
cl_int SetEventCallback(cl_event event, cl_int SetEventCallback(Event *eventPacked,
cl_int command_exec_callback_type, cl_int command_exec_callback_type,
void(CL_CALLBACK *pfn_notify)(cl_event event, void(CL_CALLBACK *pfn_notify)(cl_event event,
cl_int event_command_status, cl_int event_command_status,
void *user_data), void *user_data),
void *user_data); void *user_data);
cl_int GetEventProfilingInfo(cl_event event, cl_int GetEventProfilingInfo(Event *eventPacked,
ProfilingInfo param_namePacked, ProfilingInfo param_namePacked,
size_t param_value_size, size_t param_value_size,
void *param_value, void *param_value,
size_t *param_value_size_ret); size_t *param_value_size_ret);
cl_int Flush(cl_command_queue command_queue); cl_int Flush(CommandQueue *command_queuePacked);
cl_int Finish(cl_command_queue command_queue); cl_int Finish(CommandQueue *command_queuePacked);
cl_int EnqueueReadBuffer(cl_command_queue command_queue, cl_int EnqueueReadBuffer(CommandQueue *command_queuePacked,
cl_mem buffer, Memory *bufferPacked,
cl_bool blocking_read, cl_bool blocking_read,
size_t offset, size_t offset,
size_t size, size_t size,
void *ptr, void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueReadBufferRect(cl_command_queue command_queue, cl_int EnqueueReadBufferRect(CommandQueue *command_queuePacked,
cl_mem buffer, Memory *bufferPacked,
cl_bool blocking_read, cl_bool blocking_read,
const size_t *buffer_origin, const size_t *buffer_origin,
const size_t *host_origin, const size_t *host_origin,
...@@ -307,19 +320,19 @@ cl_int EnqueueReadBufferRect(cl_command_queue command_queue, ...@@ -307,19 +320,19 @@ cl_int EnqueueReadBufferRect(cl_command_queue command_queue,
size_t host_slice_pitch, size_t host_slice_pitch,
void *ptr, void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueWriteBuffer(cl_command_queue command_queue, cl_int EnqueueWriteBuffer(CommandQueue *command_queuePacked,
cl_mem buffer, Memory *bufferPacked,
cl_bool blocking_write, cl_bool blocking_write,
size_t offset, size_t offset,
size_t size, size_t size,
const void *ptr, const void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueWriteBufferRect(cl_command_queue command_queue, cl_int EnqueueWriteBufferRect(CommandQueue *command_queuePacked,
cl_mem buffer, Memory *bufferPacked,
cl_bool blocking_write, cl_bool blocking_write,
const size_t *buffer_origin, const size_t *buffer_origin,
const size_t *host_origin, const size_t *host_origin,
...@@ -330,29 +343,29 @@ cl_int EnqueueWriteBufferRect(cl_command_queue command_queue, ...@@ -330,29 +343,29 @@ cl_int EnqueueWriteBufferRect(cl_command_queue command_queue,
size_t host_slice_pitch, size_t host_slice_pitch,
const void *ptr, const void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueFillBuffer(cl_command_queue command_queue, cl_int EnqueueFillBuffer(CommandQueue *command_queuePacked,
cl_mem buffer, Memory *bufferPacked,
const void *pattern, const void *pattern,
size_t pattern_size, size_t pattern_size,
size_t offset, size_t offset,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueCopyBuffer(cl_command_queue command_queue, cl_int EnqueueCopyBuffer(CommandQueue *command_queuePacked,
cl_mem src_buffer, Memory *src_bufferPacked,
cl_mem dst_buffer, Memory *dst_bufferPacked,
size_t src_offset, size_t src_offset,
size_t dst_offset, size_t dst_offset,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueCopyBufferRect(cl_command_queue command_queue, cl_int EnqueueCopyBufferRect(CommandQueue *command_queuePacked,
cl_mem src_buffer, Memory *src_bufferPacked,
cl_mem dst_buffer, Memory *dst_bufferPacked,
const size_t *src_origin, const size_t *src_origin,
const size_t *dst_origin, const size_t *dst_origin,
const size_t *region, const size_t *region,
...@@ -361,10 +374,10 @@ cl_int EnqueueCopyBufferRect(cl_command_queue command_queue, ...@@ -361,10 +374,10 @@ cl_int EnqueueCopyBufferRect(cl_command_queue command_queue,
size_t dst_row_pitch, size_t dst_row_pitch,
size_t dst_slice_pitch, size_t dst_slice_pitch,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueReadImage(cl_command_queue command_queue, cl_int EnqueueReadImage(CommandQueue *command_queuePacked,
cl_mem image, Memory *imagePacked,
cl_bool blocking_read, cl_bool blocking_read,
const size_t *origin, const size_t *origin,
const size_t *region, const size_t *region,
...@@ -372,10 +385,10 @@ cl_int EnqueueReadImage(cl_command_queue command_queue, ...@@ -372,10 +385,10 @@ cl_int EnqueueReadImage(cl_command_queue command_queue,
size_t slice_pitch, size_t slice_pitch,
void *ptr, void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueWriteImage(cl_command_queue command_queue, cl_int EnqueueWriteImage(CommandQueue *command_queuePacked,
cl_mem image, Memory *imagePacked,
cl_bool blocking_write, cl_bool blocking_write,
const size_t *origin, const size_t *origin,
const size_t *region, const size_t *region,
...@@ -383,55 +396,55 @@ cl_int EnqueueWriteImage(cl_command_queue command_queue, ...@@ -383,55 +396,55 @@ cl_int EnqueueWriteImage(cl_command_queue command_queue,
size_t input_slice_pitch, size_t input_slice_pitch,
const void *ptr, const void *ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueFillImage(cl_command_queue command_queue, cl_int EnqueueFillImage(CommandQueue *command_queuePacked,
cl_mem image, Memory *imagePacked,
const void *fill_color, const void *fill_color,
const size_t *origin, const size_t *origin,
const size_t *region, const size_t *region,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueCopyImage(cl_command_queue command_queue, cl_int EnqueueCopyImage(CommandQueue *command_queuePacked,
cl_mem src_image, Memory *src_imagePacked,
cl_mem dst_image, Memory *dst_imagePacked,
const size_t *src_origin, const size_t *src_origin,
const size_t *dst_origin, const size_t *dst_origin,
const size_t *region, const size_t *region,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueCopyImageToBuffer(cl_command_queue command_queue, cl_int EnqueueCopyImageToBuffer(CommandQueue *command_queuePacked,
cl_mem src_image, Memory *src_imagePacked,
cl_mem dst_buffer, Memory *dst_bufferPacked,
const size_t *src_origin, const size_t *src_origin,
const size_t *region, const size_t *region,
size_t dst_offset, size_t dst_offset,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueCopyBufferToImage(cl_command_queue command_queue, cl_int EnqueueCopyBufferToImage(CommandQueue *command_queuePacked,
cl_mem src_buffer, Memory *src_bufferPacked,
cl_mem dst_image, Memory *dst_imagePacked,
size_t src_offset, size_t src_offset,
const size_t *dst_origin, const size_t *dst_origin,
const size_t *region, const size_t *region,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
void *EnqueueMapBuffer(cl_command_queue command_queue, void *EnqueueMapBuffer(CommandQueue *command_queuePacked,
cl_mem buffer, Memory *bufferPacked,
cl_bool blocking_map, cl_bool blocking_map,
cl_map_flags map_flags, cl_map_flags map_flags,
size_t offset, size_t offset,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event, Event **eventPacked,
cl_int *errcode_ret); cl_int *errcode_ret);
void *EnqueueMapImage(cl_command_queue command_queue, void *EnqueueMapImage(CommandQueue *command_queuePacked,
cl_mem image, Memory *imagePacked,
cl_bool blocking_map, cl_bool blocking_map,
cl_map_flags map_flags, cl_map_flags map_flags,
const size_t *origin, const size_t *origin,
...@@ -439,50 +452,50 @@ void *EnqueueMapImage(cl_command_queue command_queue, ...@@ -439,50 +452,50 @@ void *EnqueueMapImage(cl_command_queue command_queue,
size_t *image_row_pitch, size_t *image_row_pitch,
size_t *image_slice_pitch, size_t *image_slice_pitch,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event, Event **eventPacked,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int EnqueueUnmapMemObject(cl_command_queue command_queue, cl_int EnqueueUnmapMemObject(CommandQueue *command_queuePacked,
cl_mem memobj, Memory *memobjPacked,
void *mapped_ptr, void *mapped_ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueMigrateMemObjects(cl_command_queue command_queue, cl_int EnqueueMigrateMemObjects(CommandQueue *command_queuePacked,
cl_uint num_mem_objects, cl_uint num_mem_objects,
const cl_mem *mem_objects, Memory *const *mem_objectsPacked,
cl_mem_migration_flags flags, cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueNDRangeKernel(cl_command_queue command_queue, cl_int EnqueueNDRangeKernel(CommandQueue *command_queuePacked,
cl_kernel kernel, Kernel *kernelPacked,
cl_uint work_dim, cl_uint work_dim,
const size_t *global_work_offset, const size_t *global_work_offset,
const size_t *global_work_size, const size_t *global_work_size,
const size_t *local_work_size, const size_t *local_work_size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueNativeKernel(cl_command_queue command_queue, cl_int EnqueueNativeKernel(CommandQueue *command_queuePacked,
void(CL_CALLBACK *user_func)(void *), void(CL_CALLBACK *user_func)(void *),
void *args, void *args,
size_t cb_args, size_t cb_args,
cl_uint num_mem_objects, cl_uint num_mem_objects,
const cl_mem *mem_list, Memory *const *mem_listPacked,
const void **args_mem_loc, const void **args_mem_loc,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueMarkerWithWaitList(cl_command_queue command_queue, cl_int EnqueueMarkerWithWaitList(CommandQueue *command_queuePacked,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueBarrierWithWaitList(cl_command_queue command_queue, cl_int EnqueueBarrierWithWaitList(CommandQueue *command_queuePacked,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueSVMFree(cl_command_queue command_queue, cl_int EnqueueSVMFree(CommandQueue *command_queuePacked,
cl_uint num_svm_pointers, cl_uint num_svm_pointers,
void *svm_pointers[], void *svm_pointers[],
void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue, void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue,
...@@ -491,88 +504,88 @@ cl_int EnqueueSVMFree(cl_command_queue command_queue, ...@@ -491,88 +504,88 @@ cl_int EnqueueSVMFree(cl_command_queue command_queue,
void *user_data), void *user_data),
void *user_data, void *user_data,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueSVMMemcpy(cl_command_queue command_queue, cl_int EnqueueSVMMemcpy(CommandQueue *command_queuePacked,
cl_bool blocking_copy, cl_bool blocking_copy,
void *dst_ptr, void *dst_ptr,
const void *src_ptr, const void *src_ptr,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueSVMMemFill(cl_command_queue command_queue, cl_int EnqueueSVMMemFill(CommandQueue *command_queuePacked,
void *svm_ptr, void *svm_ptr,
const void *pattern, const void *pattern,
size_t pattern_size, size_t pattern_size,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueSVMMap(cl_command_queue command_queue, cl_int EnqueueSVMMap(CommandQueue *command_queuePacked,
cl_bool blocking_map, cl_bool blocking_map,
cl_map_flags flags, cl_map_flags flags,
void *svm_ptr, void *svm_ptr,
size_t size, size_t size,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueSVMUnmap(cl_command_queue command_queue, cl_int EnqueueSVMUnmap(CommandQueue *command_queuePacked,
void *svm_ptr, void *svm_ptr,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
cl_int EnqueueSVMMigrateMem(cl_command_queue command_queue, cl_int EnqueueSVMMigrateMem(CommandQueue *command_queuePacked,
cl_uint num_svm_pointers, cl_uint num_svm_pointers,
const void **svm_pointers, const void **svm_pointers,
const size_t *sizes, const size_t *sizes,
cl_mem_migration_flags flags, cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
void *GetExtensionFunctionAddressForPlatform(cl_platform_id platform, const char *func_name); void *GetExtensionFunctionAddressForPlatform(Platform *platformPacked, const char *func_name);
cl_int SetCommandQueueProperty(cl_command_queue command_queue, cl_int SetCommandQueueProperty(CommandQueue *command_queuePacked,
cl_command_queue_properties properties, cl_command_queue_properties properties,
cl_bool enable, cl_bool enable,
cl_command_queue_properties *old_properties); cl_command_queue_properties *old_properties);
cl_mem CreateImage2D(cl_context context, Memory *CreateImage2D(Context *contextPacked,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, const cl_image_format *image_format,
size_t image_width, size_t image_width,
size_t image_height, size_t image_height,
size_t image_row_pitch, size_t image_row_pitch,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_mem CreateImage3D(cl_context context, Memory *CreateImage3D(Context *contextPacked,
cl_mem_flags flags, cl_mem_flags flags,
const cl_image_format *image_format, const cl_image_format *image_format,
size_t image_width, size_t image_width,
size_t image_height, size_t image_height,
size_t image_depth, size_t image_depth,
size_t image_row_pitch, size_t image_row_pitch,
size_t image_slice_pitch, size_t image_slice_pitch,
void *host_ptr, void *host_ptr,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int EnqueueMarker(cl_command_queue command_queue, cl_event *event); cl_int EnqueueMarker(CommandQueue *command_queuePacked, Event **eventPacked);
cl_int EnqueueWaitForEvents(cl_command_queue command_queue, cl_int EnqueueWaitForEvents(CommandQueue *command_queuePacked,
cl_uint num_events, cl_uint num_events,
const cl_event *event_list); Event *const *event_listPacked);
cl_int EnqueueBarrier(cl_command_queue command_queue); cl_int EnqueueBarrier(CommandQueue *command_queuePacked);
cl_int UnloadCompiler(); cl_int UnloadCompiler();
void *GetExtensionFunctionAddress(const char *func_name); void *GetExtensionFunctionAddress(const char *func_name);
cl_command_queue CreateCommandQueue(cl_context context, CommandQueue *CreateCommandQueue(Context *contextPacked,
cl_device_id device, Device *devicePacked,
cl_command_queue_properties properties, cl_command_queue_properties properties,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_sampler CreateSampler(cl_context context, Sampler *CreateSampler(Context *contextPacked,
cl_bool normalized_coords, cl_bool normalized_coords,
AddressingMode addressing_modePacked, AddressingMode addressing_modePacked,
FilterMode filter_modePacked, FilterMode filter_modePacked,
cl_int *errcode_ret); cl_int *errcode_ret);
cl_int EnqueueTask(cl_command_queue command_queue, cl_int EnqueueTask(CommandQueue *command_queuePacked,
cl_kernel kernel, Kernel *kernelPacked,
cl_uint num_events_in_wait_list, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, Event *const *event_wait_listPacked,
cl_event *event); Event **eventPacked);
} // namespace cl } // namespace cl
#endif // LIBGLESV2_CL_STUBS_AUTOGEN_H_ #endif // LIBGLESV2_CL_STUBS_AUTOGEN_H_
...@@ -27,9 +27,11 @@ cl_int CL_API_CALL CL_GetPlatformIDs(cl_uint num_entries, ...@@ -27,9 +27,11 @@ cl_int CL_API_CALL CL_GetPlatformIDs(cl_uint num_entries,
"num_entries = %u, platforms = 0x%016" PRIxPTR ", num_platforms = 0x%016" PRIxPTR "", "num_entries = %u, platforms = 0x%016" PRIxPTR ", num_platforms = 0x%016" PRIxPTR "",
num_entries, (uintptr_t)platforms, (uintptr_t)num_platforms); num_entries, (uintptr_t)platforms, (uintptr_t)num_platforms);
Platform **platformsPacked = PackParam<Platform **>(platforms);
// TODO: validate // TODO: validate
return cl::GetPlatformIDs(num_entries, platforms, num_platforms); return (cl::GetPlatformIDs(num_entries, platformsPacked, num_platforms));
} }
cl_int CL_API_CALL CL_GetPlatformInfo(cl_platform_id platform, cl_int CL_API_CALL CL_GetPlatformInfo(cl_platform_id platform,
...@@ -45,12 +47,13 @@ cl_int CL_API_CALL CL_GetPlatformInfo(cl_platform_id platform, ...@@ -45,12 +47,13 @@ cl_int CL_API_CALL CL_GetPlatformInfo(cl_platform_id platform,
(uintptr_t)platform, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)platform, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Platform *platformPacked = PackParam<Platform *>(platform);
PlatformInfo param_namePacked = PackParam<PlatformInfo>(param_name); PlatformInfo param_namePacked = PackParam<PlatformInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetPlatformInfo(platform, param_namePacked, param_value_size, param_value, return (cl::GetPlatformInfo(platformPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_GetDeviceIDs(cl_platform_id platform, cl_int CL_API_CALL CL_GetDeviceIDs(cl_platform_id platform,
...@@ -66,9 +69,12 @@ cl_int CL_API_CALL CL_GetDeviceIDs(cl_platform_id platform, ...@@ -66,9 +69,12 @@ cl_int CL_API_CALL CL_GetDeviceIDs(cl_platform_id platform,
(uintptr_t)platform, device_type, num_entries, (uintptr_t)devices, (uintptr_t)platform, device_type, num_entries, (uintptr_t)devices,
(uintptr_t)num_devices); (uintptr_t)num_devices);
Platform *platformPacked = PackParam<Platform *>(platform);
Device **devicesPacked = PackParam<Device **>(devices);
// TODO: validate // TODO: validate
return cl::GetDeviceIDs(platform, device_type, num_entries, devices, num_devices); return (cl::GetDeviceIDs(platformPacked, device_type, num_entries, devicesPacked, num_devices));
} }
cl_int CL_API_CALL CL_GetDeviceInfo(cl_device_id device, cl_int CL_API_CALL CL_GetDeviceInfo(cl_device_id device,
...@@ -84,12 +90,13 @@ cl_int CL_API_CALL CL_GetDeviceInfo(cl_device_id device, ...@@ -84,12 +90,13 @@ cl_int CL_API_CALL CL_GetDeviceInfo(cl_device_id device,
(uintptr_t)device, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)device, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Device *devicePacked = PackParam<Device *>(device);
DeviceInfo param_namePacked = PackParam<DeviceInfo>(param_name); DeviceInfo param_namePacked = PackParam<DeviceInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetDeviceInfo(device, param_namePacked, param_value_size, param_value, return (cl::GetDeviceInfo(devicePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_context CL_API_CALL CL_CreateContext(const cl_context_properties *properties, cl_context CL_API_CALL CL_CreateContext(const cl_context_properties *properties,
...@@ -109,9 +116,12 @@ cl_context CL_API_CALL CL_CreateContext(const cl_context_properties *properties, ...@@ -109,9 +116,12 @@ cl_context CL_API_CALL CL_CreateContext(const cl_context_properties *properties,
(uintptr_t)properties, num_devices, (uintptr_t)devices, (uintptr_t)pfn_notify, (uintptr_t)properties, num_devices, (uintptr_t)devices, (uintptr_t)pfn_notify,
(uintptr_t)user_data, (uintptr_t)errcode_ret); (uintptr_t)user_data, (uintptr_t)errcode_ret);
Device *const *devicesPacked = PackParam<Device *const *>(devices);
// TODO: validate // TODO: validate
return cl::CreateContext(properties, num_devices, devices, pfn_notify, user_data, errcode_ret); return UnpackParam<cl_context>(cl::CreateContext(properties, num_devices, devicesPacked,
pfn_notify, user_data, errcode_ret));
} }
cl_context CL_API_CALL cl_context CL_API_CALL
...@@ -132,25 +142,30 @@ CL_CreateContextFromType(const cl_context_properties *properties, ...@@ -132,25 +142,30 @@ CL_CreateContextFromType(const cl_context_properties *properties,
// TODO: validate // TODO: validate
return cl::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));
} }
cl_int CL_API_CALL CL_RetainContext(cl_context context) cl_int CL_API_CALL CL_RetainContext(cl_context context)
{ {
CL_EVENT(RetainContext, "context = 0x%016" PRIxPTR "", (uintptr_t)context); CL_EVENT(RetainContext, "context = 0x%016" PRIxPTR "", (uintptr_t)context);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::RetainContext(context); return (cl::RetainContext(contextPacked));
} }
cl_int CL_API_CALL CL_ReleaseContext(cl_context context) cl_int CL_API_CALL CL_ReleaseContext(cl_context context)
{ {
CL_EVENT(ReleaseContext, "context = 0x%016" PRIxPTR "", (uintptr_t)context); CL_EVENT(ReleaseContext, "context = 0x%016" PRIxPTR "", (uintptr_t)context);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::ReleaseContext(context); return (cl::ReleaseContext(contextPacked));
} }
cl_int CL_API_CALL CL_GetContextInfo(cl_context context, cl_int CL_API_CALL CL_GetContextInfo(cl_context context,
...@@ -166,30 +181,35 @@ cl_int CL_API_CALL CL_GetContextInfo(cl_context context, ...@@ -166,30 +181,35 @@ cl_int CL_API_CALL CL_GetContextInfo(cl_context context,
(uintptr_t)context, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)context, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Context *contextPacked = PackParam<Context *>(context);
ContextInfo param_namePacked = PackParam<ContextInfo>(param_name); ContextInfo param_namePacked = PackParam<ContextInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetContextInfo(context, param_namePacked, param_value_size, param_value, return (cl::GetContextInfo(contextPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_RetainCommandQueue(cl_command_queue command_queue) cl_int CL_API_CALL CL_RetainCommandQueue(cl_command_queue command_queue)
{ {
CL_EVENT(RetainCommandQueue, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue); CL_EVENT(RetainCommandQueue, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::RetainCommandQueue(command_queue); return (cl::RetainCommandQueue(command_queuePacked));
} }
cl_int CL_API_CALL CL_ReleaseCommandQueue(cl_command_queue command_queue) cl_int CL_API_CALL CL_ReleaseCommandQueue(cl_command_queue command_queue)
{ {
CL_EVENT(ReleaseCommandQueue, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue); CL_EVENT(ReleaseCommandQueue, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::ReleaseCommandQueue(command_queue); return (cl::ReleaseCommandQueue(command_queuePacked));
} }
cl_int CL_API_CALL CL_GetCommandQueueInfo(cl_command_queue command_queue, cl_int CL_API_CALL CL_GetCommandQueueInfo(cl_command_queue command_queue,
...@@ -205,12 +225,13 @@ cl_int CL_API_CALL CL_GetCommandQueueInfo(cl_command_queue command_queue, ...@@ -205,12 +225,13 @@ cl_int CL_API_CALL CL_GetCommandQueueInfo(cl_command_queue command_queue,
(uintptr_t)command_queue, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)command_queue, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
CommandQueueInfo param_namePacked = PackParam<CommandQueueInfo>(param_name); CommandQueueInfo param_namePacked = PackParam<CommandQueueInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetCommandQueueInfo(command_queue, param_namePacked, param_value_size, param_value, return (cl::GetCommandQueueInfo(command_queuePacked, param_namePacked, param_value_size,
param_value_size_ret); param_value, param_value_size_ret));
} }
cl_mem CL_API_CALL CL_CreateBuffer(cl_context context, cl_mem CL_API_CALL CL_CreateBuffer(cl_context context,
...@@ -224,27 +245,33 @@ cl_mem CL_API_CALL CL_CreateBuffer(cl_context context, ...@@ -224,27 +245,33 @@ cl_mem CL_API_CALL CL_CreateBuffer(cl_context context,
", errcode_ret = 0x%016" PRIxPTR "", ", errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)context, flags, size, (uintptr_t)host_ptr, (uintptr_t)errcode_ret); (uintptr_t)context, flags, size, (uintptr_t)host_ptr, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateBuffer(context, flags, size, host_ptr, errcode_ret); return UnpackParam<cl_mem>(cl::CreateBuffer(contextPacked, flags, size, host_ptr, errcode_ret));
} }
cl_int CL_API_CALL CL_RetainMemObject(cl_mem memobj) cl_int CL_API_CALL CL_RetainMemObject(cl_mem memobj)
{ {
CL_EVENT(RetainMemObject, "memobj = 0x%016" PRIxPTR "", (uintptr_t)memobj); CL_EVENT(RetainMemObject, "memobj = 0x%016" PRIxPTR "", (uintptr_t)memobj);
Memory *memobjPacked = PackParam<Memory *>(memobj);
// TODO: validate // TODO: validate
return cl::RetainMemObject(memobj); return (cl::RetainMemObject(memobjPacked));
} }
cl_int CL_API_CALL CL_ReleaseMemObject(cl_mem memobj) cl_int CL_API_CALL CL_ReleaseMemObject(cl_mem memobj)
{ {
CL_EVENT(ReleaseMemObject, "memobj = 0x%016" PRIxPTR "", (uintptr_t)memobj); CL_EVENT(ReleaseMemObject, "memobj = 0x%016" PRIxPTR "", (uintptr_t)memobj);
Memory *memobjPacked = PackParam<Memory *>(memobj);
// TODO: validate // TODO: validate
return cl::ReleaseMemObject(memobj); return (cl::ReleaseMemObject(memobjPacked));
} }
cl_int CL_API_CALL CL_GetSupportedImageFormats(cl_context context, cl_int CL_API_CALL CL_GetSupportedImageFormats(cl_context context,
...@@ -261,12 +288,13 @@ cl_int CL_API_CALL CL_GetSupportedImageFormats(cl_context context, ...@@ -261,12 +288,13 @@ cl_int CL_API_CALL CL_GetSupportedImageFormats(cl_context context,
(uintptr_t)context, flags, image_type, num_entries, (uintptr_t)image_formats, (uintptr_t)context, flags, image_type, num_entries, (uintptr_t)image_formats,
(uintptr_t)num_image_formats); (uintptr_t)num_image_formats);
Context *contextPacked = PackParam<Context *>(context);
MemObjectType image_typePacked = PackParam<MemObjectType>(image_type); MemObjectType image_typePacked = PackParam<MemObjectType>(image_type);
// TODO: validate // TODO: validate
return cl::GetSupportedImageFormats(context, flags, image_typePacked, num_entries, return (cl::GetSupportedImageFormats(contextPacked, flags, image_typePacked, num_entries,
image_formats, num_image_formats); image_formats, num_image_formats));
} }
cl_int CL_API_CALL CL_GetMemObjectInfo(cl_mem memobj, cl_int CL_API_CALL CL_GetMemObjectInfo(cl_mem memobj,
...@@ -282,12 +310,13 @@ cl_int CL_API_CALL CL_GetMemObjectInfo(cl_mem memobj, ...@@ -282,12 +310,13 @@ cl_int CL_API_CALL CL_GetMemObjectInfo(cl_mem memobj,
(uintptr_t)memobj, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)memobj, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Memory *memobjPacked = PackParam<Memory *>(memobj);
MemInfo param_namePacked = PackParam<MemInfo>(param_name); MemInfo param_namePacked = PackParam<MemInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetMemObjectInfo(memobj, param_namePacked, param_value_size, param_value, return (cl::GetMemObjectInfo(memobjPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_GetImageInfo(cl_mem image, cl_int CL_API_CALL CL_GetImageInfo(cl_mem image,
...@@ -303,30 +332,35 @@ cl_int CL_API_CALL CL_GetImageInfo(cl_mem image, ...@@ -303,30 +332,35 @@ cl_int CL_API_CALL CL_GetImageInfo(cl_mem image,
(uintptr_t)image, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)image, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Memory *imagePacked = PackParam<Memory *>(image);
ImageInfo param_namePacked = PackParam<ImageInfo>(param_name); ImageInfo param_namePacked = PackParam<ImageInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetImageInfo(image, param_namePacked, param_value_size, param_value, return (cl::GetImageInfo(imagePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_RetainSampler(cl_sampler sampler) cl_int CL_API_CALL CL_RetainSampler(cl_sampler sampler)
{ {
CL_EVENT(RetainSampler, "sampler = 0x%016" PRIxPTR "", (uintptr_t)sampler); CL_EVENT(RetainSampler, "sampler = 0x%016" PRIxPTR "", (uintptr_t)sampler);
Sampler *samplerPacked = PackParam<Sampler *>(sampler);
// TODO: validate // TODO: validate
return cl::RetainSampler(sampler); return (cl::RetainSampler(samplerPacked));
} }
cl_int CL_API_CALL CL_ReleaseSampler(cl_sampler sampler) cl_int CL_API_CALL CL_ReleaseSampler(cl_sampler sampler)
{ {
CL_EVENT(ReleaseSampler, "sampler = 0x%016" PRIxPTR "", (uintptr_t)sampler); CL_EVENT(ReleaseSampler, "sampler = 0x%016" PRIxPTR "", (uintptr_t)sampler);
Sampler *samplerPacked = PackParam<Sampler *>(sampler);
// TODO: validate // TODO: validate
return cl::ReleaseSampler(sampler); return (cl::ReleaseSampler(samplerPacked));
} }
cl_int CL_API_CALL CL_GetSamplerInfo(cl_sampler sampler, cl_int CL_API_CALL CL_GetSamplerInfo(cl_sampler sampler,
...@@ -342,12 +376,13 @@ cl_int CL_API_CALL CL_GetSamplerInfo(cl_sampler sampler, ...@@ -342,12 +376,13 @@ cl_int CL_API_CALL CL_GetSamplerInfo(cl_sampler sampler,
(uintptr_t)sampler, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)sampler, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Sampler *samplerPacked = PackParam<Sampler *>(sampler);
SamplerInfo param_namePacked = PackParam<SamplerInfo>(param_name); SamplerInfo param_namePacked = PackParam<SamplerInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetSamplerInfo(sampler, param_namePacked, param_value_size, param_value, return (cl::GetSamplerInfo(samplerPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_program CL_API_CALL CL_CreateProgramWithSource(cl_context context, cl_program CL_API_CALL CL_CreateProgramWithSource(cl_context context,
...@@ -362,9 +397,12 @@ cl_program CL_API_CALL CL_CreateProgramWithSource(cl_context context, ...@@ -362,9 +397,12 @@ cl_program CL_API_CALL CL_CreateProgramWithSource(cl_context context,
(uintptr_t)context, count, (uintptr_t)strings, (uintptr_t)lengths, (uintptr_t)context, count, (uintptr_t)strings, (uintptr_t)lengths,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateProgramWithSource(context, count, strings, lengths, errcode_ret); return UnpackParam<cl_program>(
cl::CreateProgramWithSource(contextPacked, count, strings, lengths, errcode_ret));
} }
cl_program CL_API_CALL CL_CreateProgramWithBinary(cl_context context, cl_program CL_API_CALL CL_CreateProgramWithBinary(cl_context context,
...@@ -382,28 +420,36 @@ cl_program CL_API_CALL CL_CreateProgramWithBinary(cl_context context, ...@@ -382,28 +420,36 @@ cl_program CL_API_CALL CL_CreateProgramWithBinary(cl_context context,
(uintptr_t)context, num_devices, (uintptr_t)device_list, (uintptr_t)lengths, (uintptr_t)context, num_devices, (uintptr_t)device_list, (uintptr_t)lengths,
(uintptr_t)binaries, (uintptr_t)binary_status, (uintptr_t)errcode_ret); (uintptr_t)binaries, (uintptr_t)binary_status, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
// TODO: validate // TODO: validate
return cl::CreateProgramWithBinary(context, num_devices, device_list, lengths, binaries, return UnpackParam<cl_program>(cl::CreateProgramWithBinary(contextPacked, num_devices,
binary_status, errcode_ret); device_listPacked, lengths, binaries,
binary_status, errcode_ret));
} }
cl_int CL_API_CALL CL_RetainProgram(cl_program program) cl_int CL_API_CALL CL_RetainProgram(cl_program program)
{ {
CL_EVENT(RetainProgram, "program = 0x%016" PRIxPTR "", (uintptr_t)program); CL_EVENT(RetainProgram, "program = 0x%016" PRIxPTR "", (uintptr_t)program);
Program *programPacked = PackParam<Program *>(program);
// TODO: validate // TODO: validate
return cl::RetainProgram(program); return (cl::RetainProgram(programPacked));
} }
cl_int CL_API_CALL CL_ReleaseProgram(cl_program program) cl_int CL_API_CALL CL_ReleaseProgram(cl_program program)
{ {
CL_EVENT(ReleaseProgram, "program = 0x%016" PRIxPTR "", (uintptr_t)program); CL_EVENT(ReleaseProgram, "program = 0x%016" PRIxPTR "", (uintptr_t)program);
Program *programPacked = PackParam<Program *>(program);
// TODO: validate // TODO: validate
return cl::ReleaseProgram(program); return (cl::ReleaseProgram(programPacked));
} }
cl_int CL_API_CALL CL_BuildProgram(cl_program program, cl_int CL_API_CALL CL_BuildProgram(cl_program program,
...@@ -421,9 +467,13 @@ cl_int CL_API_CALL CL_BuildProgram(cl_program program, ...@@ -421,9 +467,13 @@ cl_int CL_API_CALL CL_BuildProgram(cl_program program,
(uintptr_t)program, num_devices, (uintptr_t)device_list, (uintptr_t)options, (uintptr_t)program, num_devices, (uintptr_t)device_list, (uintptr_t)options,
(uintptr_t)pfn_notify, (uintptr_t)user_data); (uintptr_t)pfn_notify, (uintptr_t)user_data);
Program *programPacked = PackParam<Program *>(program);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
// TODO: validate // TODO: validate
return cl::BuildProgram(program, num_devices, device_list, options, pfn_notify, user_data); return (cl::BuildProgram(programPacked, num_devices, device_listPacked, options, pfn_notify,
user_data));
} }
cl_int CL_API_CALL CL_GetProgramInfo(cl_program program, cl_int CL_API_CALL CL_GetProgramInfo(cl_program program,
...@@ -439,12 +489,13 @@ cl_int CL_API_CALL CL_GetProgramInfo(cl_program program, ...@@ -439,12 +489,13 @@ cl_int CL_API_CALL CL_GetProgramInfo(cl_program program,
(uintptr_t)program, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)program, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Program *programPacked = PackParam<Program *>(program);
ProgramInfo param_namePacked = PackParam<ProgramInfo>(param_name); ProgramInfo param_namePacked = PackParam<ProgramInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetProgramInfo(program, param_namePacked, param_value_size, param_value, return (cl::GetProgramInfo(programPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_GetProgramBuildInfo(cl_program program, cl_int CL_API_CALL CL_GetProgramBuildInfo(cl_program program,
...@@ -461,12 +512,14 @@ cl_int CL_API_CALL CL_GetProgramBuildInfo(cl_program program, ...@@ -461,12 +512,14 @@ cl_int CL_API_CALL CL_GetProgramBuildInfo(cl_program program,
(uintptr_t)program, (uintptr_t)device, param_name, param_value_size, (uintptr_t)program, (uintptr_t)device, param_name, param_value_size,
(uintptr_t)param_value, (uintptr_t)param_value_size_ret); (uintptr_t)param_value, (uintptr_t)param_value_size_ret);
Program *programPacked = PackParam<Program *>(program);
Device *devicePacked = PackParam<Device *>(device);
ProgramBuildInfo param_namePacked = PackParam<ProgramBuildInfo>(param_name); ProgramBuildInfo param_namePacked = PackParam<ProgramBuildInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetProgramBuildInfo(program, device, param_namePacked, param_value_size, param_value, return (cl::GetProgramBuildInfo(programPacked, devicePacked, param_namePacked, param_value_size,
param_value_size_ret); param_value, param_value_size_ret));
} }
cl_kernel CL_API_CALL CL_CreateKernel(cl_program program, cl_kernel CL_API_CALL CL_CreateKernel(cl_program program,
...@@ -478,9 +531,11 @@ cl_kernel CL_API_CALL CL_CreateKernel(cl_program program, ...@@ -478,9 +531,11 @@ cl_kernel CL_API_CALL CL_CreateKernel(cl_program program,
", errcode_ret = 0x%016" PRIxPTR "", ", errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)program, (uintptr_t)kernel_name, (uintptr_t)errcode_ret); (uintptr_t)program, (uintptr_t)kernel_name, (uintptr_t)errcode_ret);
Program *programPacked = PackParam<Program *>(program);
// TODO: validate // TODO: validate
return cl::CreateKernel(program, kernel_name, errcode_ret); return UnpackParam<cl_kernel>(cl::CreateKernel(programPacked, kernel_name, errcode_ret));
} }
cl_int CL_API_CALL CL_CreateKernelsInProgram(cl_program program, cl_int CL_API_CALL CL_CreateKernelsInProgram(cl_program program,
...@@ -493,27 +548,34 @@ cl_int CL_API_CALL CL_CreateKernelsInProgram(cl_program program, ...@@ -493,27 +548,34 @@ cl_int CL_API_CALL CL_CreateKernelsInProgram(cl_program program,
", num_kernels_ret = 0x%016" PRIxPTR "", ", num_kernels_ret = 0x%016" PRIxPTR "",
(uintptr_t)program, num_kernels, (uintptr_t)kernels, (uintptr_t)num_kernels_ret); (uintptr_t)program, num_kernels, (uintptr_t)kernels, (uintptr_t)num_kernels_ret);
Program *programPacked = PackParam<Program *>(program);
Kernel **kernelsPacked = PackParam<Kernel **>(kernels);
// TODO: validate // TODO: validate
return cl::CreateKernelsInProgram(program, num_kernels, kernels, num_kernels_ret); return (cl::CreateKernelsInProgram(programPacked, num_kernels, kernelsPacked, num_kernels_ret));
} }
cl_int CL_API_CALL CL_RetainKernel(cl_kernel kernel) cl_int CL_API_CALL CL_RetainKernel(cl_kernel kernel)
{ {
CL_EVENT(RetainKernel, "kernel = 0x%016" PRIxPTR "", (uintptr_t)kernel); CL_EVENT(RetainKernel, "kernel = 0x%016" PRIxPTR "", (uintptr_t)kernel);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate // TODO: validate
return cl::RetainKernel(kernel); return (cl::RetainKernel(kernelPacked));
} }
cl_int CL_API_CALL CL_ReleaseKernel(cl_kernel kernel) cl_int CL_API_CALL CL_ReleaseKernel(cl_kernel kernel)
{ {
CL_EVENT(ReleaseKernel, "kernel = 0x%016" PRIxPTR "", (uintptr_t)kernel); CL_EVENT(ReleaseKernel, "kernel = 0x%016" PRIxPTR "", (uintptr_t)kernel);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate // TODO: validate
return cl::ReleaseKernel(kernel); return (cl::ReleaseKernel(kernelPacked));
} }
cl_int CL_API_CALL CL_SetKernelArg(cl_kernel kernel, cl_int CL_API_CALL CL_SetKernelArg(cl_kernel kernel,
...@@ -526,9 +588,11 @@ cl_int CL_API_CALL CL_SetKernelArg(cl_kernel kernel, ...@@ -526,9 +588,11 @@ cl_int CL_API_CALL CL_SetKernelArg(cl_kernel kernel,
", arg_index = %u, arg_size = %zu, arg_value = 0x%016" PRIxPTR "", ", arg_index = %u, arg_size = %zu, arg_value = 0x%016" PRIxPTR "",
(uintptr_t)kernel, arg_index, arg_size, (uintptr_t)arg_value); (uintptr_t)kernel, arg_index, arg_size, (uintptr_t)arg_value);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate // TODO: validate
return cl::SetKernelArg(kernel, arg_index, arg_size, arg_value); return (cl::SetKernelArg(kernelPacked, arg_index, arg_size, arg_value));
} }
cl_int CL_API_CALL CL_GetKernelInfo(cl_kernel kernel, cl_int CL_API_CALL CL_GetKernelInfo(cl_kernel kernel,
...@@ -544,12 +608,13 @@ cl_int CL_API_CALL CL_GetKernelInfo(cl_kernel kernel, ...@@ -544,12 +608,13 @@ cl_int CL_API_CALL CL_GetKernelInfo(cl_kernel kernel,
(uintptr_t)kernel, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)kernel, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
KernelInfo param_namePacked = PackParam<KernelInfo>(param_name); KernelInfo param_namePacked = PackParam<KernelInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetKernelInfo(kernel, param_namePacked, param_value_size, param_value, return (cl::GetKernelInfo(kernelPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_GetKernelWorkGroupInfo(cl_kernel kernel, cl_int CL_API_CALL CL_GetKernelWorkGroupInfo(cl_kernel kernel,
...@@ -566,12 +631,14 @@ cl_int CL_API_CALL CL_GetKernelWorkGroupInfo(cl_kernel kernel, ...@@ -566,12 +631,14 @@ cl_int CL_API_CALL CL_GetKernelWorkGroupInfo(cl_kernel kernel,
(uintptr_t)kernel, (uintptr_t)device, param_name, param_value_size, (uintptr_t)kernel, (uintptr_t)device, param_name, param_value_size,
(uintptr_t)param_value, (uintptr_t)param_value_size_ret); (uintptr_t)param_value, (uintptr_t)param_value_size_ret);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
Device *devicePacked = PackParam<Device *>(device);
KernelWorkGroupInfo param_namePacked = PackParam<KernelWorkGroupInfo>(param_name); KernelWorkGroupInfo param_namePacked = PackParam<KernelWorkGroupInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetKernelWorkGroupInfo(kernel, device, param_namePacked, param_value_size, return (cl::GetKernelWorkGroupInfo(kernelPacked, devicePacked, param_namePacked,
param_value, param_value_size_ret); 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) cl_int CL_API_CALL CL_WaitForEvents(cl_uint num_events, const cl_event *event_list)
...@@ -579,9 +646,11 @@ cl_int CL_API_CALL CL_WaitForEvents(cl_uint num_events, const cl_event *event_li ...@@ -579,9 +646,11 @@ cl_int CL_API_CALL CL_WaitForEvents(cl_uint num_events, const cl_event *event_li
CL_EVENT(WaitForEvents, "num_events = %u, event_list = 0x%016" PRIxPTR "", num_events, CL_EVENT(WaitForEvents, "num_events = %u, event_list = 0x%016" PRIxPTR "", num_events,
(uintptr_t)event_list); (uintptr_t)event_list);
Event *const *event_listPacked = PackParam<Event *const *>(event_list);
// TODO: validate // TODO: validate
return cl::WaitForEvents(num_events, event_list); return (cl::WaitForEvents(num_events, event_listPacked));
} }
cl_int CL_API_CALL CL_GetEventInfo(cl_event event, cl_int CL_API_CALL CL_GetEventInfo(cl_event event,
...@@ -597,30 +666,35 @@ cl_int CL_API_CALL CL_GetEventInfo(cl_event event, ...@@ -597,30 +666,35 @@ cl_int CL_API_CALL CL_GetEventInfo(cl_event event,
(uintptr_t)event, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)event, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Event *eventPacked = PackParam<Event *>(event);
EventInfo param_namePacked = PackParam<EventInfo>(param_name); EventInfo param_namePacked = PackParam<EventInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetEventInfo(event, param_namePacked, param_value_size, param_value, return (cl::GetEventInfo(eventPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_RetainEvent(cl_event event) cl_int CL_API_CALL CL_RetainEvent(cl_event event)
{ {
CL_EVENT(RetainEvent, "event = 0x%016" PRIxPTR "", (uintptr_t)event); CL_EVENT(RetainEvent, "event = 0x%016" PRIxPTR "", (uintptr_t)event);
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate // TODO: validate
return cl::RetainEvent(event); return (cl::RetainEvent(eventPacked));
} }
cl_int CL_API_CALL CL_ReleaseEvent(cl_event event) cl_int CL_API_CALL CL_ReleaseEvent(cl_event event)
{ {
CL_EVENT(ReleaseEvent, "event = 0x%016" PRIxPTR "", (uintptr_t)event); CL_EVENT(ReleaseEvent, "event = 0x%016" PRIxPTR "", (uintptr_t)event);
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate // TODO: validate
return cl::ReleaseEvent(event); return (cl::ReleaseEvent(eventPacked));
} }
cl_int CL_API_CALL CL_GetEventProfilingInfo(cl_event event, cl_int CL_API_CALL CL_GetEventProfilingInfo(cl_event event,
...@@ -636,30 +710,35 @@ cl_int CL_API_CALL CL_GetEventProfilingInfo(cl_event event, ...@@ -636,30 +710,35 @@ cl_int CL_API_CALL CL_GetEventProfilingInfo(cl_event event,
(uintptr_t)event, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)event, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Event *eventPacked = PackParam<Event *>(event);
ProfilingInfo param_namePacked = PackParam<ProfilingInfo>(param_name); ProfilingInfo param_namePacked = PackParam<ProfilingInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetEventProfilingInfo(event, param_namePacked, param_value_size, param_value, return (cl::GetEventProfilingInfo(eventPacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_Flush(cl_command_queue command_queue) cl_int CL_API_CALL CL_Flush(cl_command_queue command_queue)
{ {
CL_EVENT(Flush, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue); CL_EVENT(Flush, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::Flush(command_queue); return (cl::Flush(command_queuePacked));
} }
cl_int CL_API_CALL CL_Finish(cl_command_queue command_queue) cl_int CL_API_CALL CL_Finish(cl_command_queue command_queue)
{ {
CL_EVENT(Finish, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue); CL_EVENT(Finish, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::Finish(command_queue); return (cl::Finish(command_queuePacked));
} }
cl_int CL_API_CALL CL_EnqueueReadBuffer(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueReadBuffer(cl_command_queue command_queue,
...@@ -680,10 +759,16 @@ cl_int CL_API_CALL CL_EnqueueReadBuffer(cl_command_queue command_queue, ...@@ -680,10 +759,16 @@ cl_int CL_API_CALL CL_EnqueueReadBuffer(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)buffer, blocking_read, offset, size, (uintptr_t)command_queue, (uintptr_t)buffer, blocking_read, offset, size,
(uintptr_t)ptr, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)ptr, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *bufferPacked = PackParam<Memory *>(buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueReadBuffer(command_queue, buffer, blocking_read, offset, size, ptr, return (cl::EnqueueReadBuffer(command_queuePacked, bufferPacked, blocking_read, offset, size,
num_events_in_wait_list, event_wait_list, event); ptr, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueWriteBuffer(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueWriteBuffer(cl_command_queue command_queue,
...@@ -704,10 +789,16 @@ cl_int CL_API_CALL CL_EnqueueWriteBuffer(cl_command_queue command_queue, ...@@ -704,10 +789,16 @@ cl_int CL_API_CALL CL_EnqueueWriteBuffer(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)buffer, blocking_write, offset, size, (uintptr_t)command_queue, (uintptr_t)buffer, blocking_write, offset, size,
(uintptr_t)ptr, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)ptr, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *bufferPacked = PackParam<Memory *>(buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueWriteBuffer(command_queue, buffer, blocking_write, offset, size, ptr, return (cl::EnqueueWriteBuffer(command_queuePacked, bufferPacked, blocking_write, offset, size,
num_events_in_wait_list, event_wait_list, event); ptr, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueCopyBuffer(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueCopyBuffer(cl_command_queue command_queue,
...@@ -729,10 +820,17 @@ cl_int CL_API_CALL CL_EnqueueCopyBuffer(cl_command_queue command_queue, ...@@ -729,10 +820,17 @@ cl_int CL_API_CALL CL_EnqueueCopyBuffer(cl_command_queue command_queue,
dst_offset, size, num_events_in_wait_list, (uintptr_t)event_wait_list, dst_offset, size, num_events_in_wait_list, (uintptr_t)event_wait_list,
(uintptr_t)event); (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *src_bufferPacked = PackParam<Memory *>(src_buffer);
Memory *dst_bufferPacked = PackParam<Memory *>(dst_buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueCopyBuffer(command_queue, src_buffer, dst_buffer, src_offset, dst_offset, return (cl::EnqueueCopyBuffer(command_queuePacked, src_bufferPacked, dst_bufferPacked,
size, num_events_in_wait_list, event_wait_list, event); 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, cl_int CL_API_CALL CL_EnqueueReadImage(cl_command_queue command_queue,
...@@ -757,10 +855,16 @@ cl_int CL_API_CALL CL_EnqueueReadImage(cl_command_queue command_queue, ...@@ -757,10 +855,16 @@ cl_int CL_API_CALL CL_EnqueueReadImage(cl_command_queue command_queue,
(uintptr_t)region, row_pitch, slice_pitch, (uintptr_t)ptr, num_events_in_wait_list, (uintptr_t)region, row_pitch, slice_pitch, (uintptr_t)ptr, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *imagePacked = PackParam<Memory *>(image);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueReadImage(command_queue, image, blocking_read, origin, region, row_pitch, return (cl::EnqueueReadImage(command_queuePacked, imagePacked, blocking_read, origin, region,
slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event); 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, cl_int CL_API_CALL CL_EnqueueWriteImage(cl_command_queue command_queue,
...@@ -785,11 +889,16 @@ cl_int CL_API_CALL CL_EnqueueWriteImage(cl_command_queue command_queue, ...@@ -785,11 +889,16 @@ cl_int CL_API_CALL CL_EnqueueWriteImage(cl_command_queue command_queue,
(uintptr_t)region, input_row_pitch, input_slice_pitch, (uintptr_t)ptr, (uintptr_t)region, input_row_pitch, input_slice_pitch, (uintptr_t)ptr,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *imagePacked = PackParam<Memory *>(image);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueWriteImage(command_queue, image, blocking_write, origin, region, return (cl::EnqueueWriteImage(command_queuePacked, imagePacked, blocking_write, origin, region,
input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list,
event_wait_list, event); event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueCopyImage(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueCopyImage(cl_command_queue command_queue,
...@@ -812,10 +921,17 @@ cl_int CL_API_CALL CL_EnqueueCopyImage(cl_command_queue command_queue, ...@@ -812,10 +921,17 @@ cl_int CL_API_CALL CL_EnqueueCopyImage(cl_command_queue command_queue,
(uintptr_t)src_origin, (uintptr_t)dst_origin, (uintptr_t)region, (uintptr_t)src_origin, (uintptr_t)dst_origin, (uintptr_t)region,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *src_imagePacked = PackParam<Memory *>(src_image);
Memory *dst_imagePacked = PackParam<Memory *>(dst_image);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueCopyImage(command_queue, src_image, dst_image, src_origin, dst_origin, region, return (cl::EnqueueCopyImage(command_queuePacked, src_imagePacked, dst_imagePacked, src_origin,
num_events_in_wait_list, event_wait_list, event); dst_origin, region, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueCopyImageToBuffer(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueCopyImageToBuffer(cl_command_queue command_queue,
...@@ -838,11 +954,17 @@ cl_int CL_API_CALL CL_EnqueueCopyImageToBuffer(cl_command_queue command_queue, ...@@ -838,11 +954,17 @@ cl_int CL_API_CALL CL_EnqueueCopyImageToBuffer(cl_command_queue command_queue,
(uintptr_t)src_origin, (uintptr_t)region, dst_offset, num_events_in_wait_list, (uintptr_t)src_origin, (uintptr_t)region, dst_offset, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *src_imagePacked = PackParam<Memory *>(src_image);
Memory *dst_bufferPacked = PackParam<Memory *>(dst_buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueCopyImageToBuffer(command_queue, src_image, dst_buffer, src_origin, region, return (cl::EnqueueCopyImageToBuffer(command_queuePacked, src_imagePacked, dst_bufferPacked,
dst_offset, num_events_in_wait_list, event_wait_list, src_origin, region, dst_offset, num_events_in_wait_list,
event); event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueCopyBufferToImage(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueCopyBufferToImage(cl_command_queue command_queue,
...@@ -865,11 +987,17 @@ cl_int CL_API_CALL CL_EnqueueCopyBufferToImage(cl_command_queue command_queue, ...@@ -865,11 +987,17 @@ cl_int CL_API_CALL CL_EnqueueCopyBufferToImage(cl_command_queue command_queue,
(uintptr_t)dst_origin, (uintptr_t)region, num_events_in_wait_list, (uintptr_t)dst_origin, (uintptr_t)region, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *src_bufferPacked = PackParam<Memory *>(src_buffer);
Memory *dst_imagePacked = PackParam<Memory *>(dst_image);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueCopyBufferToImage(command_queue, src_buffer, dst_image, src_offset, return (cl::EnqueueCopyBufferToImage(command_queuePacked, src_bufferPacked, dst_imagePacked,
dst_origin, region, num_events_in_wait_list, src_offset, dst_origin, region, num_events_in_wait_list,
event_wait_list, event); event_wait_listPacked, eventPacked));
} }
void *CL_API_CALL CL_EnqueueMapBuffer(cl_command_queue command_queue, void *CL_API_CALL CL_EnqueueMapBuffer(cl_command_queue command_queue,
...@@ -892,10 +1020,16 @@ void *CL_API_CALL CL_EnqueueMapBuffer(cl_command_queue command_queue, ...@@ -892,10 +1020,16 @@ void *CL_API_CALL CL_EnqueueMapBuffer(cl_command_queue command_queue,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *bufferPacked = PackParam<Memory *>(buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueMapBuffer(command_queue, buffer, blocking_map, map_flags, offset, size, return (cl::EnqueueMapBuffer(command_queuePacked, bufferPacked, blocking_map, map_flags, offset,
num_events_in_wait_list, event_wait_list, event, errcode_ret); size, num_events_in_wait_list, event_wait_listPacked, eventPacked,
errcode_ret));
} }
void *CL_API_CALL CL_EnqueueMapImage(cl_command_queue command_queue, void *CL_API_CALL CL_EnqueueMapImage(cl_command_queue command_queue,
...@@ -923,11 +1057,16 @@ void *CL_API_CALL CL_EnqueueMapImage(cl_command_queue command_queue, ...@@ -923,11 +1057,16 @@ void *CL_API_CALL CL_EnqueueMapImage(cl_command_queue command_queue,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *imagePacked = PackParam<Memory *>(image);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueMapImage(command_queue, image, blocking_map, map_flags, origin, region, return (cl::EnqueueMapImage(command_queuePacked, imagePacked, blocking_map, map_flags, origin,
image_row_pitch, image_slice_pitch, num_events_in_wait_list, region, image_row_pitch, image_slice_pitch, num_events_in_wait_list,
event_wait_list, event, errcode_ret); event_wait_listPacked, eventPacked, errcode_ret));
} }
cl_int CL_API_CALL CL_EnqueueUnmapMemObject(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueUnmapMemObject(cl_command_queue command_queue,
...@@ -945,10 +1084,15 @@ cl_int CL_API_CALL CL_EnqueueUnmapMemObject(cl_command_queue command_queue, ...@@ -945,10 +1084,15 @@ cl_int CL_API_CALL CL_EnqueueUnmapMemObject(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)memobj, (uintptr_t)mapped_ptr, (uintptr_t)command_queue, (uintptr_t)memobj, (uintptr_t)mapped_ptr,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *memobjPacked = PackParam<Memory *>(memobj);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueUnmapMemObject(command_queue, memobj, mapped_ptr, num_events_in_wait_list, return (cl::EnqueueUnmapMemObject(command_queuePacked, memobjPacked, mapped_ptr,
event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueNDRangeKernel(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueNDRangeKernel(cl_command_queue command_queue,
...@@ -971,11 +1115,16 @@ cl_int CL_API_CALL CL_EnqueueNDRangeKernel(cl_command_queue command_queue, ...@@ -971,11 +1115,16 @@ cl_int CL_API_CALL CL_EnqueueNDRangeKernel(cl_command_queue command_queue,
(uintptr_t)global_work_size, (uintptr_t)local_work_size, num_events_in_wait_list, (uintptr_t)global_work_size, (uintptr_t)local_work_size, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueNDRangeKernel(command_queue, kernel, work_dim, global_work_offset, return (cl::EnqueueNDRangeKernel(command_queuePacked, kernelPacked, work_dim,
global_work_size, local_work_size, num_events_in_wait_list, global_work_offset, global_work_size, local_work_size,
event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueNativeKernel(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueNativeKernel(cl_command_queue command_queue,
...@@ -1000,11 +1149,16 @@ cl_int CL_API_CALL CL_EnqueueNativeKernel(cl_command_queue command_queue, ...@@ -1000,11 +1149,16 @@ cl_int CL_API_CALL CL_EnqueueNativeKernel(cl_command_queue command_queue,
num_mem_objects, (uintptr_t)mem_list, (uintptr_t)args_mem_loc, num_events_in_wait_list, num_mem_objects, (uintptr_t)mem_list, (uintptr_t)args_mem_loc, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *const *mem_listPacked = PackParam<Memory *const *>(mem_list);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueNativeKernel(command_queue, user_func, args, cb_args, num_mem_objects, return (cl::EnqueueNativeKernel(command_queuePacked, user_func, args, cb_args, num_mem_objects,
mem_list, args_mem_loc, num_events_in_wait_list, event_wait_list, mem_listPacked, args_mem_loc, num_events_in_wait_list,
event); event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_SetCommandQueueProperty(cl_command_queue command_queue, cl_int CL_API_CALL CL_SetCommandQueueProperty(cl_command_queue command_queue,
...@@ -1017,9 +1171,11 @@ cl_int CL_API_CALL CL_SetCommandQueueProperty(cl_command_queue command_queue, ...@@ -1017,9 +1171,11 @@ cl_int CL_API_CALL CL_SetCommandQueueProperty(cl_command_queue command_queue,
", properties = %lu, enable = %u, old_properties = 0x%016" PRIxPTR "", ", properties = %lu, enable = %u, old_properties = 0x%016" PRIxPTR "",
(uintptr_t)command_queue, properties, enable, (uintptr_t)old_properties); (uintptr_t)command_queue, properties, enable, (uintptr_t)old_properties);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::SetCommandQueueProperty(command_queue, properties, enable, old_properties); return (cl::SetCommandQueueProperty(command_queuePacked, properties, enable, old_properties));
} }
cl_mem CL_API_CALL CL_CreateImage2D(cl_context context, cl_mem CL_API_CALL CL_CreateImage2D(cl_context context,
...@@ -1039,10 +1195,13 @@ cl_mem CL_API_CALL CL_CreateImage2D(cl_context context, ...@@ -1039,10 +1195,13 @@ cl_mem CL_API_CALL CL_CreateImage2D(cl_context context,
(uintptr_t)context, flags, (uintptr_t)image_format, image_width, image_height, (uintptr_t)context, flags, (uintptr_t)image_format, image_width, image_height,
image_row_pitch, (uintptr_t)host_ptr, (uintptr_t)errcode_ret); image_row_pitch, (uintptr_t)host_ptr, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateImage2D(context, flags, image_format, image_width, image_height, return UnpackParam<cl_mem>(cl::CreateImage2D(contextPacked, flags, image_format, image_width,
image_row_pitch, host_ptr, errcode_ret); image_height, image_row_pitch, host_ptr,
errcode_ret));
} }
cl_mem CL_API_CALL CL_CreateImage3D(cl_context context, cl_mem CL_API_CALL CL_CreateImage3D(cl_context context,
...@@ -1064,10 +1223,13 @@ cl_mem CL_API_CALL CL_CreateImage3D(cl_context context, ...@@ -1064,10 +1223,13 @@ cl_mem CL_API_CALL CL_CreateImage3D(cl_context context,
(uintptr_t)context, flags, (uintptr_t)image_format, image_width, image_height, image_depth, (uintptr_t)context, flags, (uintptr_t)image_format, image_width, image_height, image_depth,
image_row_pitch, image_slice_pitch, (uintptr_t)host_ptr, (uintptr_t)errcode_ret); image_row_pitch, image_slice_pitch, (uintptr_t)host_ptr, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateImage3D(context, flags, image_format, image_width, image_height, image_depth, return UnpackParam<cl_mem>(cl::CreateImage3D(contextPacked, flags, image_format, image_width,
image_row_pitch, image_slice_pitch, host_ptr, errcode_ret); 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) cl_int CL_API_CALL CL_EnqueueMarker(cl_command_queue command_queue, cl_event *event)
...@@ -1075,9 +1237,12 @@ cl_int CL_API_CALL CL_EnqueueMarker(cl_command_queue command_queue, cl_event *ev ...@@ -1075,9 +1237,12 @@ cl_int CL_API_CALL CL_EnqueueMarker(cl_command_queue command_queue, cl_event *ev
CL_EVENT(EnqueueMarker, "command_queue = 0x%016" PRIxPTR ", event = 0x%016" PRIxPTR "", CL_EVENT(EnqueueMarker, "command_queue = 0x%016" PRIxPTR ", event = 0x%016" PRIxPTR "",
(uintptr_t)command_queue, (uintptr_t)event); (uintptr_t)command_queue, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueMarker(command_queue, event); return (cl::EnqueueMarker(command_queuePacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueWaitForEvents(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueWaitForEvents(cl_command_queue command_queue,
...@@ -1088,18 +1253,23 @@ cl_int CL_API_CALL CL_EnqueueWaitForEvents(cl_command_queue command_queue, ...@@ -1088,18 +1253,23 @@ cl_int CL_API_CALL CL_EnqueueWaitForEvents(cl_command_queue command_queue,
"command_queue = 0x%016" PRIxPTR ", num_events = %u, event_list = 0x%016" PRIxPTR "", "command_queue = 0x%016" PRIxPTR ", num_events = %u, event_list = 0x%016" PRIxPTR "",
(uintptr_t)command_queue, num_events, (uintptr_t)event_list); (uintptr_t)command_queue, num_events, (uintptr_t)event_list);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_listPacked = PackParam<Event *const *>(event_list);
// TODO: validate // TODO: validate
return cl::EnqueueWaitForEvents(command_queue, num_events, event_list); return (cl::EnqueueWaitForEvents(command_queuePacked, num_events, event_listPacked));
} }
cl_int CL_API_CALL CL_EnqueueBarrier(cl_command_queue command_queue) cl_int CL_API_CALL CL_EnqueueBarrier(cl_command_queue command_queue)
{ {
CL_EVENT(EnqueueBarrier, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue); CL_EVENT(EnqueueBarrier, "command_queue = 0x%016" PRIxPTR "", (uintptr_t)command_queue);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::EnqueueBarrier(command_queue); return (cl::EnqueueBarrier(command_queuePacked));
} }
cl_int CL_API_CALL CL_UnloadCompiler() cl_int CL_API_CALL CL_UnloadCompiler()
...@@ -1108,7 +1278,7 @@ cl_int CL_API_CALL CL_UnloadCompiler() ...@@ -1108,7 +1278,7 @@ cl_int CL_API_CALL CL_UnloadCompiler()
// TODO: validate // TODO: validate
return cl::UnloadCompiler(); return (cl::UnloadCompiler());
} }
void *CL_API_CALL CL_GetExtensionFunctionAddress(const char *func_name) void *CL_API_CALL CL_GetExtensionFunctionAddress(const char *func_name)
...@@ -1117,7 +1287,7 @@ void *CL_API_CALL CL_GetExtensionFunctionAddress(const char *func_name) ...@@ -1117,7 +1287,7 @@ void *CL_API_CALL CL_GetExtensionFunctionAddress(const char *func_name)
// TODO: validate // TODO: validate
return cl::GetExtensionFunctionAddress(func_name); return (cl::GetExtensionFunctionAddress(func_name));
} }
cl_command_queue CL_API_CALL CL_CreateCommandQueue(cl_context context, cl_command_queue CL_API_CALL CL_CreateCommandQueue(cl_context context,
...@@ -1130,9 +1300,13 @@ cl_command_queue CL_API_CALL CL_CreateCommandQueue(cl_context context, ...@@ -1130,9 +1300,13 @@ cl_command_queue CL_API_CALL CL_CreateCommandQueue(cl_context context,
", properties = %lu, errcode_ret = 0x%016" PRIxPTR "", ", properties = %lu, errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)device, properties, (uintptr_t)errcode_ret); (uintptr_t)context, (uintptr_t)device, properties, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate // TODO: validate
return cl::CreateCommandQueue(context, device, properties, errcode_ret); return UnpackParam<cl_command_queue>(
cl::CreateCommandQueue(contextPacked, devicePacked, properties, errcode_ret));
} }
cl_sampler CL_API_CALL CL_CreateSampler(cl_context context, cl_sampler CL_API_CALL CL_CreateSampler(cl_context context,
...@@ -1148,13 +1322,14 @@ cl_sampler CL_API_CALL CL_CreateSampler(cl_context context, ...@@ -1148,13 +1322,14 @@ cl_sampler CL_API_CALL CL_CreateSampler(cl_context context,
(uintptr_t)context, normalized_coords, addressing_mode, filter_mode, (uintptr_t)context, normalized_coords, addressing_mode, filter_mode,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
AddressingMode addressing_modePacked = PackParam<AddressingMode>(addressing_mode); AddressingMode addressing_modePacked = PackParam<AddressingMode>(addressing_mode);
FilterMode filter_modePacked = PackParam<FilterMode>(filter_mode); FilterMode filter_modePacked = PackParam<FilterMode>(filter_mode);
// TODO: validate // TODO: validate
return cl::CreateSampler(context, normalized_coords, addressing_modePacked, filter_modePacked, return UnpackParam<cl_sampler>(cl::CreateSampler(
errcode_ret); contextPacked, normalized_coords, addressing_modePacked, filter_modePacked, errcode_ret));
} }
cl_int CL_API_CALL CL_EnqueueTask(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueTask(cl_command_queue command_queue,
...@@ -1170,9 +1345,15 @@ cl_int CL_API_CALL CL_EnqueueTask(cl_command_queue command_queue, ...@@ -1170,9 +1345,15 @@ cl_int CL_API_CALL CL_EnqueueTask(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)kernel, num_events_in_wait_list, (uintptr_t)command_queue, (uintptr_t)kernel, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueTask(command_queue, kernel, num_events_in_wait_list, event_wait_list, event); return (cl::EnqueueTask(command_queuePacked, kernelPacked, num_events_in_wait_list,
event_wait_listPacked, eventPacked));
} }
// CL 1.1 // CL 1.1
...@@ -1189,9 +1370,12 @@ cl_mem CL_API_CALL CL_CreateSubBuffer(cl_mem buffer, ...@@ -1189,9 +1370,12 @@ cl_mem CL_API_CALL CL_CreateSubBuffer(cl_mem buffer,
(uintptr_t)buffer, flags, buffer_create_type, (uintptr_t)buffer_create_info, (uintptr_t)buffer, flags, buffer_create_type, (uintptr_t)buffer_create_info,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
Memory *bufferPacked = PackParam<Memory *>(buffer);
// TODO: validate // TODO: validate
return cl::CreateSubBuffer(buffer, 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));
} }
cl_int CL_API_CALL CL_SetMemObjectDestructorCallback(cl_mem memobj, cl_int CL_API_CALL CL_SetMemObjectDestructorCallback(cl_mem memobj,
...@@ -1204,9 +1388,11 @@ cl_int CL_API_CALL CL_SetMemObjectDestructorCallback(cl_mem memobj, ...@@ -1204,9 +1388,11 @@ cl_int CL_API_CALL CL_SetMemObjectDestructorCallback(cl_mem memobj,
", user_data = 0x%016" PRIxPTR "", ", user_data = 0x%016" PRIxPTR "",
(uintptr_t)memobj, (uintptr_t)pfn_notify, (uintptr_t)user_data); (uintptr_t)memobj, (uintptr_t)pfn_notify, (uintptr_t)user_data);
Memory *memobjPacked = PackParam<Memory *>(memobj);
// TODO: validate // TODO: validate
return cl::SetMemObjectDestructorCallback(memobj, pfn_notify, user_data); return (cl::SetMemObjectDestructorCallback(memobjPacked, pfn_notify, user_data));
} }
cl_event CL_API_CALL CL_CreateUserEvent(cl_context context, cl_int *errcode_ret) cl_event CL_API_CALL CL_CreateUserEvent(cl_context context, cl_int *errcode_ret)
...@@ -1214,9 +1400,11 @@ cl_event CL_API_CALL CL_CreateUserEvent(cl_context context, cl_int *errcode_ret) ...@@ -1214,9 +1400,11 @@ cl_event CL_API_CALL CL_CreateUserEvent(cl_context context, cl_int *errcode_ret)
CL_EVENT(CreateUserEvent, "context = 0x%016" PRIxPTR ", errcode_ret = 0x%016" PRIxPTR "", CL_EVENT(CreateUserEvent, "context = 0x%016" PRIxPTR ", errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)errcode_ret); (uintptr_t)context, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateUserEvent(context, errcode_ret); return UnpackParam<cl_event>(cl::CreateUserEvent(contextPacked, errcode_ret));
} }
cl_int CL_API_CALL CL_SetUserEventStatus(cl_event event, cl_int execution_status) cl_int CL_API_CALL CL_SetUserEventStatus(cl_event event, cl_int execution_status)
...@@ -1224,9 +1412,11 @@ cl_int CL_API_CALL CL_SetUserEventStatus(cl_event event, cl_int execution_status ...@@ -1224,9 +1412,11 @@ cl_int CL_API_CALL CL_SetUserEventStatus(cl_event event, cl_int execution_status
CL_EVENT(SetUserEventStatus, "event = 0x%016" PRIxPTR ", execution_status = %d", CL_EVENT(SetUserEventStatus, "event = 0x%016" PRIxPTR ", execution_status = %d",
(uintptr_t)event, execution_status); (uintptr_t)event, execution_status);
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate // TODO: validate
return cl::SetUserEventStatus(event, execution_status); return (cl::SetUserEventStatus(eventPacked, execution_status));
} }
cl_int CL_API_CALL CL_SetEventCallback(cl_event event, cl_int CL_API_CALL CL_SetEventCallback(cl_event event,
...@@ -1242,9 +1432,11 @@ cl_int CL_API_CALL CL_SetEventCallback(cl_event event, ...@@ -1242,9 +1432,11 @@ cl_int CL_API_CALL CL_SetEventCallback(cl_event event,
", user_data = 0x%016" PRIxPTR "", ", user_data = 0x%016" PRIxPTR "",
(uintptr_t)event, command_exec_callback_type, (uintptr_t)pfn_notify, (uintptr_t)user_data); (uintptr_t)event, command_exec_callback_type, (uintptr_t)pfn_notify, (uintptr_t)user_data);
Event *eventPacked = PackParam<Event *>(event);
// TODO: validate // TODO: validate
return cl::SetEventCallback(event, command_exec_callback_type, pfn_notify, user_data); return (cl::SetEventCallback(eventPacked, command_exec_callback_type, pfn_notify, user_data));
} }
cl_int CL_API_CALL CL_EnqueueReadBufferRect(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueReadBufferRect(cl_command_queue command_queue,
...@@ -1275,12 +1467,17 @@ cl_int CL_API_CALL CL_EnqueueReadBufferRect(cl_command_queue command_queue, ...@@ -1275,12 +1467,17 @@ cl_int CL_API_CALL CL_EnqueueReadBufferRect(cl_command_queue command_queue,
host_row_pitch, host_slice_pitch, (uintptr_t)ptr, num_events_in_wait_list, host_row_pitch, host_slice_pitch, (uintptr_t)ptr, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *bufferPacked = PackParam<Memory *>(buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueReadBufferRect(command_queue, buffer, blocking_read, buffer_origin, return (cl::EnqueueReadBufferRect(command_queuePacked, bufferPacked, blocking_read,
host_origin, region, buffer_row_pitch, buffer_slice_pitch, buffer_origin, host_origin, region, buffer_row_pitch,
host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr,
event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueWriteBufferRect(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueWriteBufferRect(cl_command_queue command_queue,
...@@ -1311,12 +1508,17 @@ cl_int CL_API_CALL CL_EnqueueWriteBufferRect(cl_command_queue command_queue, ...@@ -1311,12 +1508,17 @@ cl_int CL_API_CALL CL_EnqueueWriteBufferRect(cl_command_queue command_queue,
host_row_pitch, host_slice_pitch, (uintptr_t)ptr, num_events_in_wait_list, host_row_pitch, host_slice_pitch, (uintptr_t)ptr, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *bufferPacked = PackParam<Memory *>(buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueWriteBufferRect(command_queue, buffer, blocking_write, buffer_origin, return (cl::EnqueueWriteBufferRect(
host_origin, region, buffer_row_pitch, buffer_slice_pitch, command_queuePacked, bufferPacked, blocking_write, buffer_origin, host_origin, region,
host_row_pitch, host_slice_pitch, ptr, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr,
num_events_in_wait_list, event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueCopyBufferRect(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueCopyBufferRect(cl_command_queue command_queue,
...@@ -1345,12 +1547,18 @@ cl_int CL_API_CALL CL_EnqueueCopyBufferRect(cl_command_queue command_queue, ...@@ -1345,12 +1547,18 @@ cl_int CL_API_CALL CL_EnqueueCopyBufferRect(cl_command_queue command_queue,
src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *src_bufferPacked = PackParam<Memory *>(src_buffer);
Memory *dst_bufferPacked = PackParam<Memory *>(dst_buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, src_origin, dst_origin, return (cl::EnqueueCopyBufferRect(command_queuePacked, src_bufferPacked, dst_bufferPacked,
region, src_row_pitch, src_slice_pitch, dst_row_pitch, src_origin, dst_origin, region, src_row_pitch,
dst_slice_pitch, num_events_in_wait_list, event_wait_list, src_slice_pitch, dst_row_pitch, dst_slice_pitch,
event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
// CL 1.2 // CL 1.2
...@@ -1367,27 +1575,35 @@ cl_int CL_API_CALL CL_CreateSubDevices(cl_device_id in_device, ...@@ -1367,27 +1575,35 @@ cl_int CL_API_CALL CL_CreateSubDevices(cl_device_id in_device,
(uintptr_t)in_device, (uintptr_t)properties, num_devices, (uintptr_t)out_devices, (uintptr_t)in_device, (uintptr_t)properties, num_devices, (uintptr_t)out_devices,
(uintptr_t)num_devices_ret); (uintptr_t)num_devices_ret);
Device *in_devicePacked = PackParam<Device *>(in_device);
Device **out_devicesPacked = PackParam<Device **>(out_devices);
// TODO: validate // TODO: validate
return cl::CreateSubDevices(in_device, properties, num_devices, out_devices, num_devices_ret); return (cl::CreateSubDevices(in_devicePacked, properties, num_devices, out_devicesPacked,
num_devices_ret));
} }
cl_int CL_API_CALL CL_RetainDevice(cl_device_id device) cl_int CL_API_CALL CL_RetainDevice(cl_device_id device)
{ {
CL_EVENT(RetainDevice, "device = 0x%016" PRIxPTR "", (uintptr_t)device); CL_EVENT(RetainDevice, "device = 0x%016" PRIxPTR "", (uintptr_t)device);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate // TODO: validate
return cl::RetainDevice(device); return (cl::RetainDevice(devicePacked));
} }
cl_int CL_API_CALL CL_ReleaseDevice(cl_device_id device) cl_int CL_API_CALL CL_ReleaseDevice(cl_device_id device)
{ {
CL_EVENT(ReleaseDevice, "device = 0x%016" PRIxPTR "", (uintptr_t)device); CL_EVENT(ReleaseDevice, "device = 0x%016" PRIxPTR "", (uintptr_t)device);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate // TODO: validate
return cl::ReleaseDevice(device); return (cl::ReleaseDevice(devicePacked));
} }
cl_mem CL_API_CALL CL_CreateImage(cl_context context, cl_mem CL_API_CALL CL_CreateImage(cl_context context,
...@@ -1404,9 +1620,12 @@ cl_mem CL_API_CALL CL_CreateImage(cl_context context, ...@@ -1404,9 +1620,12 @@ cl_mem CL_API_CALL CL_CreateImage(cl_context context,
(uintptr_t)context, flags, (uintptr_t)image_format, (uintptr_t)image_desc, (uintptr_t)context, flags, (uintptr_t)image_format, (uintptr_t)image_desc,
(uintptr_t)host_ptr, (uintptr_t)errcode_ret); (uintptr_t)host_ptr, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateImage(context, 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));
} }
cl_program CL_API_CALL CL_CreateProgramWithBuiltInKernels(cl_context context, cl_program CL_API_CALL CL_CreateProgramWithBuiltInKernels(cl_context context,
...@@ -1421,10 +1640,13 @@ cl_program CL_API_CALL CL_CreateProgramWithBuiltInKernels(cl_context context, ...@@ -1421,10 +1640,13 @@ cl_program CL_API_CALL CL_CreateProgramWithBuiltInKernels(cl_context context,
(uintptr_t)context, num_devices, (uintptr_t)device_list, (uintptr_t)kernel_names, (uintptr_t)context, num_devices, (uintptr_t)device_list, (uintptr_t)kernel_names,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
// TODO: validate // TODO: validate
return cl::CreateProgramWithBuiltInKernels(context, num_devices, device_list, kernel_names, return UnpackParam<cl_program>(cl::CreateProgramWithBuiltInKernels(
errcode_ret); contextPacked, num_devices, device_listPacked, kernel_names, errcode_ret));
} }
cl_int CL_API_CALL CL_CompileProgram(cl_program program, cl_int CL_API_CALL CL_CompileProgram(cl_program program,
...@@ -1447,10 +1669,15 @@ cl_int CL_API_CALL CL_CompileProgram(cl_program program, ...@@ -1447,10 +1669,15 @@ cl_int CL_API_CALL CL_CompileProgram(cl_program program,
num_input_headers, (uintptr_t)input_headers, (uintptr_t)header_include_names, num_input_headers, (uintptr_t)input_headers, (uintptr_t)header_include_names,
(uintptr_t)pfn_notify, (uintptr_t)user_data); (uintptr_t)pfn_notify, (uintptr_t)user_data);
Program *programPacked = PackParam<Program *>(program);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
Program *const *input_headersPacked = PackParam<Program *const *>(input_headers);
// TODO: validate // TODO: validate
return cl::CompileProgram(program, num_devices, device_list, options, num_input_headers, return (cl::CompileProgram(programPacked, num_devices, device_listPacked, options,
input_headers, header_include_names, pfn_notify, user_data); num_input_headers, input_headersPacked, header_include_names,
pfn_notify, user_data));
} }
cl_program CL_API_CALL CL_LinkProgram(cl_context context, cl_program CL_API_CALL CL_LinkProgram(cl_context context,
...@@ -1474,19 +1701,26 @@ cl_program CL_API_CALL CL_LinkProgram(cl_context context, ...@@ -1474,19 +1701,26 @@ cl_program CL_API_CALL CL_LinkProgram(cl_context context,
num_input_programs, (uintptr_t)input_programs, (uintptr_t)pfn_notify, num_input_programs, (uintptr_t)input_programs, (uintptr_t)pfn_notify,
(uintptr_t)user_data, (uintptr_t)errcode_ret); (uintptr_t)user_data, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
Device *const *device_listPacked = PackParam<Device *const *>(device_list);
Program *const *input_programsPacked = PackParam<Program *const *>(input_programs);
// TODO: validate // TODO: validate
return cl::LinkProgram(context, num_devices, device_list, options, num_input_programs, return UnpackParam<cl_program>(
input_programs, pfn_notify, user_data, errcode_ret); cl::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) cl_int CL_API_CALL CL_UnloadPlatformCompiler(cl_platform_id platform)
{ {
CL_EVENT(UnloadPlatformCompiler, "platform = 0x%016" PRIxPTR "", (uintptr_t)platform); CL_EVENT(UnloadPlatformCompiler, "platform = 0x%016" PRIxPTR "", (uintptr_t)platform);
Platform *platformPacked = PackParam<Platform *>(platform);
// TODO: validate // TODO: validate
return cl::UnloadPlatformCompiler(platform); return (cl::UnloadPlatformCompiler(platformPacked));
} }
cl_int CL_API_CALL CL_GetKernelArgInfo(cl_kernel kernel, cl_int CL_API_CALL CL_GetKernelArgInfo(cl_kernel kernel,
...@@ -1504,12 +1738,13 @@ cl_int CL_API_CALL CL_GetKernelArgInfo(cl_kernel kernel, ...@@ -1504,12 +1738,13 @@ cl_int CL_API_CALL CL_GetKernelArgInfo(cl_kernel kernel,
(uintptr_t)kernel, arg_index, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)kernel, arg_index, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
KernelArgInfo param_namePacked = PackParam<KernelArgInfo>(param_name); KernelArgInfo param_namePacked = PackParam<KernelArgInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetKernelArgInfo(kernel, arg_index, param_namePacked, param_value_size, param_value, return (cl::GetKernelArgInfo(kernelPacked, arg_index, param_namePacked, param_value_size,
param_value_size_ret); param_value, param_value_size_ret));
} }
cl_int CL_API_CALL CL_EnqueueFillBuffer(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueFillBuffer(cl_command_queue command_queue,
...@@ -1530,10 +1765,16 @@ cl_int CL_API_CALL CL_EnqueueFillBuffer(cl_command_queue command_queue, ...@@ -1530,10 +1765,16 @@ cl_int CL_API_CALL CL_EnqueueFillBuffer(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)buffer, (uintptr_t)pattern, pattern_size, offset, (uintptr_t)command_queue, (uintptr_t)buffer, (uintptr_t)pattern, pattern_size, offset,
size, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); size, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *bufferPacked = PackParam<Memory *>(buffer);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueFillBuffer(command_queue, buffer, pattern, pattern_size, offset, size, return (cl::EnqueueFillBuffer(command_queuePacked, bufferPacked, pattern, pattern_size, offset,
num_events_in_wait_list, event_wait_list, event); size, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueFillImage(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueFillImage(cl_command_queue command_queue,
...@@ -1554,10 +1795,15 @@ cl_int CL_API_CALL CL_EnqueueFillImage(cl_command_queue command_queue, ...@@ -1554,10 +1795,15 @@ cl_int CL_API_CALL CL_EnqueueFillImage(cl_command_queue command_queue,
(uintptr_t)region, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)region, num_events_in_wait_list, (uintptr_t)event_wait_list,
(uintptr_t)event); (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *imagePacked = PackParam<Memory *>(image);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueFillImage(command_queue, image, fill_color, origin, region, return (cl::EnqueueFillImage(command_queuePacked, imagePacked, fill_color, origin, region,
num_events_in_wait_list, event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueMigrateMemObjects(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueMigrateMemObjects(cl_command_queue command_queue,
...@@ -1575,10 +1821,16 @@ cl_int CL_API_CALL CL_EnqueueMigrateMemObjects(cl_command_queue command_queue, ...@@ -1575,10 +1821,16 @@ cl_int CL_API_CALL CL_EnqueueMigrateMemObjects(cl_command_queue command_queue,
(uintptr_t)command_queue, num_mem_objects, (uintptr_t)mem_objects, flags, (uintptr_t)command_queue, num_mem_objects, (uintptr_t)mem_objects, flags,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Memory *const *mem_objectsPacked = PackParam<Memory *const *>(mem_objects);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueMigrateMemObjects(command_queue, num_mem_objects, mem_objects, flags, return (cl::EnqueueMigrateMemObjects(command_queuePacked, num_mem_objects, mem_objectsPacked,
num_events_in_wait_list, event_wait_list, event); flags, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueMarkerWithWaitList(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueMarkerWithWaitList(cl_command_queue command_queue,
...@@ -1593,10 +1845,14 @@ cl_int CL_API_CALL CL_EnqueueMarkerWithWaitList(cl_command_queue command_queue, ...@@ -1593,10 +1845,14 @@ cl_int CL_API_CALL CL_EnqueueMarkerWithWaitList(cl_command_queue command_queue,
(uintptr_t)command_queue, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)command_queue, num_events_in_wait_list, (uintptr_t)event_wait_list,
(uintptr_t)event); (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueMarkerWithWaitList(command_queue, num_events_in_wait_list, event_wait_list, return (cl::EnqueueMarkerWithWaitList(command_queuePacked, num_events_in_wait_list,
event); event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueBarrierWithWaitList(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueBarrierWithWaitList(cl_command_queue command_queue,
...@@ -1611,10 +1867,14 @@ cl_int CL_API_CALL CL_EnqueueBarrierWithWaitList(cl_command_queue command_queue, ...@@ -1611,10 +1867,14 @@ cl_int CL_API_CALL CL_EnqueueBarrierWithWaitList(cl_command_queue command_queue,
(uintptr_t)command_queue, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)command_queue, num_events_in_wait_list, (uintptr_t)event_wait_list,
(uintptr_t)event); (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueBarrierWithWaitList(command_queue, num_events_in_wait_list, event_wait_list, return (cl::EnqueueBarrierWithWaitList(command_queuePacked, num_events_in_wait_list,
event); event_wait_listPacked, eventPacked));
} }
void *CL_API_CALL CL_GetExtensionFunctionAddressForPlatform(cl_platform_id platform, void *CL_API_CALL CL_GetExtensionFunctionAddressForPlatform(cl_platform_id platform,
...@@ -1624,9 +1884,11 @@ void *CL_API_CALL CL_GetExtensionFunctionAddressForPlatform(cl_platform_id platf ...@@ -1624,9 +1884,11 @@ void *CL_API_CALL CL_GetExtensionFunctionAddressForPlatform(cl_platform_id platf
"platform = 0x%016" PRIxPTR ", func_name = 0x%016" PRIxPTR "", (uintptr_t)platform, "platform = 0x%016" PRIxPTR ", func_name = 0x%016" PRIxPTR "", (uintptr_t)platform,
(uintptr_t)func_name); (uintptr_t)func_name);
Platform *platformPacked = PackParam<Platform *>(platform);
// TODO: validate // TODO: validate
return cl::GetExtensionFunctionAddressForPlatform(platform, func_name); return (cl::GetExtensionFunctionAddressForPlatform(platformPacked, func_name));
} }
// CL 2.0 // CL 2.0
...@@ -1641,9 +1903,13 @@ CL_CreateCommandQueueWithProperties(cl_context context, ...@@ -1641,9 +1903,13 @@ CL_CreateCommandQueueWithProperties(cl_context context,
", errcode_ret = 0x%016" PRIxPTR "", ", errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)device, (uintptr_t)properties, (uintptr_t)errcode_ret); (uintptr_t)context, (uintptr_t)device, (uintptr_t)properties, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate // TODO: validate
return cl::CreateCommandQueueWithProperties(context, device, properties, errcode_ret); return UnpackParam<cl_command_queue>(
cl::CreateCommandQueueWithProperties(contextPacked, devicePacked, properties, errcode_ret));
} }
cl_mem CL_API_CALL CL_CreatePipe(cl_context context, cl_mem CL_API_CALL CL_CreatePipe(cl_context context,
...@@ -1661,10 +1927,12 @@ cl_mem CL_API_CALL CL_CreatePipe(cl_context context, ...@@ -1661,10 +1927,12 @@ cl_mem CL_API_CALL CL_CreatePipe(cl_context context,
(uintptr_t)context, flags, pipe_packet_size, pipe_max_packets, (uintptr_t)properties, (uintptr_t)context, flags, pipe_packet_size, pipe_max_packets, (uintptr_t)properties,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreatePipe(context, flags, pipe_packet_size, pipe_max_packets, properties, return UnpackParam<cl_mem>(cl::CreatePipe(contextPacked, flags, pipe_packet_size,
errcode_ret); pipe_max_packets, properties, errcode_ret));
} }
cl_int CL_API_CALL CL_GetPipeInfo(cl_mem pipe, cl_int CL_API_CALL CL_GetPipeInfo(cl_mem pipe,
...@@ -1680,12 +1948,13 @@ cl_int CL_API_CALL CL_GetPipeInfo(cl_mem pipe, ...@@ -1680,12 +1948,13 @@ cl_int CL_API_CALL CL_GetPipeInfo(cl_mem pipe,
(uintptr_t)pipe, param_name, param_value_size, (uintptr_t)param_value, (uintptr_t)pipe, param_name, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Memory *pipePacked = PackParam<Memory *>(pipe);
PipeInfo param_namePacked = PackParam<PipeInfo>(param_name); PipeInfo param_namePacked = PackParam<PipeInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetPipeInfo(pipe, param_namePacked, param_value_size, param_value, return (cl::GetPipeInfo(pipePacked, param_namePacked, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
void *CL_API_CALL CL_SVMAlloc(cl_context context, void *CL_API_CALL CL_SVMAlloc(cl_context context,
...@@ -1696,9 +1965,11 @@ void *CL_API_CALL CL_SVMAlloc(cl_context context, ...@@ -1696,9 +1965,11 @@ void *CL_API_CALL CL_SVMAlloc(cl_context context,
CL_EVENT(SVMAlloc, "context = 0x%016" PRIxPTR ", flags = %lu, size = %zu, alignment = %u", CL_EVENT(SVMAlloc, "context = 0x%016" PRIxPTR ", flags = %lu, size = %zu, alignment = %u",
(uintptr_t)context, flags, size, alignment); (uintptr_t)context, flags, size, alignment);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::SVMAlloc(context, flags, size, alignment); return (cl::SVMAlloc(contextPacked, flags, size, alignment));
} }
void CL_API_CALL CL_SVMFree(cl_context context, void *svm_pointer) void CL_API_CALL CL_SVMFree(cl_context context, void *svm_pointer)
...@@ -1706,9 +1977,11 @@ void CL_API_CALL CL_SVMFree(cl_context context, void *svm_pointer) ...@@ -1706,9 +1977,11 @@ void CL_API_CALL CL_SVMFree(cl_context context, void *svm_pointer)
CL_EVENT(SVMFree, "context = 0x%016" PRIxPTR ", svm_pointer = 0x%016" PRIxPTR "", CL_EVENT(SVMFree, "context = 0x%016" PRIxPTR ", svm_pointer = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)svm_pointer); (uintptr_t)context, (uintptr_t)svm_pointer);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
cl::SVMFree(context, svm_pointer); cl::SVMFree(contextPacked, svm_pointer);
} }
cl_sampler CL_API_CALL cl_sampler CL_API_CALL
...@@ -1721,9 +1994,12 @@ CL_CreateSamplerWithProperties(cl_context context, ...@@ -1721,9 +1994,12 @@ CL_CreateSamplerWithProperties(cl_context context,
", errcode_ret = 0x%016" PRIxPTR "", ", errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)sampler_properties, (uintptr_t)errcode_ret); (uintptr_t)context, (uintptr_t)sampler_properties, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateSamplerWithProperties(context, sampler_properties, errcode_ret); return UnpackParam<cl_sampler>(
cl::CreateSamplerWithProperties(contextPacked, sampler_properties, errcode_ret));
} }
cl_int CL_API_CALL CL_SetKernelArgSVMPointer(cl_kernel kernel, cl_int CL_API_CALL CL_SetKernelArgSVMPointer(cl_kernel kernel,
...@@ -1734,9 +2010,11 @@ cl_int CL_API_CALL CL_SetKernelArgSVMPointer(cl_kernel kernel, ...@@ -1734,9 +2010,11 @@ cl_int CL_API_CALL CL_SetKernelArgSVMPointer(cl_kernel kernel,
"kernel = 0x%016" PRIxPTR ", arg_index = %u, arg_value = 0x%016" PRIxPTR "", "kernel = 0x%016" PRIxPTR ", arg_index = %u, arg_value = 0x%016" PRIxPTR "",
(uintptr_t)kernel, arg_index, (uintptr_t)arg_value); (uintptr_t)kernel, arg_index, (uintptr_t)arg_value);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
// TODO: validate // TODO: validate
return cl::SetKernelArgSVMPointer(kernel, arg_index, arg_value); return (cl::SetKernelArgSVMPointer(kernelPacked, arg_index, arg_value));
} }
cl_int CL_API_CALL CL_SetKernelExecInfo(cl_kernel kernel, cl_int CL_API_CALL CL_SetKernelExecInfo(cl_kernel kernel,
...@@ -1749,11 +2027,12 @@ cl_int CL_API_CALL CL_SetKernelExecInfo(cl_kernel kernel, ...@@ -1749,11 +2027,12 @@ cl_int CL_API_CALL CL_SetKernelExecInfo(cl_kernel kernel,
", param_name = %u, param_value_size = %zu, param_value = 0x%016" PRIxPTR "", ", param_name = %u, param_value_size = %zu, param_value = 0x%016" PRIxPTR "",
(uintptr_t)kernel, param_name, param_value_size, (uintptr_t)param_value); (uintptr_t)kernel, param_name, param_value_size, (uintptr_t)param_value);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
KernelExecInfo param_namePacked = PackParam<KernelExecInfo>(param_name); KernelExecInfo param_namePacked = PackParam<KernelExecInfo>(param_name);
// TODO: validate // TODO: validate
return cl::SetKernelExecInfo(kernel, param_namePacked, param_value_size, param_value); return (cl::SetKernelExecInfo(kernelPacked, param_namePacked, param_value_size, param_value));
} }
cl_int CL_API_CALL CL_EnqueueSVMFree(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueSVMFree(cl_command_queue command_queue,
...@@ -1778,10 +2057,15 @@ cl_int CL_API_CALL CL_EnqueueSVMFree(cl_command_queue command_queue, ...@@ -1778,10 +2057,15 @@ cl_int CL_API_CALL CL_EnqueueSVMFree(cl_command_queue command_queue,
(uintptr_t)pfn_free_func, (uintptr_t)user_data, num_events_in_wait_list, (uintptr_t)pfn_free_func, (uintptr_t)user_data, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueSVMFree(command_queue, num_svm_pointers, svm_pointers, pfn_free_func, return (cl::EnqueueSVMFree(command_queuePacked, num_svm_pointers, svm_pointers, pfn_free_func,
user_data, num_events_in_wait_list, event_wait_list, event); user_data, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueSVMMemcpy(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueSVMMemcpy(cl_command_queue command_queue,
...@@ -1801,10 +2085,14 @@ cl_int CL_API_CALL CL_EnqueueSVMMemcpy(cl_command_queue command_queue, ...@@ -1801,10 +2085,14 @@ cl_int CL_API_CALL CL_EnqueueSVMMemcpy(cl_command_queue command_queue,
(uintptr_t)command_queue, blocking_copy, (uintptr_t)dst_ptr, (uintptr_t)src_ptr, size, (uintptr_t)command_queue, blocking_copy, (uintptr_t)dst_ptr, (uintptr_t)src_ptr, size,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueSVMMemcpy(command_queue, blocking_copy, dst_ptr, src_ptr, size, return (cl::EnqueueSVMMemcpy(command_queuePacked, blocking_copy, dst_ptr, src_ptr, size,
num_events_in_wait_list, event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueSVMMemFill(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueSVMMemFill(cl_command_queue command_queue,
...@@ -1824,10 +2112,14 @@ cl_int CL_API_CALL CL_EnqueueSVMMemFill(cl_command_queue command_queue, ...@@ -1824,10 +2112,14 @@ cl_int CL_API_CALL CL_EnqueueSVMMemFill(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)svm_ptr, (uintptr_t)pattern, pattern_size, size, (uintptr_t)command_queue, (uintptr_t)svm_ptr, (uintptr_t)pattern, pattern_size, size,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueSVMMemFill(command_queue, svm_ptr, pattern, pattern_size, size, return (cl::EnqueueSVMMemFill(command_queuePacked, svm_ptr, pattern, pattern_size, size,
num_events_in_wait_list, event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueSVMMap(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueSVMMap(cl_command_queue command_queue,
...@@ -1847,10 +2139,14 @@ cl_int CL_API_CALL CL_EnqueueSVMMap(cl_command_queue command_queue, ...@@ -1847,10 +2139,14 @@ cl_int CL_API_CALL CL_EnqueueSVMMap(cl_command_queue command_queue,
(uintptr_t)command_queue, blocking_map, flags, (uintptr_t)svm_ptr, size, (uintptr_t)command_queue, blocking_map, flags, (uintptr_t)svm_ptr, size,
num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueSVMMap(command_queue, blocking_map, flags, svm_ptr, size, return (cl::EnqueueSVMMap(command_queuePacked, blocking_map, flags, svm_ptr, size,
num_events_in_wait_list, event_wait_list, event); num_events_in_wait_list, event_wait_listPacked, eventPacked));
} }
cl_int CL_API_CALL CL_EnqueueSVMUnmap(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueSVMUnmap(cl_command_queue command_queue,
...@@ -1866,10 +2162,14 @@ cl_int CL_API_CALL CL_EnqueueSVMUnmap(cl_command_queue command_queue, ...@@ -1866,10 +2162,14 @@ cl_int CL_API_CALL CL_EnqueueSVMUnmap(cl_command_queue command_queue,
(uintptr_t)command_queue, (uintptr_t)svm_ptr, num_events_in_wait_list, (uintptr_t)command_queue, (uintptr_t)svm_ptr, num_events_in_wait_list,
(uintptr_t)event_wait_list, (uintptr_t)event); (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueSVMUnmap(command_queue, svm_ptr, num_events_in_wait_list, event_wait_list, return (cl::EnqueueSVMUnmap(command_queuePacked, svm_ptr, num_events_in_wait_list,
event); event_wait_listPacked, eventPacked));
} }
// CL 2.1 // CL 2.1
...@@ -1882,9 +2182,13 @@ cl_int CL_API_CALL CL_SetDefaultDeviceCommandQueue(cl_context context, ...@@ -1882,9 +2182,13 @@ cl_int CL_API_CALL CL_SetDefaultDeviceCommandQueue(cl_context context,
", command_queue = 0x%016" PRIxPTR "", ", command_queue = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)device, (uintptr_t)command_queue); (uintptr_t)context, (uintptr_t)device, (uintptr_t)command_queue);
Context *contextPacked = PackParam<Context *>(context);
Device *devicePacked = PackParam<Device *>(device);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
// TODO: validate // TODO: validate
return cl::SetDefaultDeviceCommandQueue(context, device, command_queue); return (cl::SetDefaultDeviceCommandQueue(contextPacked, devicePacked, command_queuePacked));
} }
cl_int CL_API_CALL CL_GetDeviceAndHostTimer(cl_device_id device, cl_int CL_API_CALL CL_GetDeviceAndHostTimer(cl_device_id device,
...@@ -1896,9 +2200,11 @@ cl_int CL_API_CALL CL_GetDeviceAndHostTimer(cl_device_id device, ...@@ -1896,9 +2200,11 @@ cl_int CL_API_CALL CL_GetDeviceAndHostTimer(cl_device_id device,
", host_timestamp = 0x%016" PRIxPTR "", ", host_timestamp = 0x%016" PRIxPTR "",
(uintptr_t)device, (uintptr_t)device_timestamp, (uintptr_t)host_timestamp); (uintptr_t)device, (uintptr_t)device_timestamp, (uintptr_t)host_timestamp);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate // TODO: validate
return cl::GetDeviceAndHostTimer(device, device_timestamp, host_timestamp); return (cl::GetDeviceAndHostTimer(devicePacked, device_timestamp, host_timestamp));
} }
cl_int CL_API_CALL CL_GetHostTimer(cl_device_id device, cl_ulong *host_timestamp) cl_int CL_API_CALL CL_GetHostTimer(cl_device_id device, cl_ulong *host_timestamp)
...@@ -1906,9 +2212,11 @@ cl_int CL_API_CALL CL_GetHostTimer(cl_device_id device, cl_ulong *host_timestamp ...@@ -1906,9 +2212,11 @@ cl_int CL_API_CALL CL_GetHostTimer(cl_device_id device, cl_ulong *host_timestamp
CL_EVENT(GetHostTimer, "device = 0x%016" PRIxPTR ", host_timestamp = 0x%016" PRIxPTR "", CL_EVENT(GetHostTimer, "device = 0x%016" PRIxPTR ", host_timestamp = 0x%016" PRIxPTR "",
(uintptr_t)device, (uintptr_t)host_timestamp); (uintptr_t)device, (uintptr_t)host_timestamp);
Device *devicePacked = PackParam<Device *>(device);
// TODO: validate // TODO: validate
return cl::GetHostTimer(device, host_timestamp); return (cl::GetHostTimer(devicePacked, host_timestamp));
} }
cl_program CL_API_CALL CL_CreateProgramWithIL(cl_context context, cl_program CL_API_CALL CL_CreateProgramWithIL(cl_context context,
...@@ -1921,9 +2229,11 @@ cl_program CL_API_CALL CL_CreateProgramWithIL(cl_context context, ...@@ -1921,9 +2229,11 @@ cl_program CL_API_CALL CL_CreateProgramWithIL(cl_context context,
", length = %zu, errcode_ret = 0x%016" PRIxPTR "", ", length = %zu, errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)il, length, (uintptr_t)errcode_ret); (uintptr_t)context, (uintptr_t)il, length, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateProgramWithIL(context, il, length, errcode_ret); return UnpackParam<cl_program>(cl::CreateProgramWithIL(contextPacked, il, length, errcode_ret));
} }
cl_kernel CL_API_CALL CL_CloneKernel(cl_kernel source_kernel, cl_int *errcode_ret) cl_kernel CL_API_CALL CL_CloneKernel(cl_kernel source_kernel, cl_int *errcode_ret)
...@@ -1931,9 +2241,11 @@ cl_kernel CL_API_CALL CL_CloneKernel(cl_kernel source_kernel, cl_int *errcode_re ...@@ -1931,9 +2241,11 @@ cl_kernel CL_API_CALL CL_CloneKernel(cl_kernel source_kernel, cl_int *errcode_re
CL_EVENT(CloneKernel, "source_kernel = 0x%016" PRIxPTR ", errcode_ret = 0x%016" PRIxPTR "", CL_EVENT(CloneKernel, "source_kernel = 0x%016" PRIxPTR ", errcode_ret = 0x%016" PRIxPTR "",
(uintptr_t)source_kernel, (uintptr_t)errcode_ret); (uintptr_t)source_kernel, (uintptr_t)errcode_ret);
Kernel *source_kernelPacked = PackParam<Kernel *>(source_kernel);
// TODO: validate // TODO: validate
return cl::CloneKernel(source_kernel, errcode_ret); return UnpackParam<cl_kernel>(cl::CloneKernel(source_kernelPacked, errcode_ret));
} }
cl_int CL_API_CALL CL_GetKernelSubGroupInfo(cl_kernel kernel, cl_int CL_API_CALL CL_GetKernelSubGroupInfo(cl_kernel kernel,
...@@ -1954,13 +2266,15 @@ cl_int CL_API_CALL CL_GetKernelSubGroupInfo(cl_kernel kernel, ...@@ -1954,13 +2266,15 @@ cl_int CL_API_CALL CL_GetKernelSubGroupInfo(cl_kernel kernel,
(uintptr_t)input_value, param_value_size, (uintptr_t)param_value, (uintptr_t)input_value, param_value_size, (uintptr_t)param_value,
(uintptr_t)param_value_size_ret); (uintptr_t)param_value_size_ret);
Kernel *kernelPacked = PackParam<Kernel *>(kernel);
Device *devicePacked = PackParam<Device *>(device);
KernelSubGroupInfo param_namePacked = PackParam<KernelSubGroupInfo>(param_name); KernelSubGroupInfo param_namePacked = PackParam<KernelSubGroupInfo>(param_name);
// TODO: validate // TODO: validate
return cl::GetKernelSubGroupInfo(kernel, device, param_namePacked, input_value_size, return (cl::GetKernelSubGroupInfo(kernelPacked, devicePacked, param_namePacked,
input_value, param_value_size, param_value, input_value_size, input_value, param_value_size, param_value,
param_value_size_ret); param_value_size_ret));
} }
cl_int CL_API_CALL CL_EnqueueSVMMigrateMem(cl_command_queue command_queue, cl_int CL_API_CALL CL_EnqueueSVMMigrateMem(cl_command_queue command_queue,
...@@ -1980,10 +2294,15 @@ cl_int CL_API_CALL CL_EnqueueSVMMigrateMem(cl_command_queue command_queue, ...@@ -1980,10 +2294,15 @@ cl_int CL_API_CALL CL_EnqueueSVMMigrateMem(cl_command_queue command_queue,
(uintptr_t)command_queue, num_svm_pointers, (uintptr_t)svm_pointers, (uintptr_t)sizes, (uintptr_t)command_queue, num_svm_pointers, (uintptr_t)svm_pointers, (uintptr_t)sizes,
flags, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event); flags, num_events_in_wait_list, (uintptr_t)event_wait_list, (uintptr_t)event);
CommandQueue *command_queuePacked = PackParam<CommandQueue *>(command_queue);
Event *const *event_wait_listPacked = PackParam<Event *const *>(event_wait_list);
Event **eventPacked = PackParam<Event **>(event);
// TODO: validate // TODO: validate
return cl::EnqueueSVMMigrateMem(command_queue, num_svm_pointers, svm_pointers, sizes, flags, return (cl::EnqueueSVMMigrateMem(command_queuePacked, num_svm_pointers, svm_pointers, sizes,
num_events_in_wait_list, event_wait_list, event); flags, num_events_in_wait_list, event_wait_listPacked,
eventPacked));
} }
// CL 2.2 // CL 2.2
...@@ -1997,9 +2316,11 @@ cl_int CL_API_CALL CL_SetProgramReleaseCallback(cl_program program, ...@@ -1997,9 +2316,11 @@ cl_int CL_API_CALL CL_SetProgramReleaseCallback(cl_program program,
", user_data = 0x%016" PRIxPTR "", ", user_data = 0x%016" PRIxPTR "",
(uintptr_t)program, (uintptr_t)pfn_notify, (uintptr_t)user_data); (uintptr_t)program, (uintptr_t)pfn_notify, (uintptr_t)user_data);
Program *programPacked = PackParam<Program *>(program);
// TODO: validate // TODO: validate
return cl::SetProgramReleaseCallback(program, pfn_notify, user_data); return (cl::SetProgramReleaseCallback(programPacked, pfn_notify, user_data));
} }
cl_int CL_API_CALL CL_SetProgramSpecializationConstant(cl_program program, cl_int CL_API_CALL CL_SetProgramSpecializationConstant(cl_program program,
...@@ -2012,9 +2333,11 @@ cl_int CL_API_CALL CL_SetProgramSpecializationConstant(cl_program program, ...@@ -2012,9 +2333,11 @@ cl_int CL_API_CALL CL_SetProgramSpecializationConstant(cl_program program,
", spec_id = %u, spec_size = %zu, spec_value = 0x%016" PRIxPTR "", ", spec_id = %u, spec_size = %zu, spec_value = 0x%016" PRIxPTR "",
(uintptr_t)program, spec_id, spec_size, (uintptr_t)spec_value); (uintptr_t)program, spec_id, spec_size, (uintptr_t)spec_value);
Program *programPacked = PackParam<Program *>(program);
// TODO: validate // TODO: validate
return cl::SetProgramSpecializationConstant(program, spec_id, spec_size, spec_value); return (cl::SetProgramSpecializationConstant(programPacked, spec_id, spec_size, spec_value));
} }
// CL 3.0 // CL 3.0
...@@ -2028,9 +2351,11 @@ cl_int CL_API_CALL CL_SetContextDestructorCallback(cl_context context, ...@@ -2028,9 +2351,11 @@ cl_int CL_API_CALL CL_SetContextDestructorCallback(cl_context context,
", user_data = 0x%016" PRIxPTR "", ", user_data = 0x%016" PRIxPTR "",
(uintptr_t)context, (uintptr_t)pfn_notify, (uintptr_t)user_data); (uintptr_t)context, (uintptr_t)pfn_notify, (uintptr_t)user_data);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::SetContextDestructorCallback(context, pfn_notify, user_data); return (cl::SetContextDestructorCallback(contextPacked, pfn_notify, user_data));
} }
cl_mem CL_API_CALL CL_CreateBufferWithProperties(cl_context context, cl_mem CL_API_CALL CL_CreateBufferWithProperties(cl_context context,
...@@ -2047,9 +2372,12 @@ cl_mem CL_API_CALL CL_CreateBufferWithProperties(cl_context context, ...@@ -2047,9 +2372,12 @@ cl_mem CL_API_CALL CL_CreateBufferWithProperties(cl_context context,
(uintptr_t)context, (uintptr_t)properties, flags, size, (uintptr_t)host_ptr, (uintptr_t)context, (uintptr_t)properties, flags, size, (uintptr_t)host_ptr,
(uintptr_t)errcode_ret); (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateBufferWithProperties(context, properties, flags, size, host_ptr, errcode_ret); return UnpackParam<cl_mem>(cl::CreateBufferWithProperties(contextPacked, properties, flags,
size, host_ptr, errcode_ret));
} }
cl_mem CL_API_CALL CL_CreateImageWithProperties(cl_context context, cl_mem CL_API_CALL CL_CreateImageWithProperties(cl_context context,
...@@ -2067,10 +2395,12 @@ cl_mem CL_API_CALL CL_CreateImageWithProperties(cl_context context, ...@@ -2067,10 +2395,12 @@ cl_mem CL_API_CALL CL_CreateImageWithProperties(cl_context context,
(uintptr_t)context, (uintptr_t)properties, flags, (uintptr_t)image_format, (uintptr_t)context, (uintptr_t)properties, flags, (uintptr_t)image_format,
(uintptr_t)image_desc, (uintptr_t)host_ptr, (uintptr_t)errcode_ret); (uintptr_t)image_desc, (uintptr_t)host_ptr, (uintptr_t)errcode_ret);
Context *contextPacked = PackParam<Context *>(context);
// TODO: validate // TODO: validate
return cl::CreateImageWithProperties(context, properties, flags, image_format, image_desc, return UnpackParam<cl_mem>(cl::CreateImageWithProperties(
host_ptr, errcode_ret); contextPacked, properties, flags, image_format, image_desc, host_ptr, errcode_ret));
} }
} // extern "C" } // extern "C"
...@@ -27,7 +27,20 @@ inline typename std::enable_if<!std::is_enum<PackedT>::value, ...@@ -27,7 +27,20 @@ inline typename std::enable_if<!std::is_enum<PackedT>::value,
typename std::remove_reference<PackedT>::type>::type typename std::remove_reference<PackedT>::type>::type
PackParam(FromT from) PackParam(FromT from)
{ {
return static_cast<PackedT>(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 } // namespace cl
......
...@@ -6,29 +6,7 @@ ...@@ -6,29 +6,7 @@
import("../../gni/angle.gni") import("../../gni/angle.gni")
angle_source_set("cl_includes") { assert(angle_enable_cl)
sources = [
"../../include/CL/cl.h",
"../../include/CL/cl_d3d10.h",
"../../include/CL/cl_d3d11.h",
"../../include/CL/cl_dx9_media_sharing.h",
"../../include/CL/cl_dx9_media_sharing_intel.h",
"../../include/CL/cl_egl.h",
"../../include/CL/cl_ext.h",
"../../include/CL/cl_ext_intel.h",
"../../include/CL/cl_gl.h",
"../../include/CL/cl_gl_ext.h",
"../../include/CL/cl_half.h",
"../../include/CL/cl_icd.h",
"../../include/CL/cl_layer.h",
"../../include/CL/cl_platform.h",
"../../include/CL/cl_va_api_media_sharing_intel.h",
"../../include/CL/cl_version.h",
"../../include/CL/opencl.h",
"../../include/angle_cl.h",
"../../include/export.h",
]
}
angle_shared_library("OpenCL") { angle_shared_library("OpenCL") {
defines = [ "LIBCL_IMPLEMENTATION" ] defines = [ "LIBCL_IMPLEMENTATION" ]
...@@ -45,8 +23,8 @@ angle_shared_library("OpenCL") { ...@@ -45,8 +23,8 @@ angle_shared_library("OpenCL") {
] ]
deps = [ deps = [
":cl_includes",
"$angle_root:angle_common", "$angle_root:angle_common",
"$angle_root:cl_includes",
] ]
} }
......
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