SWDEV-539145 - Fix compilation error in windows psdb (#376)

Co-authored-by: Rahul Manocha <rmanocha@amd.com>

[ROCm/hip-tests commit: 2a0bcca07b]
This commit is contained in:
Manocha, Rahul
2025-07-15 08:38:24 -07:00
committed by GitHub
parent 068f506131
commit 54bf215b7d
2 changed files with 18 additions and 31 deletions
@@ -201,27 +201,24 @@ TEST_CASE("Unit_hipHostAlloc_Basic") {
} else {
float *A_h, *B_h, *C_h;
float *A_d, *B_d, *C_d;
unsigned int flag = 0;
HIP_CHECK(hipHostAlloc(reinterpret_cast<void **>(&A_h), SIZE,
hipHostAllocWriteCombined | hipHostAllocMapped));
SECTION("hipHostAllocDefault") {
HIP_CHECK(hipHostAlloc(reinterpret_cast<void **>(&B_h), SIZE,
hipHostAllocDefault));
}
#if (HT_AMD == 1) && (HT_LINUX == 1)
SECTION("hipHostAllocUncached") {
HIP_CHECK(hipHostAlloc(reinterpret_cast<void**>(&B_h), SIZE,
hipHostAllocUncached));
}
#endif
HIP_CHECK(hipHostAlloc(reinterpret_cast<void **>(&C_h), SIZE,
hipHostAllocMapped));
HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast<void **>(&A_d), A_h, 0));
HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast<void **>(&C_d), C_h, 0));
SECTION("hipHostAllocDefault") { flag = hipHostAllocDefault; }
#if (HT_AMD == 1) && (HT_LINUX == 1)
SECTION("hipHostAllocUncached") { flag = hipHostAllocUncached; }
#endif
HIP_CHECK(hipHostAlloc(reinterpret_cast<void**>(&B_h), SIZE, flag));
HIP_CHECK(hipHostAlloc(reinterpret_cast<void**>(&C_h), SIZE, hipHostAllocMapped));
HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast<void**>(&A_d), A_h, 0));
HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast<void**>(&C_d), C_h, 0));
HipTest::setDefaultData<float>(LEN, A_h, B_h, C_h);
HIP_CHECK(hipMalloc(reinterpret_cast<void **>(&B_d), SIZE));
HIP_CHECK(hipMalloc(reinterpret_cast<void**>(&B_d), SIZE));
HIP_CHECK(hipMemcpy(B_d, B_h, SIZE, hipMemcpyHostToDevice));
dim3 dimGrid(LEN / 512, 1, 1);
@@ -127,26 +127,16 @@ TEST_CASE("Unit_hipHostMalloc_Basic") {
} else {
float *A_h, *B_h, *C_h;
float *A_d, *B_d, *C_d;
unsigned int flag = 0;
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&A_h), SIZE,
hipHostMallocWriteCombined | hipHostMallocMapped));
SECTION("hipHostMallocDefault") {
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&B_h), SIZE,
hipHostMallocDefault));
}
SECTION("hipHostMallocDefault") { flag = hipHostMallocDefault; }
#if (HT_AMD == 1) && (HT_LINUX == 1)
SECTION("hipHostMallocUncached") {
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&B_h), SIZE,
hipHostMallocUncached));
}
SECTION("hipHostMallocCoherent") {
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&B_h), SIZE,
hipHostMallocCoherent));
}
SECTION("hipHostMallocNonCoherent") {
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&B_h), SIZE,
hipHostMallocNonCoherent));
}
SECTION("hipHostMallocUncached") { flag = hipHostMallocUncached; }
SECTION("hipHostMallocCoherent") { flag = hipHostMallocCoherent; }
SECTION("hipHostMallocNonCoherent") { flag = hipHostMallocNonCoherent; }
#endif
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&B_h), SIZE, flag));
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&C_h), SIZE,
hipHostMallocMapped));