refactor: use releaseHelper when checking global allocator enabled

Related-To: NEO-7063

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2024-07-11 12:12:33 +00:00
committed by Compute-Runtime-Automation
parent b794932112
commit 0d5d960e30
4 changed files with 9 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ class ReleaseHelper {
virtual bool isRcsExposureDisabled() const = 0;
virtual std::vector<uint32_t> getSupportedNumGrfs() const = 0;
virtual bool isBindlessAddressingDisabled() const = 0;
virtual bool isGlobalBindlessAllocatorEnabled() const = 0;
virtual uint32_t getNumThreadsPerEu() const = 0;
virtual uint64_t getTotalMemBankSize() const = 0;
virtual const ThreadsPerEUConfigs getThreadsPerEUConfigs() const = 0;
@@ -88,6 +89,7 @@ class ReleaseHelperHw : public ReleaseHelper {
bool isRcsExposureDisabled() const override;
std::vector<uint32_t> getSupportedNumGrfs() const override;
bool isBindlessAddressingDisabled() const override;
bool isGlobalBindlessAllocatorEnabled() const override;
uint32_t getNumThreadsPerEu() const override;
uint64_t getTotalMemBankSize() const override;
const StackVec<uint32_t, 6> getThreadsPerEUConfigs() const override;

View File

@@ -94,6 +94,11 @@ bool ReleaseHelperHw<releaseType>::isBindlessAddressingDisabled() const {
return true;
}
template <ReleaseType releaseType>
bool ReleaseHelperHw<releaseType>::isGlobalBindlessAllocatorEnabled() const {
return false;
}
template <ReleaseType releaseType>
uint32_t ReleaseHelperHw<releaseType>::getNumThreadsPerEu() const {
return 8u;

View File

@@ -31,6 +31,7 @@ class MockReleaseHelper : public ReleaseHelper {
ADDMETHOD_CONST_NOBASE(isRcsExposureDisabled, bool, false, ());
ADDMETHOD_CONST_NOBASE(getSupportedNumGrfs, std::vector<uint32_t>, {128}, ());
ADDMETHOD_CONST_NOBASE(isBindlessAddressingDisabled, bool, true, ());
ADDMETHOD_CONST_NOBASE(isGlobalBindlessAllocatorEnabled, bool, false, ());
ADDMETHOD_CONST_NOBASE(getNumThreadsPerEu, uint32_t, 8u, ());
ADDMETHOD_CONST_NOBASE(getTotalMemBankSize, uint64_t, 32ull * MemoryConstants::gigaByte, ());
ADDMETHOD_CONST_NOBASE(getThreadsPerEUConfigs, const ThreadsPerEUConfigs, {}, ());