mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
Reorganization directory structure [3/n]
Change-Id: If3dfa3f6007f8810a6a1ae1a4f0c7da38544648d
This commit is contained in:
52
shared/source/helpers/hw_helper.cpp
Normal file
52
shared/source/helpers/hw_helper.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "helpers/hw_helper.h"
|
||||
|
||||
#include "debug_settings/debug_settings_manager.h"
|
||||
|
||||
namespace NEO {
|
||||
HwHelper *hwHelperFactory[IGFX_MAX_CORE] = {};
|
||||
|
||||
HwHelper &HwHelper::get(GFXCORE_FAMILY gfxCore) {
|
||||
return *hwHelperFactory[gfxCore];
|
||||
}
|
||||
|
||||
bool HwHelper::renderCompressedBuffersSupported(const HardwareInfo &hwInfo) {
|
||||
if (DebugManager.flags.RenderCompressedBuffersEnabled.get() != -1) {
|
||||
return !!DebugManager.flags.RenderCompressedBuffersEnabled.get();
|
||||
}
|
||||
return hwInfo.capabilityTable.ftrRenderCompressedBuffers;
|
||||
}
|
||||
|
||||
bool HwHelper::renderCompressedImagesSupported(const HardwareInfo &hwInfo) {
|
||||
if (DebugManager.flags.RenderCompressedImagesEnabled.get() != -1) {
|
||||
return !!DebugManager.flags.RenderCompressedImagesEnabled.get();
|
||||
}
|
||||
return hwInfo.capabilityTable.ftrRenderCompressedImages;
|
||||
}
|
||||
|
||||
bool HwHelper::cacheFlushAfterWalkerSupported(const HardwareInfo &hwInfo) {
|
||||
int32_t dbgFlag = DebugManager.flags.EnableCacheFlushAfterWalker.get();
|
||||
if (dbgFlag == 1) {
|
||||
return true;
|
||||
} else if (dbgFlag == 0) {
|
||||
return false;
|
||||
}
|
||||
return hwInfo.capabilityTable.supportCacheFlushAfterWalker;
|
||||
}
|
||||
|
||||
uint32_t HwHelper::getMaxThreadsForVfe(const HardwareInfo &hwInfo) {
|
||||
uint32_t threadsPerEU = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU;
|
||||
return hwInfo.gtSystemInfo.EUCount * threadsPerEU;
|
||||
}
|
||||
|
||||
uint32_t HwHelper::getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const {
|
||||
uint32_t numThreadsPerEU = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
return maxNumEUsPerSubSlice * numThreadsPerEU;
|
||||
}
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user