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
This commit is contained in:
foreman
2016-09-23 18:05:10 -04:00
parent 6e1e293bd7
commit 27bc59ab60
7 changed files with 21 additions and 40 deletions
+3 -3
View File
@@ -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
+2 -8
View File
@@ -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<cl_ulong>(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<cl_ulong>(memInfo.cardMemAvailableBytes + memInfo.cardExtMemAvailableBytes) / 100u);
#else
info_.globalMemSize_ =
(static_cast<cl_ulong>(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
static_cast<cl_ulong>(localRAM) / 100u);
#endif
if (settings().apuSystem_) {
info_.globalMemSize_ +=
(static_cast<cl_ulong>(heaps[Pal::GpuHeapGartUswc].heapSize) * Mi * 75)/100;
+1 -19
View File
@@ -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
@@ -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;
}
}
+1 -1
View File
@@ -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
* @{
+7 -8
View File
@@ -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
+1 -1
View File
@@ -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)
{