From a29670cc9a7c633af51ea3bcd022dc01fc4a1732 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 9 May 2017 19:11:37 -0400
Subject: [PATCH] P4 to Git Change 1407812 by lmoriche@lmoriche_palamida on
2017/05/09 19:05:59
SWDEV-102726 - [OCL-LC-ROCm] Open source OpenCL Runtime
- Add a linker script to version the symbols
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/amdocl.map#3 add
[ROCm/clr commit: 09c3bd377c4ff22050dd727e8c0746a9a95f9d2c]
---
.../opencl/api/opencl/amdocl/CMakeLists.txt | 2 +-
.../clr/opencl/api/opencl/amdocl/amdocl.map | 154 ++++++++++++++++++
2 files changed, 155 insertions(+), 1 deletion(-)
create mode 100644 projects/clr/opencl/api/opencl/amdocl/amdocl.map
diff --git a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
index d072f23225..2165dcf9ab 100644
--- a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
+++ b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
@@ -1,7 +1,7 @@
find_library(HSA_LIB hsa-runtime64 HINTS /opt/rocm/lib)
set(CMAKE_CXX_FLAGS "-std=c++11")
-set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic -Wl,--unresolved-symbols=report-all")
+set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic -Wl,--unresolved-symbols=report-all -Wl,--version-script=${CMAKE_SOURCE_DIR}/api/opencl/amdocl/amdocl.map")
add_definitions(-DLINUX -D__x86_64__ -D__AMD64__ -DUNIX_OS -DqLittleEndian -DOPENCL_MAJOR=2 -DOPENCL_MINOR=0 -DWITH_AQL -DWITH_ONLINE_COMPILER -DATI_OS_LINUX -DATI_ARCH_X86 -DLITTLEENDIAN_CPU -DATI_BITS_64 -DATI_COMP_GCC -DWITH_HSA_DEVICE -DWITH_TARGET_AMDGCN -DOPENCL_EXPORTS -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DVEGA10_ONLY=false -DWITH_LIGHTNING_COMPILER)
diff --git a/projects/clr/opencl/api/opencl/amdocl/amdocl.map b/projects/clr/opencl/api/opencl/amdocl/amdocl.map
new file mode 100644
index 0000000000..4186970f4a
--- /dev/null
+++ b/projects/clr/opencl/api/opencl/amdocl/amdocl.map
@@ -0,0 +1,154 @@
+OPENCL_1.0 {
+global:
+ clBuildProgram;
+ clCreateBuffer;
+ clCreateCommandQueue;
+ clCreateContext;
+ clCreateContextFromType;
+ clCreateFromD3D10Buffer;
+ clCreateFromGLBuffer;
+ clCreateFromGLRenderbuffer;
+ clCreateFromGLTexture2D;
+ clCreateFromGLTexture3D;
+ clCreateImage2D;
+ clCreateImage3D;
+ clCreateImageFromD3D10Resource;
+ clCreateKernel;
+ clCreateKernelsInProgram;
+ clCreateProgramWithBinary;
+ clCreateProgramWithSource;
+ clCreateSampler;
+ clEnqueueAcquireExternalObjects;
+ clEnqueueAcquireGLObjects;
+ clEnqueueBarrier;
+ clEnqueueCopyBuffer;
+ clEnqueueCopyBufferToImage;
+ clEnqueueCopyImage;
+ clEnqueueCopyImageToBuffer;
+ clEnqueueMapBuffer;
+ clEnqueueMapImage;
+ clEnqueueMarker;
+ clEnqueueNDRangeKernel;
+ clEnqueueNativeKernel;
+ clEnqueueReadBuffer;
+ clEnqueueReadImage;
+ clEnqueueReleaseExternalObjects;
+ clEnqueueReleaseGLObjects;
+ clEnqueueTask;
+ clEnqueueUnmapMemObject;
+ clEnqueueWaitForEvents;
+ clEnqueueWriteBuffer;
+ clEnqueueWriteImage;
+ clFinish;
+ clFlush;
+ clGetCommandQueueInfo;
+ clGetContextInfo;
+ clGetDeviceIDs;
+ clGetDeviceInfo;
+ clGetEventInfo;
+ clGetEventProfilingInfo;
+ clGetExtensionFunctionAddress;
+ clGetGLObjectInfo;
+ clGetGLTextureInfo;
+ clGetImageInfo;
+ clGetKernelInfo;
+ clGetKernelWorkGroupInfo;
+ clGetMemObjectInfo;
+ clGetPlatformIDs;
+ clGetPlatformInfo;
+ clGetProgramBuildInfo;
+ clGetProgramInfo;
+ clGetSamplerInfo;
+ clGetSupportedImageFormats;
+ clReleaseCommandQueue;
+ clReleaseContext;
+ clReleaseEvent;
+ clReleaseKernel;
+ clReleaseMemObject;
+ clReleaseProgram;
+ clReleaseSampler;
+ clRetainCommandQueue;
+ clRetainContext;
+ clRetainEvent;
+ clRetainKernel;
+ clRetainMemObject;
+ clRetainProgram;
+ clRetainSampler;
+ clSetCommandQueueProperty;
+ clSetKernelArg;
+ clUnloadCompiler;
+ clWaitForEvents;
+ clIcdGetPlatformIDsKHR;
+local:
+ *;
+};
+
+
+OPENCL_1.1 {
+global:
+ clCreateUserEvent;
+ clSetUserEventStatus;
+ clSetEventCallback;
+ clSetMemObjectDestructorCallback;
+ clCreateSubBuffer;
+ clEnqueueReadBufferRect;
+ clEnqueueWriteBufferRect;
+ clEnqueueCopyBufferRect;
+
+ aclGetTargetInfo;
+ aclCompilerInit;
+ aclCompilerFini;
+ aclReadFromMem;
+ aclReadFromFile;
+ aclBinaryInit;
+ aclBinaryFini;
+ aclWriteToMem;
+ aclInsertSection;
+ aclExtractSection;
+ aclRemoveSection;
+ aclQueryInfo;
+ aclDbgAddArgument;
+ aclExtractSymbol;
+ aclInsertSymbol;
+ aclRemoveSymbol;
+ aclCompile;
+ aclInsertKernelStatistics;
+ aclDisassemble;
+} OPENCL_1.0;
+
+OPENCL_1.2 {
+global:
+ clCompileProgram;
+ clCreateFromGLTexture;
+ clCreateImage;
+ clCreateProgramWithBuiltInKernels;
+ clCreateSubDevices;
+ clEnqueueBarrierWithWaitList;
+ clEnqueueFillBuffer;
+ clEnqueueFillImage;
+ clEnqueueMarkerWithWaitList;
+ clEnqueueMigrateMemObjects;
+ clGetExtensionFunctionAddressForPlatform;
+ clGetKernelArgInfo;
+ clLinkProgram;
+ clReleaseDevice;
+ clRetainDevice;
+ clUnloadPlatformCompiler;
+} OPENCL_1.1;
+
+OPENCL_2.0 {
+global:
+ clCreateCommandQueueWithProperties;
+ clCreateSamplerWithProperties;
+ clCreatePipe;
+ clGetPipeInfo;
+ clSVMAlloc;
+ clSVMFree;
+ clSetKernelArgSVMPointer;
+ clSetKernelExecInfo;
+ clEnqueueSVMFree;
+ clEnqueueSVMMemcpy;
+ clEnqueueSVMMemFill;
+ clEnqueueSVMMap;
+ clEnqueueSVMUnmap;
+} OPENCL_1.2;