SWDEV-427345 - Address catch test failures

Change-Id: Ie3abbb50e1a2d0563c63c7fbb2bf7f341ac3aaa6
此提交包含在:
Satyanvesh Dittakavi
2023-10-19 10:59:30 +00:00
提交者 Rakesh Roy
父節點 07ec2d5a0c
當前提交 2d17c32468
共有 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