From d33f062a8e066bf0a035a9f473c19e0e6c0178f2 Mon Sep 17 00:00:00 2001 From: foreman Date: Fri, 3 Oct 2014 21:28:36 -0400 Subject: [PATCH] P4 to Git Change 1084301 by xcui@merged_opencl_jxcwin on 2014/10/03 21:15:33 EPR #406328 - changed the device open algorithm so that the we only open the first OpenCL device. This is the OPENCL runtime changes, but this will be removed once we implemented multiple device support for SVM. the code review and precheckin test: http://ocltc.amd.com/reviews/r/5942/ http://ocltc.amd.com:8111/viewModification.html?modId=40902&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#466 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#287 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.hpp#87 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/include/cal/cal.h#29 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#100 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.h#40 edit [ROCm/clr commit: c248f04970324ff63a99392bedbd4105fc0a41e8] --- projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 7 ++----- projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp | 7 ++----- .../rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h | 1 + .../rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 1 + .../clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h | 1 + 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp index be0216c447..cbb025eab9 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp @@ -756,11 +756,8 @@ Device::create(CALuint ordinal, CALuint numOfDevices) appProfile_.init(); // Open GSL device - bool reportOCL12Device = (OPENCL_VERSION < 200); - - reportOCL12Device = (numOfDevices < 2) ? (OPENCL_VERSION < 200) : true; if (!open(ordinal, appProfile_.enableHighPerformanceState(), - appProfile_.reportAsOCL12Device() || reportOCL12Device)) { + appProfile_.reportAsOCL12Device())) { return false; } @@ -775,7 +772,7 @@ Device::create(CALuint ordinal, CALuint numOfDevices) #if cl_amd_open_video , getVideoAttribs() #endif // cl_amd_open_video - , appProfile_.reportAsOCL12Device() || reportOCL12Device + , appProfile_.reportAsOCL12Device() )) { return false; } diff --git a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp index 8a446bc4b5..10fbac7c4c 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp @@ -291,14 +291,11 @@ Settings::create( if (ciPlus_) { libSelector_ = amd::GPU_Library_CI; #if defined(_LP64) - oclVersion_ = reportAsOCL12Device ? OpenCL12 : XCONCAT(OpenCL,XCONCAT(OPENCL_MAJOR,OPENCL_MINOR)); + oclVersion_ = !reportAsOCL12Device && calAttr.isOpenCL200Device ? XCONCAT(OpenCL, XCONCAT(OPENCL_MAJOR, OPENCL_MINOR)) : OpenCL12; #endif - if (calAttr.numOfVpu > 1) { - oclVersion_ = OpenCL12; - } if (GPU_FORCE_OCL20_32BIT) { force32BitOcl20_ = true; - oclVersion_ = reportAsOCL12Device ? OpenCL12 : XCONCAT(OpenCL,XCONCAT(OPENCL_MAJOR,OPENCL_MINOR)); + oclVersion_ = !reportAsOCL12Device && calAttr.isOpenCL200Device ? XCONCAT(OpenCL, XCONCAT(OPENCL_MAJOR, OPENCL_MINOR)) : OpenCL12; } if (hsail_ || (OPENCL_VERSION < 200)) { oclVersion_ = OpenCL12; diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h index caef5dff22..a9b8b14608 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h @@ -238,6 +238,7 @@ typedef struct CALdeviceattribsRec { CALuint64 vaEnd; /**< VA end address */ bool isWorkstation; /**< Whether Device is a Workstation/Server part */ CALuint numOfVpu; /**< number of vpu in the device*/ + bool isOpenCL200Device; /**< the flag to mark if the device is OpenCL 200*/ } CALdeviceattribs; /** CAL device status */ diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp index 8f82725d0e..3af8cb0ea0 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp @@ -155,6 +155,7 @@ CALGSLDevice::getAttribs_int(gsl::gsCtx* cs) m_attribs.vaStart = static_cast(m_adp->pAsicInfo->vaStart); m_attribs.vaEnd = static_cast(m_adp->pAsicInfo->vaEnd); m_attribs.numOfVpu = m_adp->pAsicInfo->numberOfVPU; + m_attribs.isOpenCL200Device = m_adp->pAsicInfo->bIsOpen2Device; } void diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h index c0ed5bb5d1..121f6c26cb 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h @@ -209,6 +209,7 @@ private: CALdevicestatus m_deviceStatus; gslTextureResourceObject m_textureResource; gslSamplerObject m_textureSampler; + bool m_isOpenCL200Device; union { struct {