mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Add getGpuTimeStampInNS helper
Change-Id: I9170c773d1424ad69523d9a5c3b733299774c194 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
@@ -288,8 +288,11 @@ void Event::calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t con
|
||||
uint64_t gpuCompleteDuration = 0;
|
||||
uint64_t cpuCompleteDuration = 0;
|
||||
|
||||
double frequency = cmdQueue->getDevice().getDeviceInfo().profilingTimerResolution;
|
||||
int64_t c0 = queueTimeStamp.CPUTimeinNS - static_cast<uint64_t>(queueTimeStamp.GPUTimeStamp * frequency);
|
||||
auto &hwHelper = HwHelper::get(this->cmdQueue->getDevice().getHardwareInfo().platform.eRenderCoreFamily);
|
||||
auto frequency = cmdQueue->getDevice().getDeviceInfo().profilingTimerResolution;
|
||||
auto gpuTimeStamp = queueTimeStamp.GPUTimeStamp;
|
||||
|
||||
int64_t c0 = queueTimeStamp.CPUTimeinNS - hwHelper.getGpuTimeStampInNS(gpuTimeStamp, frequency);
|
||||
/* calculation based on equation
|
||||
CpuTime = GpuTime * scalar + const( == c0)
|
||||
scalar = DeltaCpu( == dCpu) / DeltaGpu( == dGpu)
|
||||
|
||||
@@ -85,6 +85,7 @@ class HwHelper {
|
||||
virtual bool is3DPipelineSelectWARequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isFusedEuDispatchEnabled(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isIndependentForwardProgressSupported() = 0;
|
||||
virtual uint64_t getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const = 0;
|
||||
|
||||
static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo);
|
||||
static uint32_t getEnginesCount(const HardwareInfo &hwInfo);
|
||||
@@ -220,6 +221,8 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool isIndependentForwardProgressSupported() override;
|
||||
|
||||
uint64_t getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const override;
|
||||
|
||||
protected:
|
||||
static const AuxTranslationMode defaultAuxTranslationMode;
|
||||
HwHelperHw() = default;
|
||||
|
||||
@@ -70,6 +70,10 @@ template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isIndependentForwardProgressSupported() {
|
||||
return true;
|
||||
}
|
||||
template <typename GfxFamily>
|
||||
uint64_t HwHelperHw<GfxFamily>::getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const {
|
||||
return static_cast<uint64_t>(timeStamp * frequency);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
||||
|
||||
Reference in New Issue
Block a user