2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2023-02-01 17:26:39 +00:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2019-02-27 11:39:32 +01:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/os_interface/os_time.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
double OSTime::getDeviceTimerResolution(HardwareInfo const &hwInfo) {
|
|
|
|
|
return hwInfo.capabilityTable.defaultProfilingTimerResolution;
|
|
|
|
|
};
|
2023-02-01 17:26:39 +00:00
|
|
|
|
|
|
|
|
bool DeviceTime::getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
|
|
|
|
pGpuCpuTime->CPUTimeinNS = 0;
|
|
|
|
|
pGpuCpuTime->GPUTimeStamp = 0;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
double DeviceTime::getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
|
|
|
|
return OSTime::getDeviceTimerResolution(hwInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint64_t DeviceTime::getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const {
|
|
|
|
|
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool OSTime::getCpuTime(uint64_t *timeStamp) {
|
|
|
|
|
*timeStamp = 0;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double OSTime::getHostTimerResolution() const {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint64_t OSTime::getCpuRawTimestamp() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OSTime::OSTime(std::unique_ptr<DeviceTime> deviceTime) {
|
|
|
|
|
this->deviceTime = std::move(deviceTime);
|
|
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|