From 27bc59ab60a87ea41624f4d75012b74c39913789 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 23 Sep 2016 18:05:10 -0400
Subject: [PATCH] P4 to Git Change 1318397 by gandryey@gera-rcf-lnx on
2016/09/23 17:46:56
SWDEV-86035 - Add PAL backend to OpenCL
- Fix more strict compilation rules in C++11
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/build/Makefile.pal#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.hpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palthreadtrace.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#11 edit
---
rocclr/runtime/device/pal/palcounters.hpp | 6 +++---
rocclr/runtime/device/pal/paldevice.cpp | 10 ++--------
rocclr/runtime/device/pal/paldevicegl.cpp | 20 +-------------------
rocclr/runtime/device/pal/palresource.cpp | 6 ++++++
rocclr/runtime/device/pal/palsettings.hpp | 2 +-
rocclr/runtime/device/pal/palthreadtrace.hpp | 15 +++++++--------
rocclr/runtime/device/pal/palvirtual.hpp | 2 +-
7 files changed, 21 insertions(+), 40 deletions(-)
diff --git a/rocclr/runtime/device/pal/palcounters.hpp b/rocclr/runtime/device/pal/palcounters.hpp
index c0566421f8..f96d055011 100644
--- a/rocclr/runtime/device/pal/palcounters.hpp
+++ b/rocclr/runtime/device/pal/palcounters.hpp
@@ -21,11 +21,11 @@ public:
PalCounterReference(
VirtualGPU& gpu //!< Virtual GPU device object
)
- : perfExp_(nullptr)
- , gpu_(gpu)
+ : gpu_(gpu)
+ , perfExp_(nullptr)
+ , layout_(nullptr)
, memory_(nullptr)
, cpuAddr_(nullptr)
- , layout_(nullptr)
, numExpCounters_(0) {}
//! Get PAL counter
diff --git a/rocclr/runtime/device/pal/paldevice.cpp b/rocclr/runtime/device/pal/paldevice.cpp
index 11696f8bc7..b04f24d3a3 100644
--- a/rocclr/runtime/device/pal/paldevice.cpp
+++ b/rocclr/runtime/device/pal/paldevice.cpp
@@ -264,17 +264,11 @@ void NullDevice::fillDeviceInfo(
uint64_t localRAM = heaps[Pal::GpuHeapLocal].heapSize +
heaps[Pal::GpuHeapInvisible].heapSize;
-#if defined(ATI_OS_LINUX)
- info_.globalMemSize_ =
- (static_cast(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
- // globalMemSize is the actual available size for app on Linux
- // Because Linux base driver doesn't support paging
- static_cast(memInfo.cardMemAvailableBytes + memInfo.cardExtMemAvailableBytes) / 100u);
-#else
+
info_.globalMemSize_ =
(static_cast(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
static_cast(localRAM) / 100u);
-#endif
+
if (settings().apuSystem_) {
info_.globalMemSize_ +=
(static_cast(heaps[Pal::GpuHeapGartUswc].heapSize) * Mi * 75)/100;
diff --git a/rocclr/runtime/device/pal/paldevicegl.cpp b/rocclr/runtime/device/pal/paldevicegl.cpp
index 5745252cf8..f6567dbc6b 100644
--- a/rocclr/runtime/device/pal/paldevicegl.cpp
+++ b/rocclr/runtime/device/pal/paldevicegl.cpp
@@ -76,9 +76,6 @@ Device::initGLInteropPrivateExt(void* GLplatformContext, void* GLdeviceContext)
if (!glXBeginCLInteropAMD || !glXEndCLInteropAMD || !glXResourceAttachAMD ||
!glXResourceDetachAMD
-#ifndef BRAHMA
- || !glXGetContextMVPUInfoAMD
-#endif
) {
return false;
}
@@ -132,22 +129,7 @@ Device::glCanInterop(void* GLplatformContext, void* GLdeviceContext) const
((1 << properties().gpuIndex) == glChainBitMask);
}
#else
-#ifdef BRAHMA
canInteroperate = true;
-#else
- GLuint glDeviceId = 0 ;
- GLuint glChainMask = 0 ;
- GLXContext ctx = (GLXContext)GLplatformContext;
-
- if (glXGetContextMVPUInfoAMD(ctx, &glDeviceId, &glChainMask)) {
- // we allow intoperability only with GL context reside on a single GPU
- canInteroperate =
- (properties().deviceId == glDeviceId) &&
- ((1 << properties().gpuIndex) == glChainBitMask);
-
- }
- }
-#endif
#endif
return canInteroperate;
}
@@ -219,7 +201,7 @@ Device::resGLAssociate(
#ifdef ATI_OS_LINUX
GLXContext ctx = (GLXContext)GLContext;
if (glXResourceAttachAMD(ctx, &hRes, &hData)) {
- attribs.dynamicSharedBufferID = hData->sharedBufferID;
+ //attribs.dynamicSharedBufferID = hData->sharedBufferID;
status = true;
}
#else
diff --git a/rocclr/runtime/device/pal/palresource.cpp b/rocclr/runtime/device/pal/palresource.cpp
index e433dc3e1c..6a87c2a6c3 100644
--- a/rocclr/runtime/device/pal/palresource.cpp
+++ b/rocclr/runtime/device/pal/palresource.cpp
@@ -283,6 +283,9 @@ Resource::~Resource()
case Local:
heap = Pal::GpuHeapInvisible;
break;
+ default:
+ heap = Pal::GpuHeapLocal;
+ break;
}
if ((memRef_ != nullptr) && (heap != Pal::GpuHeapCount)) {
// Update free memory size counters
@@ -379,6 +382,9 @@ Resource::memTypeToHeap(Pal::GpuMemoryCreateInfo* createInfo)
createInfo->heaps[0] = Pal::GpuHeapInvisible;
createInfo->heaps[1] = Pal::GpuHeapLocal;
break;
+ default:
+ createInfo->heaps[0] = Pal::GpuHeapLocal;
+ break;
}
}
diff --git a/rocclr/runtime/device/pal/palsettings.hpp b/rocclr/runtime/device/pal/palsettings.hpp
index d974129f5a..bf7c4ca221 100644
--- a/rocclr/runtime/device/pal/palsettings.hpp
+++ b/rocclr/runtime/device/pal/palsettings.hpp
@@ -5,7 +5,7 @@
#include "top.hpp"
#include "library.hpp"
-#include "inc\core\palDevice.h"
+#include "inc/core/palDevice.h"
/*! \addtogroup pal PAL Resource Implementation
* @{
diff --git a/rocclr/runtime/device/pal/palthreadtrace.hpp b/rocclr/runtime/device/pal/palthreadtrace.hpp
index 929072670a..2c7fbc4423 100644
--- a/rocclr/runtime/device/pal/palthreadtrace.hpp
+++ b/rocclr/runtime/device/pal/palthreadtrace.hpp
@@ -22,10 +22,11 @@ public:
PalThreadTraceReference(
VirtualGPU& gpu //!< Virtual GPU device object
)
- : perfExp_(nullptr)
- , gpu_(gpu)
+ : gpu_(gpu)
+ , perfExp_(nullptr)
+ , layout_(nullptr)
, memory_(nullptr)
- , layout_(nullptr) {}
+ {}
//! Get PAL thread race object
Pal::IPerfExperiment* iPerf() const { return perfExp_; }
@@ -70,16 +71,14 @@ public:
)
: gpuDevice_(device)
, palRef_(palRef)
- , memObj_(memObjs)
, numSe_(numSe)
- {
-
- }
+ , memObj_(memObjs)
+ {}
//! Destructor for the GPU ThreadTrace object
virtual ~ThreadTrace();
- //! Creates the current object
+ //! Creates the current object4
bool create();
// Populate ThreadTrace memory with PerfExperiment memory
diff --git a/rocclr/runtime/device/pal/palvirtual.hpp b/rocclr/runtime/device/pal/palvirtual.hpp
index fe1cc33c80..2db08ea683 100644
--- a/rocclr/runtime/device/pal/palvirtual.hpp
+++ b/rocclr/runtime/device/pal/palvirtual.hpp
@@ -54,7 +54,7 @@ public:
);
Queue(Pal::IDevice* palDev)
- : iDev_(palDev), iQueue_(NULL),
+ : iQueue_(NULL), iDev_(palDev),
cmdBufIdSlot_(StartCmdBufIdx), cmdBufIdCurrent_(StartCmdBufIdx),
cmbBufIdRetired_(0), cmdCnt_(0), vlAlloc_(64 * Ki)
{