diff --git a/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute.cc b/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute.cc index 447a3a0b56..ed58d0e272 100644 --- a/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute.cc +++ b/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute.cc @@ -267,7 +267,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_MultiDevice") { LinearAllocGuard allocation(LinearAllocs::hipMallocManaged, kPageSize); std::vector data(device_count); - HIP_CHECK(hipMemRangeGetAttribute(data.data(), sizeof(data), hipMemRangeAttributeAccessedBy, + HIP_CHECK(hipMemRangeGetAttribute(data.data(), sizeof(int32_t) * data.size(), hipMemRangeAttributeAccessedBy, allocation.ptr(), kPageSize)); for (auto device : data) { @@ -278,7 +278,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_MultiDevice") { HIP_CHECK(hipMemAdvise(allocation.ptr(), kPageSize, hipMemAdviseSetAccessedBy, device)); } - HIP_CHECK(hipMemRangeGetAttribute(data.data(), sizeof(data), hipMemRangeAttributeAccessedBy, + HIP_CHECK(hipMemRangeGetAttribute(data.data(), sizeof(int32_t) * data.size(), hipMemRangeAttributeAccessedBy, allocation.ptr(), kPageSize)); // Use std::find since there is no guaranteed order in which devices will be returned