From 73b57f8baec7aa7603b7322d07d3c6b531c2d48f Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 30 Sep 2019 10:08:58 -0400
Subject: [PATCH] P4 to Git Change 2006323 by jujiang@JJ-OCL-hip on 2019/09/30
10:01:50
SWDEV-192384 - [HIP CQE][HIPonPAL][19.40] hipBindTexRef1DFetch, hipTextureRef2D are failed on all ASICs for both Win/Lnx
Add undefined memory object in PAL process memory objects.
http://ocltc.amd.com/reviews/r/18055/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#33 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#154 edit
---
rocclr/runtime/device/devprogram.hpp | 2 ++
rocclr/runtime/device/pal/palvirtual.cpp | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/rocclr/runtime/device/devprogram.hpp b/rocclr/runtime/device/devprogram.hpp
index a597f97379..5f292a5143 100644
--- a/rocclr/runtime/device/devprogram.hpp
+++ b/rocclr/runtime/device/devprogram.hpp
@@ -215,6 +215,8 @@ class Program : public amd::HeapObject {
//! Global variables are a part of the code segment
bool hasGlobalStores() const { return hasGlobalStores_; }
+ std::vector getUndefMemObj() const { return undef_mem_obj_; }
+
#if defined(USE_COMGR_LIBRARY)
const amd_comgr_metadata_node_t* metadata() const { return metadata_; }
diff --git a/rocclr/runtime/device/pal/palvirtual.cpp b/rocclr/runtime/device/pal/palvirtual.cpp
index 925e238b51..da8a617cb1 100644
--- a/rocclr/runtime/device/pal/palvirtual.cpp
+++ b/rocclr/runtime/device/pal/palvirtual.cpp
@@ -3495,7 +3495,12 @@ bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address p
if (hsaKernel.prog().hasGlobalStores()) {
// Validate code object for a dependency in the queue
memoryDependency().validate(*this, &hsaKernel.prog().codeSegGpu(), IsReadOnly);
+ std::vector undefined = hsaKernel.prog().getUndefMemObj();
+ for (auto it = undefined.begin(); it != undefined.end(); ++it) {
+ addVmMemory(dev().getGpuMemory(*it));
+ }
}
+
addVmMemory(&hsaKernel.prog().codeSegGpu());
if (hsaKernel.workGroupInfo()->scratchRegs_ > 0) {