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
Tá an tiomantas seo le fáil i:
@@ -409,7 +409,7 @@ void VirtualGPU::MemoryDependency::validate(VirtualGPU& gpu, const Memory* memor
|
||||
}
|
||||
|
||||
uint64_t curStart = memory->vmAddress();
|
||||
uint64_t curEnd = curStart + memory->vmSize();
|
||||
uint64_t curEnd = curStart + memory->size();
|
||||
|
||||
// Loop through all memory objects in the queue and find dependency
|
||||
// @note don't include objects from the current kernel
|
||||
@@ -1974,6 +1974,7 @@ void VirtualGPU::PostDeviceEnqueue(
|
||||
uint64_t vmParentWrap,
|
||||
GpuEvent* gpuEvent)
|
||||
{
|
||||
uint32_t id = gpuEvent->id;
|
||||
amd::DeviceQueue* defQueue = kernel.program().context().defDeviceQueue(dev());
|
||||
|
||||
// Make sure exculsive access to the device queue
|
||||
@@ -2055,6 +2056,9 @@ void VirtualGPU::PostDeviceEnqueue(
|
||||
iCmd()->CmdVirtualQueueHandshake(vmParentWrap + offsetof(AmdAqlWrap, state), AQL_WRAP_DONE,
|
||||
vmParentWrap + offsetof(AmdAqlWrap, child_counter),
|
||||
signalAddr, dev().settings().useDeviceQueue_);
|
||||
if (id != gpuEvent->id) {
|
||||
LogError("Something is wrong. ID mismatch!\n");
|
||||
}
|
||||
eventEnd(MainEngine, *gpuEvent);
|
||||
}
|
||||
|
||||
@@ -2203,6 +2207,9 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
|
||||
if (profiling() || state_.profileEnabled_) {
|
||||
addBarrier();
|
||||
}
|
||||
if (id != gpuEvent.id) {
|
||||
LogError("Something is wrong. ID mismatch!\n");
|
||||
}
|
||||
eventEnd(MainEngine, gpuEvent);
|
||||
|
||||
// Execute scheduler for device enqueue
|
||||
@@ -2210,9 +2217,6 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
|
||||
PostDeviceEnqueue(kernel, hsaKernel, gpuDefQueue, vmDefQueue, vmParentWrap, &gpuEvent);
|
||||
}
|
||||
|
||||
if (id != gpuEvent.id) {
|
||||
LogError("Something is wrong. ID mismatch!\n");
|
||||
}
|
||||
// Update the global GPU event
|
||||
setGpuEvent(gpuEvent, needFlush);
|
||||
|
||||
@@ -2266,7 +2270,7 @@ void VirtualGPU::submitMarker(amd::Marker& vcmd) {
|
||||
}
|
||||
}
|
||||
|
||||
void VirtualGPU::releaseMemory(GpuMemoryReference* mem, GpuEvent* event) {
|
||||
void VirtualGPU::releaseMemory(GpuMemoryReference* mem) {
|
||||
queues_[MainEngine]->removeCmdMemRef(mem);
|
||||
queues_[SdmaEngine]->removeCmdMemRef(mem);
|
||||
}
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir