mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Add HwHelper::getLocalMemoryAccessMode helper function
Change-Id: Ia181cfca11f648f1631e1fcd82458024d019e038 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
526e9eb962
commit
4011f0361e
@@ -192,3 +192,4 @@ DECLARE_DEBUG_VARIABLE(int32_t, AllocateSharedAllocationsWithCpuAndGpuStorage, -
|
||||
DECLARE_DEBUG_VARIABLE(bool, UseMaxSimdSizeToDeduceMaxWorkgroupSize, false, "With this flag on, max workgroup size is deduced using SIMD32 instead of SIMD8, this causes the max wkg size to be 4 times bigger")
|
||||
DECLARE_DEBUG_VARIABLE(bool, ReturnRawGpuTimestamps, false, "Driver returns raw GPU tiemstamps instead of calculated ones.")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceSemaphoreDelayBetweenWaits, -1, "Specifies the minimum number of microseconds allowed for command streamer to wait before re-fetching the data. 0 - poll interval will be equal to the memory latency of the read completion")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceLocalMemoryAccessMode, -1, "-1: don't override, 0: default rules apply, 1: CPU can access local memory, 3: CPU never accesses local memory")
|
||||
|
||||
@@ -29,6 +29,12 @@ struct HardwareCapabilities;
|
||||
struct RootDeviceEnvironment;
|
||||
struct PipeControlArgs;
|
||||
|
||||
enum class LocalMemoryAccessMode {
|
||||
Default = 0,
|
||||
CpuAccessAllowed = 1,
|
||||
CpuAccessDisallowed = 3
|
||||
};
|
||||
|
||||
class HwHelper {
|
||||
public:
|
||||
using EngineInstancesContainer = StackVec<aub_stream::EngineType, 32>;
|
||||
@@ -57,6 +63,7 @@ class HwHelper {
|
||||
virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0;
|
||||
virtual bool allowRenderCompression(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0;
|
||||
static bool renderCompressedBuffersSupported(const HardwareInfo &hwInfo);
|
||||
static bool renderCompressedImagesSupported(const HardwareInfo &hwInfo);
|
||||
static bool cacheFlushAfterWalkerSupported(const HardwareInfo &hwInfo);
|
||||
@@ -111,6 +118,8 @@ class HwHelper {
|
||||
static constexpr uint32_t internalUsageEngineIndex = 2;
|
||||
|
||||
protected:
|
||||
virtual LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
HwHelper() = default;
|
||||
};
|
||||
|
||||
@@ -273,9 +282,13 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool isBankOverrideRequired(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
protected:
|
||||
LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
static const AuxTranslationMode defaultAuxTranslationMode;
|
||||
HwHelperHw() = default;
|
||||
};
|
||||
|
||||
@@ -392,6 +392,22 @@ inline bool HwHelperHw<GfxFamily>::isBlitCopyRequiredForLocalMemory(const Hardwa
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
LocalMemoryAccessMode HwHelperHw<GfxFamily>::getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const {
|
||||
switch (static_cast<LocalMemoryAccessMode>(DebugManager.flags.ForceLocalMemoryAccessMode.get())) {
|
||||
case LocalMemoryAccessMode::Default:
|
||||
case LocalMemoryAccessMode::CpuAccessAllowed:
|
||||
case LocalMemoryAccessMode::CpuAccessDisallowed:
|
||||
return static_cast<LocalMemoryAccessMode>(DebugManager.flags.ForceLocalMemoryAccessMode.get());
|
||||
}
|
||||
return getDefaultLocalMemoryAccessMode(hwInfo);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline LocalMemoryAccessMode HwHelperHw<GfxFamily>::getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const {
|
||||
return LocalMemoryAccessMode::Default;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForFullCacheFlush() {
|
||||
return sizeof(typename GfxFamily::PIPE_CONTROL);
|
||||
|
||||
Reference in New Issue
Block a user