P4 to Git Change 1527848 by gandryey@gera-w8 on 2018/03/15 17:11:43

SWDEV-79445 - OCL generic changes and code clean-up
	- Add suballocations support for local(invisible) memory. It should significantly improve memory footprint and TLB usage with 2MB pages
	- Implementation uses BuddyAllocator provided in PAL
	- The chunk allocation size is 64MB, min allocation 4KB and max 4MB. GPU_MAX_SUBALLOC_SIZE controls the max size in KB

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#33 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#76 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#56 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#51 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#77 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#285 edit
This commit is contained in:
foreman
2018-03-15 17:26:25 -04:00
parent c4a81872f3
commit 7ae94da05b
11 changed files with 947 additions and 664 deletions
+2 -2
View File
@@ -89,14 +89,14 @@ void Segment::copy(size_t offset, const void* src, size_t size) {
amd::ScopedLock k(gpuAccess_->dev().xferMgr().lockXfer());
VirtualGPU& gpu = *gpuAccess_->dev().xferQueue();
Memory& xferBuf = gpuAccess_->dev().xferWrite().acquire();
size_t tmpSize = std::min(static_cast<size_t>(xferBuf.vmSize()), size);
size_t tmpSize = std::min(static_cast<size_t>(xferBuf.size()), size);
size_t srcOffs = 0;
while (size != 0) {
xferBuf.hostWrite(&gpu, reinterpret_cast<const_address>(src) + srcOffs, 0, tmpSize);
xferBuf.partialMemCopyTo(gpu, 0, (offset + srcOffs), tmpSize, *gpuAccess_, false, true);
size -= tmpSize;
srcOffs += tmpSize;
tmpSize = std::min(static_cast<size_t>(xferBuf.vmSize()), size);
tmpSize = std::min(static_cast<size_t>(xferBuf.size()), size);
}
gpu.waitAllEngines();
}