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]
This commit is contained in:
Tao Sang
2021-07-13 23:39:01 -04:00
committed by Tao Sang
orang tua e05a9713dd
melakukan 85ce4d0bcc
9 mengubah file dengan 12 tambahan dan 35 penghapusan
@@ -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);
}
@@ -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));
@@ -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));
@@ -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;