Files
compute-runtime/shared/source/os_interface/windows/device_time_wddm.h
Chandio, Bibrak Qamar ab2e831a4a fix: zeDeviceGetGlobalTimestamp to use submisison
Related-To: GSD-10253, GSD-9467, GSD-9381, NEO-11908

When EnableGlobalTimestampViaSubmission is set then
zeDeviceGetGlobalTimestamp uses immediate cmd submission
method to get GPU time.

Signed-off-by: Chandio, Bibrak Qamar <bibrak.qamar.chandio@intel.com>
2024-12-04 19:10:07 +01:00

53 lines
1.4 KiB
C++

/*
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/os_interface/os_time.h"
#include "shared/source/os_interface/windows/gfx_escape_wrapper.h"
#define GFX_ESCAPE_IGPA_INSTRUMENTATION_CONTROL 12
namespace NEO {
class Wddm;
class GfxCoreHelper;
struct TimeStampDataHeader;
class DeviceTimeWddm : public DeviceTime {
public:
DeviceTimeWddm(Wddm *wddm);
TimeQueryStatus getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime) override;
double getDynamicDeviceTimerResolution() const override;
uint64_t getDynamicDeviceTimerClock() const override;
protected:
MOCKABLE_VIRTUAL bool runEscape(Wddm *wddm, TimeStampDataHeader &escapeInfo);
void convertTimestampsFromOaToCsDomain(const GfxCoreHelper &gfxCoreHelper, uint64_t &timestampData, uint64_t freqOA, uint64_t freqCS);
Wddm *wddm = nullptr;
};
struct GetGpuCpuTimestampsIn {
int function = 25; // GTDI_FNC_GET_GPU_CPU_TIMESTAMPS
};
struct GetGpuCpuTimestampsOut {
int retCode; // Result of the call
uint64_t gpuPerfTicks; // in GPU_timestamp_ticks
uint64_t cpuPerfTicks; // in CPU_timestamp_ticks
uint64_t gpuPerfFreq; // in GPU_timestamp_ticks/s
uint64_t cpuPerfFreq; // in CPU_timestamp_ticks/s
};
struct TimeStampDataHeader {
GFX_ESCAPE_HEADER_T header;
union {
GetGpuCpuTimestampsIn in;
GetGpuCpuTimestampsOut out;
} data;
};
} // namespace NEO