From 6f952b41436bd9b865e485a21f36c8cede9e5701 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 5 Apr 2018 15:07:52 -0400
Subject: [PATCH] P4 to Git Change 1537231 by gandryey@gera-lnx-rcf on
2018/04/05 14:59:30
SWDEV-149330 - [CQE OCL][Vega10][PAL] ocltst - OCLFoldLibFunc a sub-test of oclcompiler module fails on Vega10 PAL/HSAIL path | Faulty PAL/HSAIL CL#1524674
- Reset offset to 0 for each Resource::create() call, since runtime could call create() more than once if the initial memtype failed.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#61 edit
[ROCm/clr commit: e658a8fe6fa42fc711a4331653d6b74504f33299]
---
projects/clr/rocclr/runtime/device/pal/palresource.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/projects/clr/rocclr/runtime/device/pal/palresource.cpp b/projects/clr/rocclr/runtime/device/pal/palresource.cpp
index a4d88cc5de..db95809669 100644
--- a/projects/clr/rocclr/runtime/device/pal/palresource.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palresource.cpp
@@ -1046,6 +1046,9 @@ bool Resource::create(MemoryType memType, CreateParams* params) {
uint viewFlags = 0;
Pal::ChannelMapping channels;
Pal::ChNumFormat format = dev().getPalFormat(desc().format_, &channels);
+ // Set the initial offset value for any resource to 0.
+ // Note: Runtime can call create() more than once, if the initial memory type failed
+ offset_ = 0;
// This is a thread safe operation
const_cast(dev()).initializeHeapResources();