P4 to Git Change 1535454 by todli@todli-win-opencl-kv1 on 2018/04/02 11:12:16
SWDEV-133452 - 1.Add HostMemoryDirectAccess flag to SDI ExternalPhysical memory
2.Disable host writeBuffer for SDI ExternalPhysical memory
3.Support marker offset for SDI WriteMarker in Runtime
http://ocltc.amd.com/reviews/r/14518/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#81 edit
[ROCm/clr commit: e7fb98dd94]
Этот коммит содержится в:
@@ -298,7 +298,9 @@ bool DmaBlitManager::writeBuffer(const void* srcHost, device::Memory& dstMemory,
|
||||
const amd::Coord3D& origin, const amd::Coord3D& size,
|
||||
bool entire) const {
|
||||
// Use host copy if memory has direct access or it's persistent
|
||||
if (setup_.disableWriteBuffer_ || gpuMem(dstMemory).isHostMemDirectAccess() ||
|
||||
if (setup_.disableWriteBuffer_ ||
|
||||
(gpuMem(dstMemory).isHostMemDirectAccess() &&
|
||||
(gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) ||
|
||||
gpuMem(dstMemory).isPersistentDirectMap()) {
|
||||
return HostBlitManager::writeBuffer(srcHost, dstMemory, origin, size, entire);
|
||||
} else {
|
||||
@@ -384,7 +386,9 @@ bool DmaBlitManager::writeBufferRect(const void* srcHost, device::Memory& dstMem
|
||||
const amd::BufferRect& bufRect, const amd::Coord3D& size,
|
||||
bool entire) const {
|
||||
// Use host copy if memory has direct access or it's persistent
|
||||
if (setup_.disableWriteBufferRect_ || dstMemory.isHostMemDirectAccess() ||
|
||||
if (setup_.disableWriteBufferRect_ ||
|
||||
(dstMemory.isHostMemDirectAccess() &&
|
||||
(gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) ||
|
||||
gpuMem(dstMemory).isPersistentDirectMap()) {
|
||||
return HostBlitManager::writeBufferRect(srcHost, dstMemory, hostRect, bufRect, size, entire);
|
||||
} else {
|
||||
@@ -1926,7 +1930,9 @@ bool KernelBlitManager::writeBuffer(const void* srcHost, device::Memory& dstMemo
|
||||
bool result = false;
|
||||
|
||||
// Use host copy if memory has direct access or it's persistent
|
||||
if (setup_.disableWriteBuffer_ || gpuMem(dstMemory).isHostMemDirectAccess() ||
|
||||
if (setup_.disableWriteBuffer_ ||
|
||||
(gpuMem(dstMemory).isHostMemDirectAccess() &&
|
||||
(gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) ||
|
||||
(gpuMem(dstMemory).memoryType() == Resource::Persistent)) {
|
||||
result = HostBlitManager::writeBuffer(srcHost, dstMemory, origin, size, entire);
|
||||
synchronize();
|
||||
@@ -1975,7 +1981,9 @@ bool KernelBlitManager::writeBufferRect(const void* srcHost, device::Memory& dst
|
||||
bool result = false;
|
||||
|
||||
// Use host copy if memory has direct access or it's persistent
|
||||
if (setup_.disableWriteBufferRect_ || gpuMem(dstMemory).isHostMemDirectAccess() ||
|
||||
if (setup_.disableWriteBufferRect_ ||
|
||||
(gpuMem(dstMemory).isHostMemDirectAccess() &&
|
||||
(gpuMem(dstMemory).memoryType() != Resource::ExternalPhysical)) ||
|
||||
gpuMem(dstMemory).isPersistentDirectMap()) {
|
||||
result = HostBlitManager::writeBufferRect(srcHost, dstMemory, hostRect, bufRect, size, entire);
|
||||
synchronize();
|
||||
|
||||
@@ -127,6 +127,7 @@ bool Memory::create(Resource::MemoryType memType, Resource::CreateParams* params
|
||||
if (result) {
|
||||
switch (memoryType()) {
|
||||
case Resource::Pinned:
|
||||
case Resource::ExternalPhysical:
|
||||
// Marks memory object for direct GPU access to the host memory
|
||||
flags_ |= HostMemoryDirectAccess;
|
||||
break;
|
||||
|
||||
@@ -2570,7 +2570,11 @@ void VirtualGPU::submitSignal(amd::SignalCommand& vcmd) {
|
||||
queues_[engineID_]->addCmdMemRef(pGpuMemory->memRef());
|
||||
|
||||
queues_[engineID_]->iCmd()->
|
||||
#if (PAL_CLIENT_INTERFACE_MAJOR_VERSION < 396)
|
||||
CmdUpdateBusAddressableMemoryMarker(*(pGpuMemory->iMem()), value);
|
||||
#else
|
||||
CmdUpdateBusAddressableMemoryMarker(*(pGpuMemory->iMem()), vcmd.markerOffset(), value);
|
||||
#endif
|
||||
eventEnd(engineID_, gpuEvent);
|
||||
|
||||
// Restore the original engine
|
||||
|
||||
Ссылка в новой задаче
Block a user