From 2c80f84e379793eb77b330309c2bc9b2c6837cdc Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 30 Oct 2017 17:44:53 -0400
Subject: [PATCH] P4 to Git Change 1476496 by gandryey@gera-w8 on 2017/10/30
17:36:16
SWDEV-79445 - Fix a crash on rocm systems
- Allow the persistent direct map only if persistent_host_ptr_ is available. On Rocm setup without amdgpu-pro OCL will use system memory instead of persistent
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#11 edit
[ROCm/clr commit: bea710d2e590debcdaf444233c2069470cae6da6]
---
projects/clr/rocclr/runtime/device/rocm/rocmemory.hpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/rocm/rocmemory.hpp b/projects/clr/rocclr/runtime/device/rocm/rocmemory.hpp
index 1fd7ae00e4..bf99546a74 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rocmemory.hpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rocmemory.hpp
@@ -85,8 +85,7 @@ class Memory : public device::Memory {
size_t version() const { return version_; }
- bool IsPersistentDirectMap() const {
- return ((owner() != nullptr) && (owner()->getMemFlags() & CL_MEM_USE_PERSISTENT_MEM_AMD)); }
+ bool IsPersistentDirectMap() const { return (persistent_host_ptr_ != nullptr); }
void* PersistentHostPtr() const { return persistent_host_ptr_; }