From 8f7acbdadbedb45ce329fd4487b2db2f726dd72f Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi Date: Wed, 6 Mar 2024 18:33:30 +0000 Subject: [PATCH] SWDEV-446610 - Attribute HIP_POINTER_ATTRIBUTE_SYNC_MEMOPS should return the correct value Change-Id: Ieced2ee61bba28f2d1df96893a661287b0a5c7b7 --- hipamd/src/hip_memory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 7a317c8848..4db03a156c 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -3739,8 +3739,12 @@ hipError_t ihipPointerGetAttributes(void* data, hipPointer_attribute attribute, break; } case HIP_POINTER_ATTRIBUTE_SYNC_MEMOPS : { - // This attribute is ideally used in hipPointerSetAttribute, defaults to true - *reinterpret_cast(data) = true; + if (memObj) { + *reinterpret_cast(data) = memObj->getUserData().sync_mem_ops_; + } else { + *reinterpret_cast(data) = false; + return hipErrorInvalidValue; + } break; } case HIP_POINTER_ATTRIBUTE_BUFFER_ID : {