From fd09a7a23c79ea3e92b69bcd90e584020f2253ae Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Fri, 9 Oct 2020 14:13:32 -0400 Subject: [PATCH] [PAL] Skip extra calls to MakeResident With the PAL_ALWAYS_RESIDENT flag memory objects are resident at allocation time, no need to make them resident again before submit. Also we should never evict anything with this setting, or we'll generate a VM fault. Change-Id: Ieacc6af88ab4e09c20efd94100e148b2502e1d70 --- rocclr/device/pal/palvirtual.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocclr/device/pal/palvirtual.cpp b/rocclr/device/pal/palvirtual.cpp index 69e92e4ac8..aed53a9809 100644 --- a/rocclr/device/pal/palvirtual.cpp +++ b/rocclr/device/pal/palvirtual.cpp @@ -339,7 +339,7 @@ void VirtualGPU::Queue::addCmdDoppRef(Pal::IGpuMemory* iMem, bool lastDoppCmd, b } bool VirtualGPU::Queue::flush() { - if (palMemRefs_.size() != 0) { + if (!gpu_.dev().settings().alwaysResident_ && palMemRefs_.size() != 0) { if (Pal::Result::Success != iDev_->AddGpuMemoryReferences(palMemRefs_.size(), &palMemRefs_[0], iQueue_, Pal::GpuMemoryRefCantTrim)) { @@ -450,7 +450,7 @@ bool VirtualGPU::Queue::flush() { } } } - if (palMems_.size() != 0) { + if (!gpu_.dev().settings().alwaysResident_ && palMems_.size() != 0) { iDev_->RemoveGpuMemoryReferences(palMems_.size(), &palMems_[0], iQueue_); palMems_.clear(); }