SWDEV-344135 - Enable stream ordered memory and mempool tests (#2837)

- Enable stream ordered memory and mempool tests for Nvidia platform
- Fix build errors

Change-Id: I90337e73d7b5df944a72cb41f2bde9ab2eec653c


[ROCm/hip-tests commit: 53480a3127]
Этот коммит содержится в:
ROCm CI Service Account
2022-08-23 09:35:39 +05:30
коммит произвёл GitHub
родитель ed5536c180
Коммит c2a62d99a0
2 изменённых файлов: 16 добавлений и 6 удалений
+1
Просмотреть файл
@@ -138,6 +138,7 @@ set(TEST_SRC
hipMemRangeGetAttribute.cc
hipMemcpyFromSymbol.cc
hipPtrGetAttribute.cc
hipMemPoolApi.cc
hipMemcpyPeer.cc
hipMemcpyPeerAsync.cc
hipMemcpyWithStream.cc
+15 -6
Просмотреть файл
@@ -65,7 +65,7 @@ TEST_CASE("Unit_hipMemPoolApi_Basic") {
hipStream_t stream;
HIP_CHECK(hipStreamCreate(&stream));
HIP_CHECK(hipMallocAsync(&A, numElements * sizeof(float), stream));
HIP_CHECK(hipMallocAsync(reinterpret_cast<void**>(&A), numElements * sizeof(float), stream));
INFO("hipMallocAsync result: " << A);
HIP_CHECK(hipFreeAsync(A, stream));
@@ -84,16 +84,25 @@ TEST_CASE("Unit_hipMemPoolApi_Basic") {
HIP_CHECK(hipMemPoolGetAttribute(mem_pool, attr, &value));
hipMemAccessDesc desc_list = {};
hipMemAccessDesc desc_list = {
{
hipMemLocationTypeDevice,
0
},
hipMemAccessFlagsProtReadWrite
};
int count = 1;
HIP_CHECK(hipMemPoolSetAccess(mem_pool, &desc_list, count));
hipMemAccessFlags flags = hipMemAccessFlagsProtNone;
hipMemLocation location = {};
hipMemLocation location = {
hipMemLocationTypeDevice,
0
};
HIP_CHECK(hipMemPoolGetAccess(&flags, mem_pool, &location));
HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps));
HIP_CHECK(hipMallocFromPoolAsync(&B, numElements * sizeof(float), mem_pool, stream));
HIP_CHECK(hipMallocFromPoolAsync(reinterpret_cast<void**>(&B), numElements * sizeof(float), mem_pool, stream));
HIP_CHECK(hipMemPoolDestroy(mem_pool));
HIP_CHECK(hipStreamDestroy(stream));
@@ -527,8 +536,8 @@ TEST_CASE("Unit_hipMemPoolApi_Default") {
std::uint64_t value64 = 0;
attr = hipMemPoolAttrReservedMemCurrent;
HIP_CHECK(hipMemPoolGetAttribute(mem_pool, attr, &value64));
// Make sure the current reserved just 4KB alloc
REQUIRE(sizeof(float) * 1024 == value64);
// Make sure the current reserved is at least allocation size of buffer C (4KB)
REQUIRE(sizeof(float) * 1024 <= value64);
attr = hipMemPoolAttrUsedMemHigh;
HIP_CHECK(hipMemPoolGetAttribute(mem_pool, attr, &value64));