From 71f9ee36c01decc685e4d402457dda06ccc29230 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 6 Nov 2014 15:51:20 -0500
Subject: [PATCH] P4 to Git Change 1094478 by xcui@merged_opencl_jxcwin on
2014/11/06 14:40:09
EPR #408459 - added an env variable OCL_FORCE_CPU_SVM in the runtime, so that the svm feature for CPU can be enabled manually even for non OpenCL 2.0 support for CPU device.
code review:
http://ocltc.amd.com/reviews/r/6190/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.cpp#268 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#218 edit
[ROCm/clr commit: b124582a389732b6e0e2cc80062396e7352ca491]
---
projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp | 2 +-
projects/clr/rocclr/runtime/utils/flags.hpp | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp b/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp
index a305a9f961..bf39c6a7dd 100644
--- a/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp
+++ b/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp
@@ -266,7 +266,7 @@ Device::init()
info.executionCapabilities_ = CL_EXEC_KERNEL | CL_EXEC_NATIVE_KERNEL;
// Enable SVM only for OpenCL 2.0
- if ((OPENCL_MAJOR >= 2) && (CPU_OPENCL_VERSION >= 200)) {
+ if (((OPENCL_MAJOR >= 2) && (CPU_OPENCL_VERSION >= 200)) || OCL_FORCE_CPU_SVM) {
info.svmCapabilities_ = CL_DEVICE_SVM_COARSE_GRAIN_BUFFER |
CL_DEVICE_SVM_FINE_GRAIN_BUFFER |
CL_DEVICE_SVM_FINE_GRAIN_SYSTEM |
diff --git a/projects/clr/rocclr/runtime/utils/flags.hpp b/projects/clr/rocclr/runtime/utils/flags.hpp
index 05a4710960..a32e4132aa 100644
--- a/projects/clr/rocclr/runtime/utils/flags.hpp
+++ b/projects/clr/rocclr/runtime/utils/flags.hpp
@@ -170,6 +170,9 @@ release(bool, HSAIL_IMAGE_HANDLE_ENABLE, false, \
"Pass image/sampler SRD as pointer instead of blob") \
debug(bool, GPU_FORCE_SINGLE_FP_DENORM, false, \
"Forces reporting CL_FP_DENORM bit for single precision") \
+debug(bool, OCL_FORCE_CPU_SVM, false, \
+ "force svm support for CPU") \
+
namespace amd {