2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2020-01-21 15:24:52 +01:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/os_interface/os_time.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2020-10-23 15:38:35 +02:00
|
|
|
static int PerfTicks = 0;
|
2017-12-21 00:45:38 +01:00
|
|
|
class MockOSTime : public OSTime {
|
|
|
|
public:
|
|
|
|
bool getCpuGpuTime(TimeStampData *pGpuCpuTime) override {
|
|
|
|
pGpuCpuTime->GPUTimeStamp = ++PerfTicks;
|
|
|
|
pGpuCpuTime->CPUTimeinNS = PerfTicks;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
bool getCpuTime(uint64_t *timeStamp) override {
|
|
|
|
*timeStamp = ++PerfTicks;
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
double getHostTimerResolution() const override {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
|
|
|
return OSTime::getDeviceTimerResolution(hwInfo);
|
|
|
|
}
|
|
|
|
uint64_t getCpuRawTimestamp() override {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static std::unique_ptr<OSTime> create() {
|
|
|
|
return std::unique_ptr<OSTime>(new MockOSTime());
|
|
|
|
}
|
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|