P4 to Git Change 1364923 by gandryey@gera-lnx-rcf-lc on 2017/01/23 11:48:45
SWDEV-110996 - OCL to use the blit manager instead ROCr implementing copyRect API
- Implement the blit manager functionality in ROCm backened. This checki-in also fixes SWDEV-95079, SWDEV-95068, SWDEV-95069, SWDEV-95071
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdefs.hpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#35 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#6 edit
[ROCm/clr commit: 454621b7f1]
This commit is contained in:
1 parent
f483250946
commit
8b58936282
11 files changed
+2820
-1527
No files matched your search
@@ -446,6 +446,9 @@ bool VirtualGPU::releaseGpuMemoryFence() {
|
||||
|
||||
hasPendingDispatch_ = false;
|
||||
|
||||
// Release all transfer buffers on this command queue
|
||||
releaseXferWrite();
|
||||
|
||||
// Release all memory dependencies
|
||||
memoryDependency().clear();
|
||||
|
||||
@@ -1774,8 +1777,66 @@ void VirtualGPU::submitReleaseExtObjects(amd::ReleaseExtObjectsCommand& vcmd)
|
||||
profilingEnd(vcmd);
|
||||
}
|
||||
|
||||
void VirtualGPU::flush(amd::Command *list, bool wait) {
|
||||
void VirtualGPU::flush(amd::Command *list, bool wait)
|
||||
{
|
||||
releaseGpuMemoryFence();
|
||||
updateCommandsState(list);
|
||||
// Rlease all pinned memory
|
||||
releasePinnedMem();
|
||||
}
|
||||
|
||||
void
|
||||
VirtualGPU::addXferWrite(Memory& memory)
|
||||
{
|
||||
if (xferWriteBuffers_.size() > 7) {
|
||||
dev().xferWrite().release(*this, *xferWriteBuffers_.front());
|
||||
xferWriteBuffers_.erase(xferWriteBuffers_.begin());
|
||||
}
|
||||
|
||||
// Delay destruction
|
||||
xferWriteBuffers_.push_back(&memory);
|
||||
}
|
||||
|
||||
void
|
||||
VirtualGPU::releaseXferWrite()
|
||||
{
|
||||
for (auto& memory : xferWriteBuffers_) {
|
||||
dev().xferWrite().release(*this, *memory);
|
||||
}
|
||||
xferWriteBuffers_.resize(0);
|
||||
}
|
||||
|
||||
void
|
||||
VirtualGPU::addPinnedMem(amd::Memory* mem)
|
||||
{
|
||||
if (nullptr == findPinnedMem(mem->getHostMem(), mem->getSize())) {
|
||||
if (pinnedMems_.size() > 7) {
|
||||
pinnedMems_.front()->release();
|
||||
pinnedMems_.erase(pinnedMems_.begin());
|
||||
}
|
||||
|
||||
// Delay destruction
|
||||
pinnedMems_.push_back(mem);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VirtualGPU::releasePinnedMem()
|
||||
{
|
||||
for (auto& amdMemory : pinnedMems_) {
|
||||
amdMemory->release();
|
||||
}
|
||||
pinnedMems_.resize(0);
|
||||
}
|
||||
|
||||
amd::Memory*
|
||||
VirtualGPU::findPinnedMem(void* addr, size_t size)
|
||||
{
|
||||
for (auto& amdMemory : pinnedMems_) {
|
||||
if ((amdMemory->getHostMem() == addr) && (size <= amdMemory->getSize())) {
|
||||
return amdMemory;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
} // End of roc namespace
|
||||
Reference in new issue
Block a user