kfdtest: Adapt the CWSR test for emulators
The original test takes forever to run on emulators because emulators
are much slower than Asic. So intelligently detect the emulator scenarios
and reduce the run time by slashing the iteration times.
Change-Id: I087f43c04c2b23b5ab2ecaad07533b767c337e94
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
[ROCm/ROCR-Runtime commit: 21cda69ba9]
This commit is contained in:
@@ -114,6 +114,14 @@ void KFDCWSRTest::TearDown() {
|
||||
ROUTINE_END
|
||||
}
|
||||
|
||||
bool isOnEmulator() {
|
||||
uint32_t isEmuMode = 0;
|
||||
|
||||
fscanf_dec("/sys/module/amdgpu/parameters/emu_mode", &isEmuMode);
|
||||
|
||||
return isEmuMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* KFDCWSRTest.BasicTest
|
||||
*
|
||||
@@ -135,6 +143,14 @@ TEST_F(KFDCWSRTest, BasicTest) {
|
||||
int count1 = 40000000;
|
||||
int count2 = 20000000;
|
||||
|
||||
if (isOnEmulator()) {
|
||||
// Divide the iterator times by 1000 so that the test can
|
||||
// finish in a reasonable time.
|
||||
count1 /= 1000;
|
||||
count2 /= 1000;
|
||||
LOG() << "On Emulators" << std::endl;
|
||||
}
|
||||
|
||||
unsigned int* result1 = resultBuf1.As<unsigned int*>();
|
||||
unsigned int* result2 = resultBuf2.As<unsigned int*>();
|
||||
const char *pIterateIsa;
|
||||
|
||||
Reference in New Issue
Block a user