mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
For using fixed width integer types[1], the `<cstdint>`[2] C++ header needs to be explicitly included with GCC 15 due to changes[3] in libstdc++. For details, see the documentation[4] about porting to GCC 15. [1] https://en.cppreference.com/w/cpp/types/integer [2] https://en.cppreference.com/w/cpp/header/cstdint [3] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84 [4] https://gcc.gnu.org/gcc-15/porting_to.html#cxx Signed-off-by: Daniel Bermond <dbermond@archlinux.org>
66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
/*
|
|
* Copyright (C) 2020-2025 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include <cstdint>
|
|
#include <memory>
|
|
namespace NEO {
|
|
struct HardwareInfo;
|
|
class LinearStream;
|
|
class IndirectHeap;
|
|
struct DebugData;
|
|
class GraphicsAllocation;
|
|
struct RootDeviceEnvironment;
|
|
|
|
class Debugger {
|
|
public:
|
|
struct SbaAddresses {
|
|
constexpr static size_t trackedAddressCount = 6;
|
|
uint64_t generalStateBaseAddress = 0;
|
|
uint64_t surfaceStateBaseAddress = 0;
|
|
uint64_t dynamicStateBaseAddress = 0;
|
|
uint64_t indirectObjectBaseAddress = 0;
|
|
uint64_t instructionBaseAddress = 0;
|
|
uint64_t bindlessSurfaceStateBaseAddress = 0;
|
|
uint64_t bindlessSamplerStateBaseAddress = 0;
|
|
};
|
|
|
|
virtual ~Debugger() = default;
|
|
virtual void captureStateBaseAddress(NEO::LinearStream &cmdStream, SbaAddresses sba, bool useFirstLevelBB) = 0;
|
|
virtual size_t getSbaTrackingCommandsSize(size_t trackedAddressCount) = 0;
|
|
|
|
void *getDebugSurfaceReservedSurfaceState(IndirectHeap &ssh);
|
|
|
|
inline static bool isDebugEnabled(bool internalUsage) {
|
|
return !internalUsage;
|
|
}
|
|
};
|
|
|
|
enum class DebuggingMode : uint32_t {
|
|
disabled,
|
|
online,
|
|
offline
|
|
};
|
|
|
|
inline DebuggingMode getDebuggingMode(uint32_t programDebugging) {
|
|
switch (programDebugging) {
|
|
case 1: {
|
|
return DebuggingMode::online;
|
|
}
|
|
case 2: {
|
|
return DebuggingMode::offline;
|
|
}
|
|
case 0:
|
|
default: {
|
|
return DebuggingMode::disabled;
|
|
}
|
|
}
|
|
}
|
|
|
|
static_assert(std::is_standard_layout<Debugger::SbaAddresses>::value);
|
|
} // namespace NEO
|