From 0a8235e5c8ca0655e7b989a8c56733b32cddc841 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 28 Feb 2023 05:24:39 +0530 Subject: [PATCH] SWDEV-345188 - hip-tests size_t to unsigned long warning (#175) Change-Id: Id315ba0de6900f714190a09ac09c977830360c72 --- catch/unit/memory/hipPointerGetAttributes.cc | 7 ++++--- catch/unit/memory/hipPtrGetAttribute.cc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/catch/unit/memory/hipPointerGetAttributes.cc b/catch/unit/memory/hipPointerGetAttributes.cc index ceefa1f9ba..42ab07e289 100644 --- a/catch/unit/memory/hipPointerGetAttributes.cc +++ b/catch/unit/memory/hipPointerGetAttributes.cc @@ -122,7 +122,8 @@ void checkPointer(const SuperPointerAttribute& ref, int major, int minor, void* // we do this in the testMultiThreaded_1 test. void clusterAllocs(int numAllocs, size_t minSize, size_t maxSize) { Nbytes = N * sizeof(char); - printf("clusterAllocs numAllocs=%d size=%lu..%lu\n", numAllocs, minSize, maxSize); + printf("clusterAllocs numAllocs=%d size=%lu..%lu\n", + numAllocs, static_cast(minSize), static_cast(maxSize)); const int Max_Devices = 256; std::vector reference(numAllocs); @@ -174,7 +175,7 @@ void clusterAllocs(int numAllocs, size_t minSize, size_t maxSize) { " device#%d: hipMemGetInfo: " "free=%zu (%4.2fMB) totalDevice=%lu (%4.2fMB) total=%zu " "(%4.2fMB)\n", - i, free, (free / 1024.0 / 1024.0), totalDeviceAllocated[i], + i, free, (free / 1024.0 / 1024.0), static_cast(totalDeviceAllocated[i]), (totalDeviceAllocated[i]) / 1024.0 / 1024.0, total, (total / 1024.0 / 1024.0)); REQUIRE(free + totalDeviceAllocated[i] <= total); } @@ -221,7 +222,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_Basic") { size_t free, total; HIP_CHECK(hipMemGetInfo(&free, &total)); printf("hipMemGetInfo: free=%zu (%4.2f) Nbytes=%lu total=%zu (%4.2f)\n", free, - (free / 1024.0 / 1024.0), Nbytes, total, (total / 1024.0 / 1024.0)); + (free / 1024.0 / 1024.0), static_cast(Nbytes), total, (total / 1024.0 / 1024.0)); REQUIRE(free + Nbytes <= total); diff --git a/catch/unit/memory/hipPtrGetAttribute.cc b/catch/unit/memory/hipPtrGetAttribute.cc index eaf4c8b153..c87ea5a5f7 100644 --- a/catch/unit/memory/hipPtrGetAttribute.cc +++ b/catch/unit/memory/hipPtrGetAttribute.cc @@ -50,7 +50,7 @@ TEST_CASE("Unit_hipPtrGetAttribute_Simple") { size_t free, total; HIP_CHECK(hipMemGetInfo(&free, &total)); printf("hipMemGetInfo: free=%zu (%4.2f) Nbytes=%lu total=%zu (%4.2f)\n", free, - (free / 1024.0 / 1024.0), Nbytes, total, + (free / 1024.0 / 1024.0), static_cast(Nbytes), total, (total / 1024.0 / 1024.0)); REQUIRE(free + Nbytes <= total);