Skip to content

Commit

Permalink
Added isManaged to if statement check
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkusiak97 committed Mar 5, 2024
1 parent 19df225 commit e6dfc62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/adapters/hip/enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,10 @@ ur_result_t commonMemSetLargePattern(hipStream_t Stream, uint32_t PatternSize,
hipPointerAttribute_t ptrAttribs{};
UR_CHECK_ERROR(hipPointerGetAttributes(&ptrAttribs, (const void *)Ptr));

if (ptrAttribs.hostPointer) {
// The hostPointer attribute is non-null also for shared memory allocations.
// To make sure that this workaround only executes for host pinned memory, we
// need to check that isManaged attribute is false.
if (ptrAttribs.hostPointer && !ptrAttribs.isManaged) {
const auto NumOfCopySteps = Size / PatternSize;
const auto Offset = sizeof(uint32_t);
const auto LeftPatternSize = PatternSize - Offset;
Expand Down

0 comments on commit e6dfc62

Please sign in to comment.