From 98366d2b593ca3a4aea17e770c9d4d3541183a4b Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 25 Sep 2017 18:16:57 -0400
Subject: [PATCH] P4 to Git Change 1463068 by lmoriche@lmoriche_opencl_dev2 on
2017/09/25 17:58:14
SWDEV-86035 - Fix OCL/PAL build on Linux
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#38 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#34 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#60 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#33 edit
---
rocclr/runtime/device/pal/paldefs.hpp | 4 ++--
rocclr/runtime/device/pal/palresource.cpp | 6 ++++--
rocclr/runtime/device/pal/palsettings.cpp | 2 ++
rocclr/runtime/device/pal/palvirtual.cpp | 12 +-----------
rocclr/runtime/device/pal/palvirtual.hpp | 10 ++++++++++
5 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/rocclr/runtime/device/pal/paldefs.hpp b/rocclr/runtime/device/pal/paldefs.hpp
index b8804986e2..366f078da3 100644
--- a/rocclr/runtime/device/pal/paldefs.hpp
+++ b/rocclr/runtime/device/pal/paldefs.hpp
@@ -50,9 +50,9 @@ struct GpuEvent {
uint32_t engineId_ : 1; ///< type of the id
};
//! GPU event default constructor
- GpuEvent() : engineId_(MainEngine), id(InvalidID) {}
+ GpuEvent() : id(InvalidID), engineId_(MainEngine) {}
//! GPU event constructor
- GpuEvent(uint evt) : engineId_(MainEngine), id(evt) {}
+ GpuEvent(uint evt) : id(evt), engineId_(MainEngine) {}
//! Returns true if the current event is valid
bool isValid() const { return (id != InvalidID) ? true : false; }
diff --git a/rocclr/runtime/device/pal/palresource.cpp b/rocclr/runtime/device/pal/palresource.cpp
index 36a971ec85..d333bbdecd 100644
--- a/rocclr/runtime/device/pal/palresource.cpp
+++ b/rocclr/runtime/device/pal/palresource.cpp
@@ -146,7 +146,7 @@ GpuMemoryReference* GpuMemoryReference::Create(const Device& dev,
}
GpuMemoryReference::GpuMemoryReference(const Device& dev)
- : gpuMem_(nullptr), cpuAddress_(nullptr), events_(dev.numOfVgpus()), device_(dev), gpu_(nullptr) {}
+ : gpuMem_(nullptr), cpuAddress_(nullptr), device_(dev), gpu_(nullptr), events_(dev.numOfVgpus()) {}
GpuMemoryReference::~GpuMemoryReference() {
if (gpu_ == nullptr) {
@@ -1217,7 +1217,9 @@ bool Resource::partialMemCopyTo(VirtualGPU& gpu, const amd::Coord3D& srcOrigin,
calSize[1] = size[1];
calSize[2] = size[2];
- uint64_t gpuMemoryOffset, gpuMemoryRowPitch, imageOffsetx;
+ uint64_t gpuMemoryOffset = 0;
+ uint64_t gpuMemoryRowPitch = 0;
+ uint64_t imageOffsetx = 0;
bool img1Darray = false;
bool img2Darray = false;
diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp
index 2fb52673a1..bfbf019c16 100644
--- a/rocclr/runtime/device/pal/palsettings.cpp
+++ b/rocclr/runtime/device/pal/palsettings.cpp
@@ -416,6 +416,8 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
case Pal::GfxIpLevel::GfxIp9:
singleFpDenorm_ = true;
break;
+ default:
+ break;
}
#endif // WITH_LIGHTNING_COMPILER
diff --git a/rocclr/runtime/device/pal/palvirtual.cpp b/rocclr/runtime/device/pal/palvirtual.cpp
index 3f4062e5f4..0988d6c96f 100644
--- a/rocclr/runtime/device/pal/palvirtual.cpp
+++ b/rocclr/runtime/device/pal/palvirtual.cpp
@@ -175,7 +175,7 @@ void VirtualGPU::Queue::removeCmdMemRef(GpuMemoryReference* mem) {
}
void VirtualGPU::Queue::addCmdDoppRef(Pal::IGpuMemory* iMem, bool lastDoppCmd, bool pfpaDoppCmd) {
- for (int i = 0; i < palDoppRefs_.size(); i++) {
+ for (size_t i = 0; i < palDoppRefs_.size(); i++) {
if (palDoppRefs_[i].pGpuMemory == iMem) {
// If both LAST_DOPP_SUBMISSION and PFPA_DOPP_SUBMISSION VCOPs are requested,
// the LAST_DOPP_SUBMISSION is send as requsted by KMD
@@ -2944,16 +2944,6 @@ bool VirtualGPU::profilingCollectResults(CommandBatch* cb, const amd::Event* wai
return found;
}
-void VirtualGPU::addVmMemory(const Memory* memory) {
- GpuEvent event(queues_[MainEngine]->cmdBufId());
- queues_[MainEngine]->addCmdMemRef(memory->memRef());
- memory->setBusy(*this, event);
-}
-
-void VirtualGPU::AddKernel(const amd::Kernel& kernel) const {
- queues_[MainEngine]->last_kernel_ = &kernel;
-}
-
void VirtualGPU::addDoppRef(const Memory* memory, bool lastDoppCmd, bool pfpaDoppCmd) {
queues_[MainEngine]->addCmdDoppRef(memory->iMem(), lastDoppCmd, pfpaDoppCmd);
}
diff --git a/rocclr/runtime/device/pal/palvirtual.hpp b/rocclr/runtime/device/pal/palvirtual.hpp
index 2ec48ecdfc..6b0d2dcd54 100644
--- a/rocclr/runtime/device/pal/palvirtual.hpp
+++ b/rocclr/runtime/device/pal/palvirtual.hpp
@@ -625,4 +625,14 @@ class VirtualGPU : public device::VirtualDevice {
MemoryRange sdmaRange_; //!< SDMA memory range for write access
};
+inline void VirtualGPU::addVmMemory(const Memory* memory) {
+ GpuEvent event(queues_[MainEngine]->cmdBufId());
+ queues_[MainEngine]->addCmdMemRef(memory->memRef());
+ memory->setBusy(*this, event);
+}
+
+inline void VirtualGPU::AddKernel(const amd::Kernel& kernel) const {
+ queues_[MainEngine]->last_kernel_ = &kernel;
+}
+
/*@}*/} // namespace pal