mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00

Change-Id: I67a6919bbbff1d30c7d6cdb257b41c87bad51e7f Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
39 lines
1009 B
C++
39 lines
1009 B
C++
/*
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/os_interface/os_time.h"
|
|
|
|
namespace NEO {
|
|
class MockOSTime : public OSTime {
|
|
public:
|
|
bool getCpuGpuTime(TimeStampData *pGpuCpuTime) override {
|
|
static int PerfTicks = 0;
|
|
pGpuCpuTime->GPUTimeStamp = ++PerfTicks;
|
|
pGpuCpuTime->CPUTimeinNS = PerfTicks;
|
|
return true;
|
|
}
|
|
bool getCpuTime(uint64_t *timeStamp) override {
|
|
static int PerfTicks = 0;
|
|
*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());
|
|
}
|
|
};
|
|
} // namespace NEO
|