SWDEV-345188 - hip-tests size_t to unsigned long warning (#175)

Change-Id: Id315ba0de6900f714190a09ac09c977830360c72
This commit is contained in:
ROCm CI Service Account
2023-02-28 05:24:39 +05:30
committed by GitHub
parent 798c4e7255
commit 0a8235e5c8
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -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<unsigned long>(minSize), static_cast<unsigned long>(maxSize));
const int Max_Devices = 256;
std::vector<SuperPointerAttribute> 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<unsigned long>(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<unsigned long>(Nbytes), total, (total / 1024.0 / 1024.0));
REQUIRE(free + Nbytes <= total);
+1 -1
View File
@@ -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<unsigned long>(Nbytes), total,
(total / 1024.0 / 1024.0));
REQUIRE(free + Nbytes <= total);