Commit 83689e32 by John Plate Committed by Commit Bot

CL: Add symbol version map to libOpenCL

Bug: angleproject:5904 Change-Id: I4a5859ea172c9d17cfd84ef219ddd9a71fb3b927 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2894428 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent c8c70ef8
......@@ -6,7 +6,7 @@
"scripts/egl_angle_ext.xml":
"5bcc01462b355d933cf3ada15198fb68",
"scripts/gen_proc_table.py":
"1d92e72e9b98865366d1e56f5e31954c",
"7717a320f69631bd70ef8a8e994d47ee",
"scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6",
"scripts/gl_angle_ext.xml":
......@@ -20,5 +20,7 @@
"src/libGLESv2/proc_table_cl_autogen.cpp":
"ed003b0f041aaaa35b67d3fe07e61f91",
"src/libGLESv2/proc_table_egl_autogen.cpp":
"53d085f3f46ea5d841d93e7063925ae4"
"53d085f3f46ea5d841d93e7063925ae4",
"src/libOpenCL/libOpenCL_autogen.map":
"bc5f5cf48227149ed321258a16eff1d7"
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import registry_xml
out_file_name_gles = "../src/libGLESv2/proc_table_egl_autogen.cpp"
out_file_name_gl = "../src/libGL/proc_table_wgl_autogen.cpp"
out_file_name_cl = "../src/libGLESv2/proc_table_cl_autogen.cpp"
out_file_name_cl_map = "../src/libOpenCL/libOpenCL_autogen.map"
# The EGL_ANGLE_explicit_context extension is generated differently from other extensions.
# Toggle generation here.
......@@ -72,6 +73,18 @@ const ProcTable &GetProcTable()
}} // namespace {namespace}
"""
template_map = """/* GENERATED FILE - DO NOT EDIT.
* Generated by {script_name} using data from {data_source_name}.
*
* Copyright 2021 The ANGLE Project Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* symbol version map: Maps versions to entry point names for a shared library.
*/
{symbol_maps}
"""
includes_gles = """#include "libGLESv2/proc_table_egl.h"
#include "libGLESv2/entry_points_egl_autogen.h"
......@@ -118,7 +131,7 @@ def main():
# auto_script parameters.
if len(sys.argv) > 1:
inputs = [source for source in registry_xml.xml_inputs]
outputs = [out_file_name_gles, out_file_name_gl, out_file_name_cl]
outputs = [out_file_name_gles, out_file_name_gl, out_file_name_cl, out_file_name_cl_map]
if sys.argv[1] == 'inputs':
print(','.join(inputs))
elif sys.argv[1] == 'outputs':
......@@ -238,12 +251,22 @@ def main():
# libCL proc table
clxml = registry_xml.RegistryXML('cl.xml')
symbol_maps = []
symbol_map_dependency = ""
for major_version, minor_version in registry_xml.CL_VERSIONS:
name_prefix = "CL_VERSION_"
annotation = "%d_%d" % (major_version, minor_version)
feature_name = "%s%s" % (name_prefix, annotation)
clxml.AddCommands(feature_name, annotation)
symbol_version = "OPENCL_%d.%d" % (major_version, minor_version)
symbol_maps += ["\n%s {\n global:" % symbol_version]
symbol_maps += [' %s;' % cmd for cmd in clxml.commands[annotation]]
if not symbol_map_dependency:
symbol_maps += [" local:\n *;\n};"]
else:
symbol_maps += ["} %s;" % symbol_map_dependency]
symbol_map_dependency = symbol_version
clxml.AddExtensionCommands(registry_xml.supported_cl_extensions, ['cl'])
cl_commands = clxml.all_cmd_names.get_all_commands()
......@@ -260,6 +283,12 @@ def main():
out_file.write(output_cpp)
out_file.close()
with open(out_file_name_cl_map, 'w') as out_file:
output_map = template_map.format(
script_name=sys.argv[0], data_source_name="cl.xml", symbol_maps="\n".join(symbol_maps))
out_file.write(output_map)
out_file.close()
return 0
......
......@@ -36,6 +36,12 @@ angle_shared_library(cl_library_name) {
"$angle_root:angle_common",
"$angle_root:cl_includes",
]
if (is_linux) {
inputs = [ "libOpenCL_autogen.map" ]
ldflags = [ "-Wl,--version-script=" +
rebase_path("libOpenCL_autogen.map", root_build_dir) ]
}
}
group("angle_cl") {
......
/* GENERATED FILE - DO NOT EDIT.
* Generated by gen_proc_table.py using data from cl.xml.
*
* Copyright 2021 The ANGLE Project Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* symbol version map: Maps versions to entry point names for a shared library.
*/
OPENCL_1.0 {
global:
clGetPlatformIDs;
clGetPlatformInfo;
clGetDeviceIDs;
clGetDeviceInfo;
clCreateContext;
clCreateContextFromType;
clRetainContext;
clReleaseContext;
clGetContextInfo;
clRetainCommandQueue;
clReleaseCommandQueue;
clGetCommandQueueInfo;
clCreateBuffer;
clRetainMemObject;
clReleaseMemObject;
clGetSupportedImageFormats;
clGetMemObjectInfo;
clGetImageInfo;
clRetainSampler;
clReleaseSampler;
clGetSamplerInfo;
clCreateProgramWithSource;
clCreateProgramWithBinary;
clRetainProgram;
clReleaseProgram;
clBuildProgram;
clGetProgramInfo;
clGetProgramBuildInfo;
clCreateKernel;
clCreateKernelsInProgram;
clRetainKernel;
clReleaseKernel;
clSetKernelArg;
clGetKernelInfo;
clGetKernelWorkGroupInfo;
clWaitForEvents;
clGetEventInfo;
clRetainEvent;
clReleaseEvent;
clGetEventProfilingInfo;
clFlush;
clFinish;
clEnqueueReadBuffer;
clEnqueueWriteBuffer;
clEnqueueCopyBuffer;
clEnqueueReadImage;
clEnqueueWriteImage;
clEnqueueCopyImage;
clEnqueueCopyImageToBuffer;
clEnqueueCopyBufferToImage;
clEnqueueMapBuffer;
clEnqueueMapImage;
clEnqueueUnmapMemObject;
clEnqueueNDRangeKernel;
clEnqueueNativeKernel;
clSetCommandQueueProperty;
clCreateImage2D;
clCreateImage3D;
clEnqueueMarker;
clEnqueueWaitForEvents;
clEnqueueBarrier;
clUnloadCompiler;
clGetExtensionFunctionAddress;
clCreateCommandQueue;
clCreateSampler;
clEnqueueTask;
local:
*;
};
OPENCL_1.1 {
global:
clCreateSubBuffer;
clSetMemObjectDestructorCallback;
clCreateUserEvent;
clSetUserEventStatus;
clSetEventCallback;
clEnqueueReadBufferRect;
clEnqueueWriteBufferRect;
clEnqueueCopyBufferRect;
} OPENCL_1.0;
OPENCL_1.2 {
global:
clCreateSubDevices;
clRetainDevice;
clReleaseDevice;
clCreateImage;
clCreateProgramWithBuiltInKernels;
clCompileProgram;
clLinkProgram;
clUnloadPlatformCompiler;
clGetKernelArgInfo;
clEnqueueFillBuffer;
clEnqueueFillImage;
clEnqueueMigrateMemObjects;
clEnqueueMarkerWithWaitList;
clEnqueueBarrierWithWaitList;
clGetExtensionFunctionAddressForPlatform;
} OPENCL_1.1;
OPENCL_2.0 {
global:
clCreateCommandQueueWithProperties;
clCreatePipe;
clGetPipeInfo;
clSVMAlloc;
clSVMFree;
clCreateSamplerWithProperties;
clSetKernelArgSVMPointer;
clSetKernelExecInfo;
clEnqueueSVMFree;
clEnqueueSVMMemcpy;
clEnqueueSVMMemFill;
clEnqueueSVMMap;
clEnqueueSVMUnmap;
} OPENCL_1.2;
OPENCL_2.1 {
global:
clSetDefaultDeviceCommandQueue;
clGetDeviceAndHostTimer;
clGetHostTimer;
clCreateProgramWithIL;
clCloneKernel;
clGetKernelSubGroupInfo;
clEnqueueSVMMigrateMem;
} OPENCL_2.0;
OPENCL_2.2 {
global:
clSetProgramSpecializationConstant;
clSetProgramReleaseCallback;
} OPENCL_2.1;
OPENCL_3.0 {
global:
clSetContextDestructorCallback;
clCreateBufferWithProperties;
clCreateImageWithProperties;
} OPENCL_2.2;
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