From 955adddd6311140345ee939c5d2d79668d485bf8 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Tue, 30 Apr 2024 15:04:47 -0400 Subject: [PATCH] SWDEV-440746 - Correct data size for query Size query for hipDeviceGetGraphMemAttribute or hipDeviceSetGraphMemAttribute has to use size_t type or uint64_t Change-Id: I4ba38555d805fde03a8cd3ea7aaac7b0f99d1301 [ROCm/hip-tests commit: 7710255a8ceb51559ed0118b9a91e30ca793352c] --- .../unit/graph/hipDeviceGetGraphMemAttribute.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/hip-tests/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc b/projects/hip-tests/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc index ca65610a99..67d8b43b79 100644 --- a/projects/hip-tests/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc +++ b/projects/hip-tests/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc @@ -88,12 +88,12 @@ static void checkGraphMemAttribute(size_t used_mem, size_t high_mem) { } // Reset memory graph attributes back to the original state -static void ResetGraphMemAttribute() { +static void ResetGraphMemAttribute(unsigned deviceId = 0) { size_t mem_size = 0; hipGraphMemAttributeType attr = hipGraphMemAttrUsedMemHigh; - HIP_CHECK(hipDeviceSetGraphMemAttribute(0, attr, &mem_size)); + HIP_CHECK(hipDeviceSetGraphMemAttribute(deviceId, attr, &mem_size)); attr = hipGraphMemAttrReservedMemHigh; - HIP_CHECK(hipDeviceSetGraphMemAttribute(0, attr, &mem_size)); + HIP_CHECK(hipDeviceSetGraphMemAttribute(deviceId, attr, &mem_size)); } /** @@ -292,7 +292,7 @@ static void Unit_hipDeviceGetGraphMemAttribute_Functional( HIP_CHECK(hipGraphAddMemFreeNode(&freeNodeA, graph, &allocNodeA, 1, reinterpret_cast(allocParams.dptr))); - int value = -1; + size_t value = -1; SECTION("Memory footprint check before launching graph") { HIP_CHECK(hipDeviceGetGraphMemAttribute(deviceId, hipGraphMemAttrUsedMemCurrent, &value)); @@ -389,7 +389,7 @@ static void Unit_hipDeviceGetGraphMemAttribute_Functional( hipGraphMemAttrReservedMemHigh, &value)); REQUIRE(value == 0); } - ResetGraphMemAttribute(); + ResetGraphMemAttribute(deviceId); #endif } @@ -429,7 +429,7 @@ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Functional_Multi_Device") { */ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Negative") { - int value = 0; + size_t value = 0; hipError_t ret; SECTION("Pass device id as negative value") { ret = hipDeviceGetGraphMemAttribute(-1, @@ -472,7 +472,7 @@ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Negative") { */ TEST_CASE("Unit_hipDeviceSetGraphMemAttribute_Negative") { - int value = 0; + size_t value = 0; hipError_t ret; SECTION("Pass device id as negative value") { ret = hipDeviceSetGraphMemAttribute(-3,