Align only CPU VA for SVM_CPU

Resolves: NEO-7608

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2023-01-09 14:45:56 +00:00 committed by Compute-Runtime-Automation
parent eff5a281ed
commit 39df92a16f
8 changed files with 17 additions and 32 deletions

View File

@ -389,6 +389,11 @@ uint32_t ProductHelperHw<gfxProduct>::getThreadEuRatioForScratch(const HardwareI
return 8u;
}
template <PRODUCT_FAMILY gfxProduct>
size_t ProductHelperHw<gfxProduct>::getSvmCpuAlignment() const {
return MemoryConstants::pageSize2Mb;
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return getFrontEndPropertyComputeDispatchAllWalkerSupport();

View File

@ -75,9 +75,4 @@ bool ProductHelperHw<gfxProduct>::isEvictionIfNecessaryFlagSupported() const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
size_t ProductHelperHw<gfxProduct>::getSvmCpuAlignment() const {
return MemoryConstants::pageSize2Mb;
}
} // namespace NEO

View File

@ -78,9 +78,4 @@ bool ProductHelperHw<gfxProduct>::isEvictionIfNecessaryFlagSupported() const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
size_t ProductHelperHw<gfxProduct>::getSvmCpuAlignment() const {
return MemoryConstants::pageSize2Mb;
}
} // namespace NEO

View File

@ -342,7 +342,12 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryWithAlignmentImpl(const A
}
}
auto drmAllocation = createAllocWithAlignment(allocationData, cSize, cAlignment, alignedStorageSize, alignedGpuAddress);
auto mmapAlignment = cAlignment;
if (svmCpuAllocation && alignedStorageSize >= 2 * MemoryConstants::megaByte) {
mmapAlignment = MemoryConstants::pageSize2Mb;
}
auto drmAllocation = createAllocWithAlignment(allocationData, cSize, mmapAlignment, alignedStorageSize, alignedGpuAddress);
if (drmAllocation != nullptr) {
drmAllocation->setReservedAddressRange(reinterpret_cast<void *>(gpuReservationAddress), alignedVirtualAddressRangeSize);
}

View File

@ -9,3 +9,8 @@ template <>
bool ProductHelperHw<gfxProduct>::isVmBindPatIndexProgrammingSupported() const {
return true;
}
template <>
size_t ProductHelperHw<gfxProduct>::getSvmCpuAlignment() const {
return MemoryConstants::pageSize64k;
}

View File

@ -5,8 +5,6 @@
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "aubstream/product_family.h"
namespace NEO {
@ -165,11 +163,6 @@ bool ProductHelperHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const Hardwar
return false;
}
template <>
size_t ProductHelperHw<gfxProduct>::getSvmCpuAlignment() const {
return DebugManager.flags.NEO_CAL_ENABLED.get() ? MemoryConstants::pageSize64k : MemoryConstants::pageSize2Mb;
}
template <>
bool ProductHelperHw<gfxProduct>::isBlitSplitEnqueueWARequired(const HardwareInfo &hwInfo) const {
return true;

View File

@ -338,11 +338,6 @@ bool ProductHelperHw<IGFX_UNKNOWN>::isMatrixMultiplyAccumulateSupported(const Ha
return false;
}
template <>
size_t ProductHelperHw<IGFX_UNKNOWN>::getSvmCpuAlignment() const {
return MemoryConstants::pageSize64k;
}
template <>
void ProductHelperHw<IGFX_UNKNOWN>::updateScmCommand(void *const commandPtr, const StateComputeModeProperties &properties) const {
}

View File

@ -35,16 +35,8 @@ PVCTEST_F(PvcProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) {
}
PVCTEST_F(PvcProductHelperLinux, WhenGetSvmCpuAlignmentThenProperValueIsReturned) {
DebugManagerStateRestore restorer;
{
DebugManager.flags.NEO_CAL_ENABLED.set(true);
EXPECT_EQ(MemoryConstants::pageSize64k, productHelper->getSvmCpuAlignment());
}
{
DebugManager.flags.NEO_CAL_ENABLED.set(false);
EXPECT_EQ(MemoryConstants::pageSize2Mb, productHelper->getSvmCpuAlignment());
}
}
PVCTEST_F(PvcProductHelperLinux, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) {