Files
compute-runtime/unit_tests/mocks/mock_ostime.h
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00

39 lines
1007 B
C++

/*
* Copyright (C) 2017-2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/os_interface/os_time.h"
namespace OCLRT {
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 OCLRT