From 2fd0a5adaee7dfd6e1a7f20ef4dd8f57c7c447fc Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 22 Nov 2016 15:07:40 -0500 Subject: [PATCH] P4 to Git Change 1344789 by asalmanp@asalmanp-opencl-stg on 2016/11/22 14:56:48 SWDEV-107075 - [OCL][VG10] progvar_prog_scope_misc subtest of Conf test_basic fails on VG10. Issue: 64GB (instead of 4GB) was used as the maximum single allocation size in PAL which is for workstation boards only. Fix: Added the query to get workstation feature information from PAL to fix this issue. ReviewBoardsURL = http://ocltc.amd.com/reviews/r/11881/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#36 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#12 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#6 edit --- rocclr/runtime/device/pal/paldevice.cpp | 9 +++++++-- rocclr/runtime/device/pal/palsettings.cpp | 3 ++- rocclr/runtime/device/pal/palsettings.hpp | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rocclr/runtime/device/pal/paldevice.cpp b/rocclr/runtime/device/pal/paldevice.cpp index 2d36aa0290..a03c69f90b 100644 --- a/rocclr/runtime/device/pal/paldevice.cpp +++ b/rocclr/runtime/device/pal/paldevice.cpp @@ -177,8 +177,10 @@ NullDevice::create(Pal::AsicRevision asicRevision, Pal::GfxIpLevel ipLevel) Pal::GpuMemoryHeapProperties heaps[Pal::GpuHeapCount]; heaps[Pal::GpuHeapLocal].heapSize = 512 * Mi; + Pal::WorkStationCaps wscaps = {}; + // Create setting for the offline target - if ((palSettings == nullptr) || !palSettings->create(properties, heaps)) { + if ((palSettings == nullptr) || !palSettings->create(properties, heaps, wscaps)) { return false; } @@ -763,11 +765,14 @@ Device::create(Pal::IDevice* device) Pal::GpuMemoryHeapProperties heaps[Pal::GpuHeapCount]; iDev()->GetGpuMemoryHeapProperties(heaps); + Pal::WorkStationCaps wscaps = {}; + iDev()->QueryWorkStationCaps(&wscaps); + // Creates device settings settings_ = new pal::Settings(); pal::Settings* gpuSettings = reinterpret_cast(settings_); if ((gpuSettings == nullptr) || !gpuSettings->create(properties(), heaps, - appProfile_.reportAsOCL12Device())) { + wscaps, appProfile_.reportAsOCL12Device())) { return false; } numComputeEngines_ = std::min(numComputeEngines_, settings().numComputeRings_); diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp index 7df2023cbb..7aa4080150 100644 --- a/rocclr/runtime/device/pal/palsettings.cpp +++ b/rocclr/runtime/device/pal/palsettings.cpp @@ -141,6 +141,7 @@ bool Settings::create( const Pal::DeviceProperties& palProp, const Pal::GpuMemoryHeapProperties* heaps, + const Pal::WorkStationCaps& wscaps, bool reportAsOCL12Device ) { @@ -257,7 +258,7 @@ Settings::create( supportDepthsRGB_ = true; } if (use64BitPtr_) { - if (GPU_ENABLE_LARGE_ALLOCATION /*&& calAttr.isWorkstation*/) { + if (GPU_ENABLE_LARGE_ALLOCATION && wscaps.workStationBoard) { maxAllocSize_ = 64ULL * Gi; } else { diff --git a/rocclr/runtime/device/pal/palsettings.hpp b/rocclr/runtime/device/pal/palsettings.hpp index bf7c4ca221..c8e33b94fb 100644 --- a/rocclr/runtime/device/pal/palsettings.hpp +++ b/rocclr/runtime/device/pal/palsettings.hpp @@ -105,6 +105,7 @@ public: bool create( const Pal::DeviceProperties& palProp, //!< PAL device properties const Pal::GpuMemoryHeapProperties* heaps, //!< PAL heap settings + const Pal::WorkStationCaps& wscaps, //!< PAL workstation settings bool reportAsOCL12Device = false //!< Report As OpenCL1.2 Device );