getCpuGpuTime to return false when unavailable

This commit addresses crash issue in AUB standalone mode
when queue profiling is enabled on Linux platform.

Change-Id: Ie2d02093d3628efac3a8925890f22afd6a49469d
This commit is contained in:
Slawomir Milczarek
2018-08-08 14:19:43 +02:00
committed by sys_ocldev
parent 4afa8fb6ca
commit 285af96dc2
3 changed files with 10 additions and 1 deletions

View File

@@ -148,6 +148,12 @@ TEST_F(DrmTimeTest, GIVENDrmWHENGetCpuGpuTimeTHENPassed) {
delete pDrm;
}
TEST_F(DrmTimeTest, givenGetCpuGpuTimeWhenItIsUnavailableThenReturnFalse) {
TimeStampData CPUGPUTime = {0, 0};
auto error = osTime->getCpuGpuTime(&CPUGPUTime);
EXPECT_FALSE(error);
}
TEST_F(DrmTimeTest, GetCpuGpuTimeFails) {
TimeStampData CPUGPUTime01 = {0, 0};
auto pDrm = new DrmMockFail();