From 8a82228927d5c4fe2198240ca96be2c16b54ff86 Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 4 Nov 2015 17:14:47 -0500 Subject: [PATCH] P4 to Git Change 1207590 by xcui@merged_opencl_jxcwin on 2015/11/04 16:20:09 SWDEV-80174 - added an env variable OCL_SET_SVM_SIZE to change the SVM size of the device, if it support SVM. This is part of implemenation to change SVM size based on system memory size and device memory size. This is the changes in OpenCL side. code review: http://ocltc.amd.com/reviews/r/8893/ precheckin: http://ocltc.amd.com:8111/viewModification.html?modId=61653&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#149 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#246 edit --- rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 4 ++++ rocclr/runtime/utils/flags.hpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp index 904f18820c..fed1771593 100644 --- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp +++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp @@ -207,6 +207,10 @@ CALGSLDevice::open(uint32 gpuIndex, bool enableHighPerformanceState, bool report m_dcfg.syncObjectMode.value = (GPU_USE_SYNC_OBJECTS) ? GSL_CONFIG_SYNCOBJECT_MODE_ON : GSL_CONFIG_SYNCOBJECT_MODE_OFF; + // Use OCL_SET_SVM_SIZE to set SVM size we need + m_dcfg.ndevSVMSize.hasValue = true; + m_dcfg.ndevSVMSize.value = OCL_SET_SVM_SIZE; + // Use GPU_IFH_MODE to test with IFH mode enabled m_dcfg.DropFlush.hasValue = true; m_dcfg.DropFlush.value = (GPU_IFH_MODE == 1); diff --git a/rocclr/runtime/utils/flags.hpp b/rocclr/runtime/utils/flags.hpp index 413c313083..7836a79d8a 100644 --- a/rocclr/runtime/utils/flags.hpp +++ b/rocclr/runtime/utils/flags.hpp @@ -170,6 +170,8 @@ release(int, AMD_GPU_FORCE_SINGLE_FP_DENORM, -1, \ "Force denorm for single precision: -1 - don't force, 0 - disable, 1 - enable") \ debug(bool, OCL_FORCE_CPU_SVM, false, \ "force svm support for CPU") \ +debug(uint, OCL_SET_SVM_SIZE, 4096, \ + "set SVM space size for discrete GPU") \ debug(uint, OCL_SYSMEM_REQUIREMENT, 2, \ "Use flag to change the minimum requirement of system memory not to downgrade") \ debug(bool, GPU_ENABLE_HW_DEBUG, false, \