SWDEV-295037 - Fix passed() in DTests

passed() should not call exit(0) which will prevent object
destructor being called.

Change-Id: Ibaee0d85cb616727dc5db557bb9422702670b688


[ROCm/hip-tests commit: 913003099c]
Этот коммит содержится в:
Tao Sang
2021-07-13 23:39:01 -04:00
коммит произвёл Tao Sang
родитель e05a9713dd
Коммит 85ce4d0bcc
9 изменённых файлов: 12 добавлений и 35 удалений
+2 -4
Просмотреть файл
@@ -238,9 +238,7 @@ int main(int argc, char* argv[]) {
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return 0;
failed("No GPU!");
}
hipDeviceProp_t props = {0};
props = {0};
@@ -379,6 +377,6 @@ int main(int argc, char* argv[]) {
HIPCHECK(hipFree(workspace));
}
passed();
return 0;
}
+1 -3
Просмотреть файл
@@ -403,9 +403,7 @@ void hipPerfMandelBrot::open(int deviceId) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return;
failed("No GPU!");
}
+1 -2
Просмотреть файл
@@ -130,8 +130,7 @@ class hipPerfMemFill {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
cout << "Info: didn't find any GPU! skipping the test!\n";
passed();
failed("No GPU!");
} else if (deviceId >= nGpu) {
failed("Info: wrong GPU Id %d\n", deviceId);
}
+1 -3
Просмотреть файл
@@ -62,9 +62,7 @@ void hipPerfMemcpy::open(int deviceId) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return;
failed("No GPU!");
}
HIPCHECK(hipSetDevice(deviceId));
+2 -4
Просмотреть файл
@@ -18,7 +18,7 @@
*/
/* HIT_START
* BUILD: %t %s ../../src/test_common.cpp EXCLUDE_HIP_PLATFORM nvcc
* BUILD: %t %s ../../src/test_common.cpp EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t
* HIT_END
*/
@@ -110,9 +110,7 @@ void hipPerfMemset::open(int deviceId) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return;
failed("No GPU!");
}
HIPCHECK(hipSetDevice(deviceId));
+2 -4
Просмотреть файл
@@ -128,10 +128,8 @@ void hipPerfSampleRate::open(void) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return;
if (nGpu < 1) {
failed("No GPU!");
}
int deviceId = 0;
+1 -6
Просмотреть файл
@@ -95,17 +95,12 @@ hipPerfDeviceConcurrency::hipPerfDeviceConcurrency() {}
hipPerfDeviceConcurrency::~hipPerfDeviceConcurrency() {}
void hipPerfDeviceConcurrency::open(void) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
setNumGpus(nGpu);
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
failed("No GPU!");
}
}
+1 -6
Просмотреть файл
@@ -235,17 +235,12 @@ hipPerfStreamConcurrency::hipPerfStreamConcurrency() {}
hipPerfStreamConcurrency::~hipPerfStreamConcurrency() {}
void hipPerfStreamConcurrency::open(int deviceId) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return;
failed("No GPU!");
}
HIPCHECK(hipSetDevice(deviceId));
hipDeviceProp_t props = {0};
HIPCHECK(hipGetDeviceProperties(&props, deviceId));
+1 -3
Просмотреть файл
@@ -54,9 +54,7 @@ void hipPerfStreamCreateCopyDestroy::open(int deviceId) {
int nGpu = 0;
HIPCHECK(hipGetDeviceCount(&nGpu));
if (nGpu < 1) {
std::cout << "info: didn't find any GPU! skipping the test!\n";
passed();
return;
failed("No GPU!");
}
HIPCHECK(hipSetDevice(deviceId));