SWDEV-431399 - fix issues highlighted by address sanitizer

Change-Id: I927009a8d408bdf13677ce5cc926908fb4552441


[ROCm/hip-tests commit: a87786f060]
Bu işleme şunda yer alıyor:
Jatin Chaudhary
2023-11-15 13:27:15 +00:00
işlemeyi yapan: Jatin Jaikishan Chaudhary
ebeveyn 5d5d8e52e1
işleme 06292cfc6a
3 değiştirilmiş dosya ile 6 ekleme ve 6 silme
+1 -1
Dosyayı Görüntüle
@@ -84,7 +84,7 @@ TEST_CASE("Unit_hipDeviceGetPCIBusId_Check_PciBusID_WithAttr") {
}
// Deallocate
for (int i = 0; i < deviceCount; i++) {
delete hipDeviceList[i];
delete[] hipDeviceList[i];
}
delete[] hipDeviceList;
printf("pciBusID output of both hipDeviceGetPCIBusId and"
+2 -2
Dosyayı Görüntüle
@@ -167,8 +167,8 @@ TEST_CASE("Unit_hipDeviceGetCacheConfig_Positive_Threaded") {
void TestPart3() {
hipFuncCache_t returned_cache_config;
HIP_CHECK(hipDeviceGetCacheConfig(&returned_cache_config));
REQUIRE(returned_cache_config == cache_config_);
HIP_CHECK_THREAD(hipDeviceGetCacheConfig(&returned_cache_config));
REQUIRE_THREAD(returned_cache_config == cache_config_);
}
private:
+3 -3
Dosyayı Görüntüle
@@ -328,14 +328,14 @@ TEST_CASE("Unit_hipGetDeviceAttribute_CheckFineGrainSupport") {
char command_op[BUFFER_LEN];
int count = -1;
// Extract each segment flags
while (fgets(command_op, BUFFER_LEN, fpipe)) {
while (fgets(command_op, BUFFER_LEN, fpipe) && (count + 1) < deviceCount) {
std::string rocminfo_line(command_op);
if ((std::string::npos != rocminfo_line.find("GPU-")) &&
(std::string::npos != rocminfo_line.find("Uuid:"))) {
count++;
gpuFound[count] = true;
} else if (gpuFound[count] &&
(std::string::npos != rocminfo_line.find("FLAGS: FINE GRAINED"))) {
} else if (count >= 0 && gpuFound[count] &&
(std::string::npos != rocminfo_line.find("FLAGS: FINE GRAINED"))) {
fine_grained_val[count] = 1;
}
}