From 6b2cb94b8455aa4c8c93a04e1bded4cb99f40c0d Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 17 May 2017 22:31:48 -0400
Subject: [PATCH] P4 to Git Change 1410993 by lmoriche@lmoriche_opencl_dev2 on
2017/05/17 22:25:50
SWDEV-102733 - [OCL-LC-ROCm] Cmake build Write CMakeLists.txt to enable building with and without the DK environment
- Make it possible to use cl2.hpp
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/tools/clinfo/clinfo.cpp#3 edit
[ROCm/clr commit: 842f311464cdb5d08f03e305add174f54e3eb9d3]
---
.../opencl/khronos/headers/opencl2.0/CL/cl2.hpp | 5 ++++-
projects/clr/opencl/tools/clinfo/clinfo.cpp | 14 +++++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp b/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp
index 534c486988..df9dd4a2d6 100644
--- a/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp
+++ b/projects/clr/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp
@@ -1235,6 +1235,9 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
F(cl_device_info, CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT, cl_uint) \
F(cl_device_info, CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT, cl_uint) \
F(cl_device_info, CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT, cl_uint) \
+ F(cl_device_info, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, size_type) \
+ F(cl_device_info, CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, size_type) \
+ F(cl_device_info, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, cl_uint) \
F(cl_command_queue_info, CL_QUEUE_SIZE, cl_uint) \
F(cl_mem_info, CL_MEM_USES_SVM_POINTER, cl_bool) \
F(cl_program_build_info, CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE, size_type) \
@@ -6513,7 +6516,7 @@ inline cl_int cl::Program::getInfo(cl_program_info name, vectorresize(numBinaries);
- for (int i = 0; i < numBinaries; ++i) {
+ for (size_type i = 0; i < numBinaries; ++i) {
(*param)[i].resize(sizes[i]);
}
diff --git a/projects/clr/opencl/tools/clinfo/clinfo.cpp b/projects/clr/opencl/tools/clinfo/clinfo.cpp
index 6a24e93742..48a3d0094b 100644
--- a/projects/clr/opencl/tools/clinfo/clinfo.cpp
+++ b/projects/clr/opencl/tools/clinfo/clinfo.cpp
@@ -100,15 +100,23 @@ jurisdiction and venue of these courts.
#include
#endif
-#define __CL_ENABLE_EXCEPTIONS
-#define __MAX_DEFAULT_VECTOR_SIZE 50
-
#ifdef _MSC_VER
#pragma warning(disable: 4290)
#endif
+
+#if defined(HAVE_CL2_HPP)
+#define CL_HPP_ENABLE_EXCEPTIONS
+#define CL_HPP_MINIMUM_OPENCL_VERSION 120
+#define CL_HPP_TARGET_OPENCL_VERSION 200
+#define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY
+#include "CL/cl2.hpp"
+#else // !HAVE_CL2_HPP
+#define __CL_ENABLE_EXCEPTIONS
+#define __MAX_DEFAULT_VECTOR_SIZE 50
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#include "cl.hpp"
+#endif // !HAVE_CL2_HPP
bool verbose = false;