2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-02-02 01:26:39 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2019-02-27 18:39:32 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/os_time.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
double OSTime::getDeviceTimerResolution(HardwareInfo const &hwInfo) {
|
|
|
|
return hwInfo.capabilityTable.defaultProfilingTimerResolution;
|
|
|
|
};
|
2023-02-02 01:26:39 +08:00
|
|
|
|
|
|
|
bool DeviceTime::getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
2023-04-27 17:50:55 +08:00
|
|
|
pGpuCpuTime->cpuTimeinNS = 0;
|
|
|
|
pGpuCpuTime->gpuTimeStamp = 0;
|
2023-02-02 01:26:39 +08:00
|
|
|
|
|
|
|
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 18:59:46 +08:00
|
|
|
} // namespace NEO
|