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


[ROCm/clr commit: 46f37631fb]
Αυτή η υποβολή περιλαμβάνεται σε:
foreman
2019-09-17 14:59:50 -04:00
γονέας 696b8cf85d
υποβολή e5578ee6d5
4 αρχεία άλλαξαν με 26 προσθήκες και 2 διαγραφές
@@ -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);
@@ -151,6 +151,7 @@ Settings::Settings() {
enableHwP2P_ = false;
imageBufferWar_ = false;
disableSdma_ = PAL_DISABLE_SDMA;
mallPolicy_ = 0;
}
bool Settings::create(const Pal::DeviceProperties& palProp,
@@ -551,6 +552,10 @@ void Settings::override() {
enableCoopGroups_ = GPU_ENABLE_COOP_GROUPS;
enableCoopMultiDeviceGroups_ = GPU_ENABLE_COOP_GROUPS;
}
if (!flagIsDefault(PAL_MALL_POLICY)) {
mallPolicy_ = PAL_MALL_POLICY;
}
}
} // namespace pal
@@ -94,6 +94,7 @@ class Settings : public device::Settings {
uint64_t maxAllocSize_; //!< Maximum single allocation size
uint rgpSqttDispCount_; //!< The number of dispatches captured in SQTT
uint maxCmdBuffers_; //!< Maximum number of command buffers allocated per queue
uint mallPolicy_; //!< 0 - default, 1 - always bypass, 2 - always put
uint64_t subAllocationMinSize_; //!< Minimum size allowed for suballocations
uint64_t subAllocationMaxSize_; //!< Maximum size allowed with suballocations
@@ -167,6 +167,11 @@ release_on_stg(bool, PAL_DISABLE_SDMA, false, \
"1 = Disable SDMA for PAL") \
release(uint, PAL_RGP_DISP_COUNT, 50, \
"The number of dispatches for RGP capture with SQTT") \
release(uint, PAL_MALL_POLICY, 0, \
"Controls the behaviour of allocations with respect to the MALL" \
"0 = MALL policy is decided by KMD" \
"1 = Allocations are never put through the MALL" \
"2 = Allocations will always be put through the MALL") \
release(bool, GPU_ENABLE_WAVE32_MODE, true, \
"Enables Wave32 compilation in HW if available") \
release(bool, GPU_ENABLE_LC, true, \