SWDEV-502224 - Fix HIP catch2 test failure in CPX NPS4 mode

Add dynamic arrays of devices to avoid array overflow.
Fixed the following tests:
Unit_hipDeviceGetByPCIBusId_WrongBusID)
Unit_hipSetDevice_ValidVisibleDeviceList
Unit_hipSetDevice_MinRvdMaxHvdDevicesList

Change-Id: I73d022321609d20ef2bd419f2cff287f6002a4d2


[ROCm/hip-tests commit: c4135a6090]
Цей коміт міститься в:
Dragoslav Sicarov
2024-12-09 17:27:21 -06:00
зафіксовано Maneesh Gupta
джерело 4465ce4e2b
коміт fc759df55c
2 змінених файлів з 41 додано та 50 видалено
+6 -6
Переглянути файл
@@ -133,19 +133,19 @@ TEST_CASE("Unit_hipDeviceGetByPCIBusId_WrongBusID") {
int deviceCount = 0;
HIP_CHECK(hipGetDeviceCount(&deviceCount));
HIP_ASSERT(deviceCount != 0);
constexpr int MaxLen = 20;
constexpr int MaxIter = 256;
constexpr int MaxBusIdLen = 12;
int pciBusId[MaxLen], pciDeviceID[MaxLen],
pciDomainID[MaxLen];
std::vector<int> pciBusId;
std::vector<int> pciDeviceID;
std::vector<int> pciDomainID;
// get bus id of all the devices
for (int i = 0; i < deviceCount; i++) {
hipDeviceProp_t prop;
HIP_CHECK(hipGetDeviceProperties(&prop, i));
pciBusId[i] = prop.pciBusID;
pciDeviceID[i] = prop.pciDeviceID;
pciDomainID[i] = prop.pciDomainID;
pciBusId.push_back(prop.pciBusID);
pciDeviceID.push_back(prop.pciDeviceID);
pciDomainID.push_back(prop.pciDomainID);
printf("device %d: pciDomainID=%x, pciBusID=%x, pciDeviceID=%x \n",
i, prop.pciDomainID, prop.pciBusID, prop.pciDomainID);
}