SWDEV-427345 - Address catch test failures

Change-Id: Ie3abbb50e1a2d0563c63c7fbb2bf7f341ac3aaa6


[ROCm/hip-tests commit: 2d17c32468]
Этот коммит содержится в:
Satyanvesh Dittakavi
2023-10-19 10:59:30 +00:00
коммит произвёл Rakesh Roy
родитель 960ef27787
Коммит 66ddcaae50
3 изменённых файлов: 14 добавлений и 6 удалений
+4
Просмотреть файл
@@ -176,3 +176,7 @@ endif()
hip_add_exe_to_target(NAME MemoryTest2
TEST_SRC ${TEST_SRC}
TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
if(HIP_PLATFORM MATCHES "amd")
add_dependencies(build_tests hipHostRegisterPerf)
endif()
+2
Просмотреть файл
@@ -25,6 +25,8 @@ THE SOFTWARE.
#include <chrono> // NOLINT
#include "hip/hip_runtime_api.h"
#pragma clang diagnostic ignored "-Wunused-parameter"
#define ITERATION 1000
#define SIZE (64*1024*1024)
#define ARRAY_SIZE 20
+8 -6
Просмотреть файл
@@ -206,7 +206,7 @@ TEST_CASE("Unit_hipMalloc_CoherentTst") {
hipExtMallocWithFlags()*/
#if HT_AMD
TEST_CASE("Unit_hipExtMallocWithFlags_CoherentTst") {
int *Ptr = nullptr, SIZE = sizeof(int), InitVal = 9, Pageable = 0, managed = 0;
int *Ptr = nullptr, SIZE = sizeof(int), InitVal = 9, Pageable = 0, managed = 0, finegrain = 0;
bool FineGrain = true;
YES_COHERENT = false;
@@ -214,14 +214,16 @@ TEST_CASE("Unit_hipExtMallocWithFlags_CoherentTst") {
hipDeviceAttributePageableMemoryAccess, 0));
INFO("hipDeviceAttributePageableMemoryAccess: " << Pageable);
HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory,
0));
HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, 0));
INFO("hipDeviceAttributeManagedMemory: " << managed);
if (managed == 1 && Pageable == 1) {
// Allocating hipExtMallocWithFlags() memory with flags
SECTION("hipExtMallocWithFlags with hipDeviceMallocFinegrained flag") {
HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast<void**>(&Ptr), SIZE*2,
hipDeviceMallocFinegrained));
HIP_CHECK(hipDeviceGetAttribute(&finegrain, hipDeviceAttributeFineGrainSupport, 0));
if (finegrain == 1) {
SECTION("hipExtMallocWithFlags with hipDeviceMallocFinegrained flag") {
HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast<void**>(&Ptr), SIZE*2,
hipDeviceMallocFinegrained));
}
}
SECTION("hipExtMallocWithFlags with hipDeviceMallocSignalMemory flag") {
// for hipMallocSignalMemory flag the size of memory must be 8