mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Reduce usage of global gfx core helper getter [1/n]
Related-To: NEO-6853 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
637c4e5621
commit
8f308f24e5
@@ -97,7 +97,7 @@ class GfxCoreHelper {
|
||||
virtual uint32_t getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0;
|
||||
virtual bool isLinearStoragePreferred(bool isSharedContext, bool isImage1d, bool forceLinearStorage) = 0;
|
||||
virtual uint8_t getBarriersCountFromHasBarriers(uint8_t hasBarriers) const = 0;
|
||||
virtual uint32_t calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) = 0;
|
||||
virtual uint32_t calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const = 0;
|
||||
virtual uint32_t alignSlmSize(uint32_t slmSize) = 0;
|
||||
virtual uint32_t computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) = 0;
|
||||
|
||||
@@ -277,7 +277,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
|
||||
uint8_t getBarriersCountFromHasBarriers(uint8_t hasBarriers) const override;
|
||||
|
||||
uint32_t calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) override;
|
||||
uint32_t calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const override;
|
||||
|
||||
uint32_t alignSlmSize(uint32_t slmSize) override;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ uint32_t GfxCoreHelperHw<GfxFamily>::getMocsIndex(const GmmHelper &gmmHelper, bo
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint32_t GfxCoreHelperHw<GfxFamily>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) {
|
||||
uint32_t GfxCoreHelperHw<GfxFamily>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const {
|
||||
return hwInfo.gtSystemInfo.ThreadCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ size_t GfxCoreHelperHw<Family>::getPaddingForISAAllocation() const {
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t GfxCoreHelperHw<Family>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) {
|
||||
uint32_t GfxCoreHelperHw<Family>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const {
|
||||
auto maxThreadsPerEuCount = 1024u / grfCount;
|
||||
return maxThreadsPerEuCount * hwInfo.gtSystemInfo.EUCount;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ uint32_t GfxCoreHelperHw<GfxFamily>::getMocsIndex(const GmmHelper &gmmHelper, bo
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint32_t GfxCoreHelperHw<GfxFamily>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) {
|
||||
uint32_t GfxCoreHelperHw<GfxFamily>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const {
|
||||
if (grfCount > GrfConfig::DefaultGrfNumber) {
|
||||
return hwInfo.gtSystemInfo.ThreadCount / 2u;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user