mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
performance: Set WB cache mode for sysmem
Related-To: NEO-10867 Signed-off-by: Morek, Szymon <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
252595870e
commit
016529ac12
@@ -496,8 +496,20 @@ void IoctlHelperXe::setDefaultEngine(const aub_stream::EngineType &defaultEngine
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t IoctlHelperXe::getCpuCachingMode() {
|
||||
/**
|
||||
* @brief returns caching policy for new allocation.
|
||||
* For system memory caching policy is write-back, otherwise it's write-combined.
|
||||
*
|
||||
* @param[in] allocationInSystemMemory flag that indicates if allocation will be allocated in system memory
|
||||
*
|
||||
* @return returns caching policy defined as DRM_XE_GEM_CPU_CACHING_WC or DRM_XE_GEM_CPU_CACHING_WB
|
||||
*/
|
||||
uint16_t IoctlHelperXe::getCpuCachingMode(bool allocationInSystemMemory) const {
|
||||
uint16_t cpuCachingMode = DRM_XE_GEM_CPU_CACHING_WC;
|
||||
if (allocationInSystemMemory) {
|
||||
cpuCachingMode = DRM_XE_GEM_CPU_CACHING_WB;
|
||||
}
|
||||
|
||||
if (debugManager.flags.OverrideCpuCaching.get() != -1) {
|
||||
cpuCachingMode = debugManager.flags.OverrideCpuCaching.get();
|
||||
}
|
||||
@@ -525,7 +537,7 @@ int IoctlHelperXe::createGemExt(const MemRegionsVec &memClassInstances, size_t a
|
||||
memoryInstances.set(memoryClassInstance.memoryInstance);
|
||||
}
|
||||
create.placement = static_cast<uint32_t>(memoryInstances.to_ulong());
|
||||
create.cpu_caching = this->getCpuCachingMode();
|
||||
create.cpu_caching = this->getCpuCachingMode(mem.memoryClass == drm_xe_memory_class::DRM_XE_MEM_REGION_CLASS_SYSMEM);
|
||||
auto ret = IoctlHelper::ioctl(DrmIoctl::gemCreate, &create);
|
||||
handle = create.handle;
|
||||
|
||||
@@ -558,7 +570,7 @@ uint32_t IoctlHelperXe::createGem(uint64_t size, uint32_t memoryBanks) {
|
||||
memoryInstances.set(regionClassAndInstance.memoryInstance);
|
||||
}
|
||||
create.placement = static_cast<uint32_t>(memoryInstances.to_ulong());
|
||||
create.cpu_caching = this->getCpuCachingMode();
|
||||
create.cpu_caching = this->getCpuCachingMode(create.placement == drm_xe_memory_class::DRM_XE_MEM_REGION_CLASS_SYSMEM);
|
||||
[[maybe_unused]] auto ret = ioctl(DrmIoctl::gemCreate, &create);
|
||||
|
||||
xeLog(" -> IoctlHelperXe::%s vmid=0x%x s=0x%lx f=0x%x p=0x%x h=0x%x c=%hu r=%d\n", __FUNCTION__,
|
||||
|
||||
@@ -118,7 +118,7 @@ class IoctlHelperXe : public IoctlHelper {
|
||||
void fillExecBuffer(ExecBuffer &execBuffer, uintptr_t buffersPtr, uint32_t bufferCount, uint32_t startOffset, uint32_t size, uint64_t flags, uint32_t drmContextId) override;
|
||||
void logExecBuffer(const ExecBuffer &execBuffer, std::stringstream &logger) override;
|
||||
bool setDomainCpu(uint32_t handle, bool writeEnable) override;
|
||||
uint16_t getCpuCachingMode();
|
||||
uint16_t getCpuCachingMode(bool allocationInSystemMemory) const;
|
||||
void addDebugMetadata(DrmResourceClass type, uint64_t *offset, uint64_t size);
|
||||
void addDebugMetadataCookie(uint64_t cookie);
|
||||
uint32_t registerResource(DrmResourceClass classType, const void *data, size_t size) override;
|
||||
|
||||
Reference in New Issue
Block a user