mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
fix: fix compilation error in clang on Windows (1/n)
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
85d35d5239
commit
d724627098
@@ -58,7 +58,7 @@ ze_result_t DebugSessionWindows::initialize() {
|
||||
wddm = connectedDevice->getOsInterface().getDriverModel()->as<NEO::Wddm>();
|
||||
UNRECOVERABLE_IF(wddm == nullptr);
|
||||
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_ATTACH_DEBUGGER;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.AttachDebuggerParams.hAdapter = wddm->getAdapter();
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.AttachDebuggerParams.ProcessId = processId;
|
||||
@@ -98,7 +98,7 @@ bool DebugSessionWindows::closeConnection() {
|
||||
|
||||
closeAsyncThread();
|
||||
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_DETACH_DEBUGGER;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.DetachDebuggerParams.ProcessID = processId;
|
||||
|
||||
@@ -136,7 +136,7 @@ void *DebugSessionWindows::asyncThreadFunction(void *arg) {
|
||||
}
|
||||
|
||||
NTSTATUS DebugSessionWindows::runEscape(KM_ESCAPE_INFO &escapeInfo) {
|
||||
D3DKMT_ESCAPE escapeCommand = {0};
|
||||
D3DKMT_ESCAPE escapeCommand = {};
|
||||
|
||||
escapeInfo.Header.EscapeCode = GFX_ESCAPE_KMD;
|
||||
escapeInfo.Header.Size = sizeof(escapeInfo) - sizeof(escapeInfo.Header);
|
||||
@@ -156,11 +156,11 @@ NTSTATUS DebugSessionWindows::runEscape(KM_ESCAPE_INFO &escapeInfo) {
|
||||
}
|
||||
|
||||
ze_result_t DebugSessionWindows::readAndHandleEvent(uint64_t timeoutMs) {
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
|
||||
union {
|
||||
READ_EVENT_PARAMS_BUFFER eventParamsBuffer;
|
||||
uint8_t rawBytes[8 * READ_EVENT_PARAMS_BUFFER_MIN_SIZE_BYTES] = {0};
|
||||
uint8_t rawBytes[8 * READ_EVENT_PARAMS_BUFFER_MIN_SIZE_BYTES] = {};
|
||||
} eventParamsBuffer;
|
||||
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_READ_EVENT;
|
||||
@@ -210,7 +210,7 @@ ze_result_t DebugSessionWindows::handleModuleCreateEvent(uint32_t seqNo, DBGUMD_
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(asyncThreadMutex);
|
||||
if (moduleCreateParams.IsModuleCreate) {
|
||||
Module module = {0};
|
||||
Module module = {};
|
||||
module.cpuAddress = moduleCreateParams.hElfAddressPtr;
|
||||
module.gpuAddress = moduleCreateParams.LoadAddress;
|
||||
module.size = moduleCreateParams.ElfModulesize;
|
||||
@@ -302,7 +302,7 @@ ze_result_t DebugSessionWindows::handleAllocationDataEvent(uint32_t seqNo, DBGUM
|
||||
for (uint32_t i = 0; i < allocationDataParams.NumOfDebugData; ++i) {
|
||||
auto dataType = allocationDebugData[i].DataType;
|
||||
PRINT_DEBUGGER_INFO_LOG("DBGUMD_ACTION_READ_ALLOCATION_DATA: DataType=%d DataSize=%d DataPointer=%p\n", dataType, allocationDebugData[i].DataSize, allocationDebugData[i].DataPointer);
|
||||
NEO::WddmAllocation::RegistrationData registrationData = {0};
|
||||
NEO::WddmAllocation::RegistrationData registrationData = {};
|
||||
auto result = readAllocationDebugData(seqNo, allocationDebugData[i].DataPointer, ®istrationData, sizeof(registrationData));
|
||||
if (result != ZE_RESULT_SUCCESS) {
|
||||
PRINT_DEBUGGER_ERROR_LOG("DBGUMD_ACTION_READ_ALLOCATION_DATA - Fail!\n");
|
||||
@@ -350,7 +350,7 @@ ze_result_t DebugSessionWindows::handleDeviceCreateDestroyEvent(DBGUMD_READ_EVEN
|
||||
}
|
||||
|
||||
ze_result_t DebugSessionWindows::readAllocationDebugData(uint32_t seqNo, uint64_t umdDataBufferPtr, void *outBuf, size_t outBufSize) {
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_READ_ALLOCATION_DATA;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadAdditionalAllocDataParams.EventSeqNo = seqNo;
|
||||
@@ -397,7 +397,7 @@ ze_result_t DebugSessionWindows::handleCreateDebugDataEvent(DBGUMD_READ_EVENT_CR
|
||||
|
||||
ze_result_t DebugSessionWindows::acknowledgeEventImp(uint32_t seqNo, uint32_t eventType) {
|
||||
PRINT_DEBUGGER_INFO_LOG("DBGUMD_ACTION_ACKNOWLEDGE_EVENT: seqNo: %d eventType: %d\n", seqNo, eventType);
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_ACKNOWLEDGE_EVENT;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.AckEventParams.EventSeqNo = seqNo;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.AckEventParams.ReadEventType = eventType;
|
||||
@@ -452,7 +452,7 @@ ze_result_t DebugSessionWindows::translateEscapeReturnStatusToZeResult(uint32_t
|
||||
|
||||
ze_result_t DebugSessionWindows::readElfSpace(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer) {
|
||||
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_READ_UMD_MEMORY;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadUmdMemoryParams.hElfHandle = desc->address;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadUmdMemoryParams.BufferSize = static_cast<uint32_t>(size);
|
||||
@@ -588,7 +588,7 @@ ze_result_t DebugSessionWindows::resumeImp(const std::vector<EuThread::ThreadId>
|
||||
l0GfxCoreHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
||||
printBitmask(bitmask.get(), bitmaskSize);
|
||||
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_EU_CONTROL_CLR_ATT_BIT;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EuControlClrAttBitParams.BitmaskArrayPtr = reinterpret_cast<uint64_t>(bitmask.get());
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EuControlClrAttBitParams.BitMaskSizeInBytes = static_cast<uint32_t>(bitmaskSize);
|
||||
@@ -609,7 +609,7 @@ ze_result_t DebugSessionWindows::resumeImp(const std::vector<EuThread::ThreadId>
|
||||
}
|
||||
|
||||
ze_result_t DebugSessionWindows::interruptImp(uint32_t deviceIndex) {
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_EU_CONTROL_INT_ALL;
|
||||
|
||||
auto status = runEscape(escapeInfo);
|
||||
@@ -632,7 +632,7 @@ ze_result_t DebugSessionWindows::readGpuMemory(uint64_t memoryHandle, char *outp
|
||||
auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper();
|
||||
gpuVa = gmmHelper->decanonize(gpuVa);
|
||||
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_READ_GFX_MEMORY;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadGfxMemoryParams.hContextHandle = memoryHandle;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadGfxMemoryParams.GpuVirtualAddr = gpuVa;
|
||||
@@ -653,7 +653,7 @@ ze_result_t DebugSessionWindows::writeGpuMemory(uint64_t memoryHandle, const cha
|
||||
auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper();
|
||||
gpuVa = gmmHelper->decanonize(gpuVa);
|
||||
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_WRITE_GFX_MEMORY;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadGfxMemoryParams.hContextHandle = memoryHandle;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.ReadGfxMemoryParams.GpuVirtualAddr = gpuVa;
|
||||
@@ -689,7 +689,7 @@ ze_result_t DebugSessionWindows::readSbaBuffer(EuThread::ThreadId threadId, NEO:
|
||||
}
|
||||
|
||||
void DebugSessionWindows::getSbaBufferGpuVa(uint64_t &gpuVa) {
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.EscapeActionType = DBGUMD_ACTION_READ_MMIO;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.MmioReadParams.MmioOffset = CS_GPR_R15;
|
||||
escapeInfo.KmEuDbgL0EscapeInfo.MmioReadParams.RegisterOutBufferPtr = reinterpret_cast<uint64_t>(&gpuVa);
|
||||
|
||||
@@ -45,7 +45,7 @@ struct DebugSessionWindows : DebugSessionImp {
|
||||
|
||||
protected:
|
||||
ze_result_t resumeImp(const std::vector<EuThread::ThreadId> &threads, uint32_t deviceIndex) override;
|
||||
void DebugSessionWindows::pushApiEvent(zet_debug_event_t &debugEvent, uint32_t seqNo, uint32_t type) {
|
||||
void pushApiEvent(zet_debug_event_t &debugEvent, uint32_t seqNo, uint32_t type) {
|
||||
std::unique_lock<std::mutex> lock(asyncThreadMutex);
|
||||
apiEvents.push(debugEvent);
|
||||
if (debugEvent.flags & ZET_DEBUG_EVENT_FLAG_NEED_ACK) {
|
||||
|
||||
@@ -59,7 +59,7 @@ MetricsDiscovery::IAdapter_1_9 *MetricEnumeration::getMetricsAdapter() {
|
||||
auto adapterParams = getAdapterParams(adapter);
|
||||
|
||||
const bool validAdapterInfo = adapterParams->SystemId.Type == MetricsDiscovery::ADAPTER_ID_TYPE_LUID;
|
||||
const bool validAdapterMatch = (adapterParams->SystemId.Luid.HighPart == major) &&
|
||||
const bool validAdapterMatch = (static_cast<uint32_t>(adapterParams->SystemId.Luid.HighPart) == major) &&
|
||||
(adapterParams->SystemId.Luid.LowPart == minor);
|
||||
|
||||
if (validAdapterInfo && validAdapterMatch) {
|
||||
@@ -72,18 +72,13 @@ MetricsDiscovery::IAdapter_1_9 *MetricEnumeration::getMetricsAdapter() {
|
||||
|
||||
class MetricOAWindowsImp : public MetricOAOsInterface {
|
||||
public:
|
||||
MetricOAWindowsImp(Device &device);
|
||||
MetricOAWindowsImp() = default;
|
||||
~MetricOAWindowsImp() override = default;
|
||||
ze_result_t getMetricsTimerResolution(uint64_t &timerResolution) override;
|
||||
|
||||
private:
|
||||
Device &device;
|
||||
};
|
||||
|
||||
MetricOAWindowsImp::MetricOAWindowsImp(Device &device) : device(device) {}
|
||||
|
||||
std::unique_ptr<MetricOAOsInterface> MetricOAOsInterface::create(Device &device) {
|
||||
return std::make_unique<MetricOAWindowsImp>(device);
|
||||
return std::make_unique<MetricOAWindowsImp>();
|
||||
}
|
||||
|
||||
ze_result_t MetricOAWindowsImp::getMetricsTimerResolution(uint64_t &timerResolution) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -33,7 +33,7 @@ bool MetricsLibrary::getContextData(Device &device, ContextCreateData_1_0 &conte
|
||||
// Copy escape data (adapter/device/escape function).
|
||||
osData.KmdInstrumentationEnabled = true;
|
||||
osData.Device = reinterpret_cast<void *>(static_cast<UINT_PTR>(wddm->getDeviceHandle()));
|
||||
osData.Escape = wddm->getEscapeHandle();
|
||||
osData.Escape = reinterpret_cast<void *>(wddm->getEscapeHandle());
|
||||
osData.Adapter =
|
||||
reinterpret_cast<void *>(static_cast<UINT_PTR>(wddm->getAdapter()));
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ class WddmFanImp : public OsFan, NEO::NonCopyableOrMovableClass {
|
||||
KmdSysManager *pKmdSysManager = nullptr;
|
||||
|
||||
private:
|
||||
uint64_t prevTS = 0;
|
||||
uint32_t prevPulses = 0;
|
||||
int32_t maxPoints = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -69,8 +69,6 @@ class WddmFrequencyImp : public OsFrequency, NEO::NonCopyableOrMovableClass {
|
||||
ze_result_t getRange(double *min, double *max);
|
||||
void readOverclockingInfo();
|
||||
ze_result_t applyOcSettings();
|
||||
double minRangeFreq = -1.0;
|
||||
double maxRangeFreq = -1.0;
|
||||
zes_oc_capabilities_t ocCapabilities = {};
|
||||
zes_oc_mode_t currentVoltageMode = ZES_OC_MODE_OFF;
|
||||
double currentFrequencyTarget = -1.0;
|
||||
|
||||
@@ -12,7 +12,20 @@
|
||||
#include "level_zero/tools/source/sysman/sysman_const.h"
|
||||
#include "level_zero/tools/source/sysman/windows/os_sysman_imp.h"
|
||||
|
||||
#include <pdh.h>
|
||||
#if __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic"
|
||||
#pragma clang diagnostic ignored "-Wpragma-pack"
|
||||
#pragma clang diagnostic ignored "-Wignored-attributes"
|
||||
#pragma clang diagnostic ignored "-Wmacro-redefined"
|
||||
#define UNICODE
|
||||
#endif
|
||||
|
||||
#include <Pdh.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
typedef PDH_STATUS(__stdcall *fn_PdhOpenQueryW)(LPCWSTR szDataSource, DWORD_PTR dwUserData, PDH_HQUERY *phQuery);
|
||||
typedef PDH_STATUS(__stdcall *fn_PdhAddEnglishCounterW)(PDH_HQUERY hQuery, LPCWSTR szFullCounterPath, DWORD_PTR dwUserData, PDH_HCOUNTER *phCounter);
|
||||
|
||||
@@ -146,7 +146,7 @@ NTSTATUS KmdSysManager::escape(uint32_t escapeOp, uint64_t pDataIn, uint32_t dat
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
if (pWddmAccess) {
|
||||
D3DKMT_ESCAPE escapeCommand = {0};
|
||||
PcEscapeInfo pcEscape = {0};
|
||||
PcEscapeInfo pcEscape = {};
|
||||
escapeCommand.Flags.HardwareAccess = 0;
|
||||
escapeCommand.Flags.Reserved = 0;
|
||||
escapeCommand.hAdapter = (D3DKMT_HANDLE)0;
|
||||
|
||||
Reference in New Issue
Block a user