P4 to Git Change 1999659 by vsytchen@vsytchen-remote-ocl-win10 on 2019/09/17 14:52:23

SWDEV-193973 - Add MALL support for the PAL backend

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/17995/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#78 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#99 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#318 edit
This commit is contained in:
foreman
2019-09-17 14:59:50 -04:00
parent f1ca6e457b
commit 46f37631fb
4 changed files with 26 additions and 2 deletions
+15 -2
View File
@@ -419,6 +419,19 @@ void Resource::memTypeToHeap(Pal::GpuMemoryCreateInfo* createInfo) {
createInfo->heaps[0] = Pal::GpuHeapLocal;
break;
}
#if !IS_MAINLINE
// Pick the appropriate mall policy based on the mem type
switch (memoryType()) {
case Local:
case Scratch:
createInfo->mallPolicy = static_cast<Pal::GpuMemMallPolicy>(dev().settings().mallPolicy_);
break;
default:
createInfo->mallPolicy = Pal::GpuMemMallPolicy::Never;
break;
}
#endif
}
// ================================================================================================
@@ -1873,7 +1886,7 @@ bool MemorySubAllocator::CreateChunk(const Pal::IGpuMemory* reserved_va) {
createInfo.priority = Pal::GpuMemPriority::Normal;
createInfo.heapCount = 1;
createInfo.heaps[0] = Pal::GpuHeapInvisible;
createInfo.flags.peerWritable = device_->P2PAccessAllowed();
createInfo.flags.peerWritable = device_->P2PAccessAllowed();.mallPolicy_);)
GpuMemoryReference* mem_ref = GpuMemoryReference::Create(*device_, createInfo);
if (mem_ref != nullptr) {
return InitAllocator(mem_ref);
@@ -1892,7 +1905,7 @@ bool CoarseMemorySubAllocator::CreateChunk(const Pal::IGpuMemory* reserved_va) {
createInfo.pReservedGpuVaOwner = reserved_va;
createInfo.heapCount = 2;
createInfo.heaps[0] = Pal::GpuHeapInvisible;
createInfo.heaps[1] = Pal::GpuHeapLocal;
createInfo.heaps[1] = Pal::GpuHeapLocal;.mallPolicy_);)
GpuMemoryReference* mem_ref = GpuMemoryReference::Create(*device_, createInfo);
if (mem_ref != nullptr) {
return InitAllocator(mem_ref);