From 1f24dbadddfcba9abfdeef82da7c546da727a1cf Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 1 May 2017 15:54:18 -0500
Subject: [PATCH] P4 to Git Change 1404293 by lmoriche@lmoriche_opencl_dev2 on
2017/05/01 16:43:07
SWDEV-102726 - [OCL-LC-ROCm] Open source OpenCL Runtime
- Changes required to use the Khronos ICD sources instead of ours.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd.cpp#29 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpubinary.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpubinary.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#319 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#127 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#233 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#239 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/object.hpp#18 edit
[ROCm/clr commit: 26720154d984c14330b8391f79ec4fdec8e5c876]
---
projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt | 2 +-
projects/clr/opencl/api/opencl/amdocl/cl_gl.cpp | 2 +-
projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp | 2 +-
.../api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
index 5075f2a2cf..d072f23225 100644
--- a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
+++ b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
@@ -3,7 +3,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")
-add_definitions(-DLINUX -D__x86_64__ -D__AMD64__ -DUNIX_OS -DqLittleEndian -DAMD_LIBELF -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_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DWITH_VERSION_0_8=1 -DVEGA10_ONLY=false -DWITH_LIGHTNING_COMPILER)
+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)
include_directories(${CMAKE_SOURCE_DIR}/runtime)
include_directories(${CMAKE_SOURCE_DIR}/api/opencl)
diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_gl.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_gl.cpp
index 1ff3289496..f7a8bdedea 100644
--- a/projects/clr/opencl/api/opencl/amdocl/cl_gl.cpp
+++ b/projects/clr/opencl/api/opencl/amdocl/cl_gl.cpp
@@ -1857,7 +1857,7 @@ cl_mem clCreateFromGLTextureAMD(Context& amdContext, cl_mem_flags clFlags, GLenu
// Get GL texture format and check if it's compatible with CL format
clearGLErrors(amdContext);
- amdContext.glenv()->glGetIntegerv_(GL_TEXTURE_BUFFER_FORMAT,
+ amdContext.glenv()->glGetIntegerv_(GL_TEXTURE_BUFFER_FORMAT_EXT,
reinterpret_cast(&glInternalFormat));
if (GL_NO_ERROR != (glErr = amdContext.glenv()->glGetError_())) {
*not_null(errcode_ret) = CL_INVALID_IMAGE_FORMAT_DESCRIPTOR;
diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp
index 8c73752645..2174e7fdd0 100644
--- a/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp
+++ b/projects/clr/opencl/api/opencl/amdocl/cl_icd.cpp
@@ -100,7 +100,7 @@ KHRicdVendorDispatch amd::ICDDispatchedObject::icdVendorDispatch_[] = {
clEnqueueSVMFree, clEnqueueSVMMemcpy, clEnqueueSVMMemFill, clEnqueueSVMMap, clEnqueueSVMUnmap,
clCreateSamplerWithProperties, clSetKernelArgSVMPointer, clSetKernelExecInfo,
- clGetKernelSubGroupInfoKHR, clTerminateContextKHR, clCreateProgramWithILKHR}};
+ clGetKernelSubGroupInfoKHR}};
#if defined(ATI_OS_WIN)
#include
diff --git a/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h b/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h
index 4ab5e791af..5a93514f87 100644
--- a/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h
+++ b/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h
@@ -85,6 +85,8 @@ extern "C" {
#define CL_EXT_SUFFIX__VERSION_1_2
#define CL_API_SUFFIX__VERSION_2_0
#define CL_EXT_SUFFIX__VERSION_2_0
+ #define CL_API_SUFFIX__VERSION_2_1
+ #define CL_EXT_SUFFIX__VERSION_2_1
#ifdef __GNUC__
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS