Skip to content

Commit 6bae452

Browse files
committed
Disable map checks in usm mode, to overcome bug preventing removal of map information when exiting target data environment.
https://ontrack-internal.amd.com/browse/SWDEV-336718 Change-Id: Ie81262cd019cb21031eecd675e12cbb3a1bf7bdb
1 parent c6cec53 commit 6bae452

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

openmp/libomptarget/include/rtl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ struct RTLsTy {
140140
int64_t RequiresFlags = OMP_REQ_UNDEFINED;
141141

142142
// Set by OMPX_DISABLE_MAPS environment variable.
143-
// When active, maps are ignored by the runtime
144-
bool NoUSMMapChecks = false;
143+
// When active (default state), maps are ignored by the runtime
144+
bool NoUSMMapChecks = true;
145145

146146
explicit RTLsTy() = default;
147147

openmp/libomptarget/src/device.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ DeviceTy::getTargetPointer(void *HstPtrBegin, void *HstPtrBase, int64_t Size,
261261
// In addition to the mapping rules above, the close map modifier forces the
262262
// mapping of the variable to the device.
263263
if (Size) {
264+
// When allocating under unified_shared_memory, amdgpu plugin
265+
// can optimize memory access latency by registering allocated
266+
// memory as coarse_grain
267+
if (HstPtrBegin && RTL->set_coarse_grain_mem_region)
268+
RTL->set_coarse_grain_mem_region(HstPtrBegin, Size);
269+
264270
if (!PM->RTLs.NoUSMMapChecks) {
265-
// When allocating under unified_shared_memory, amdgpu plugin
266-
// can optimize memory access latency by registering allocated
267-
// memory as coarse_grain
268-
if (HstPtrBegin && RTL->set_coarse_grain_mem_region)
269-
RTL->set_coarse_grain_mem_region(HstPtrBegin, Size);
270-
271-
// even under unified_shared_memory need to check for correctness of
272-
// use of map clauses. device pointer is same as host ptr in this case
271+
// even under unified_shared_memory need to check for correctness of
272+
// use of map clauses. device pointer is same as host ptr in this case
273273
Entry =
274274
HostDataToTargetMap
275275
.emplace((uintptr_t)HstPtrBase, (uintptr_t)HstPtrBegin,

0 commit comments

Comments
 (0)