SWDEV-447525 - Zero-initialize hipMemPoolProps.

Change-Id: Iee71961bd1d679f0a6a9223e6387748602706c2d
This commit is contained in:
Jaydeep Patel
2024-03-15 12:15:53 +00:00
parent a19e465add
commit b45bc412d7
7 ha cambiato i file con 39 aggiunte e 38 eliminazioni
+12 -16
Vedi File
@@ -31,18 +31,14 @@
#include <thread>
#include <chrono>
constexpr hipMemPoolProps kPoolProps = {
hipMemAllocationTypePinned,
hipMemHandleTypeNone,
{
hipMemLocationTypeDevice,
0
},
nullptr,
0,
{0}
static hipMemPoolProps kPoolProps;
void initMemPoolProps() {
kPoolProps.allocType = hipMemAllocationTypePinned;
kPoolProps.handleTypes = hipMemHandleTypeNone;
kPoolProps.location.type = hipMemLocationTypeDevice;
kPoolProps.location.id = 0;
kPoolProps.win32SecurityAttributes = nullptr;
};
/*
This testcase verifies HIP Mem Pool API basic scenario - supported on all devices
*/
@@ -101,7 +97,7 @@ TEST_CASE("Unit_hipMemPoolApi_Basic") {
0
};
HIP_CHECK(hipMemPoolGetAccess(&flags, mem_pool, &location));
initMemPoolProps();
HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps));
HIP_CHECK(hipMallocFromPoolAsync(reinterpret_cast<void**>(&B), numElements * sizeof(float), mem_pool, stream));
HIP_CHECK(hipMemPoolDestroy(mem_pool));
@@ -146,7 +142,7 @@ TEST_CASE("Unit_hipMemPoolApi_BasicAlloc") {
SUCCEED("Runtime doesn't support Memory Pool. Skip the test case.");
return;
}
initMemPoolProps();
hipMemPool_t mem_pool;
HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps));
@@ -234,7 +230,7 @@ TEST_CASE("Unit_hipMemPoolApi_BasicTrim") {
SUCCEED("Runtime doesn't support Memory Pool. Skip the test case.");
return;
}
initMemPoolProps();
hipMemPool_t mem_pool;
HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps));
@@ -322,7 +318,7 @@ TEST_CASE("Unit_hipMemPoolApi_BasicReuse") {
SUCCEED("Runtime doesn't support Memory Pool. Skip the test case.");
return;
}
initMemPoolProps();
hipMemPool_t mem_pool;
HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps));
@@ -398,7 +394,7 @@ TEST_CASE("Unit_hipMemPoolApi_Opportunistic") {
SUCCEED("Runtime doesn't support Memory Pool. Skip the test case.");
return;
}
initMemPoolProps();
hipMemPool_t mem_pool;
HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps));