SWDEV-295037 - Fix passed() in DTests

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

Change-Id: Ibaee0d85cb616727dc5db557bb9422702670b688
This commit is contained in:
Tao Sang
2021-07-13 23:39:01 -04:00
committed by Tao Sang
parent 63586279ba
commit c74e2da333
12 changed files with 22 additions and 45 deletions
@@ -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!");
}
}
@@ -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));
@@ -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));