P4 to Git Change 1323915 by gandryey@gera-w8 on 2016/10/07 12:59:30
SWDEV-104441 - [SSG] OpenCL has not implemented the asynchronous transfer - Use lock protection for multiple maps of persistent memory - Don't mark persistent as host mem - Implement file write for invisible memory Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#129 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#236 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#408 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#13 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#77 edit
This commit is contained in:
@@ -592,7 +592,15 @@ TransferBufferFileCommand::submit(device::VirtualDevice& device)
|
||||
device::Memory* mem = memory_->getDeviceMemory(queue()->device());
|
||||
if (memory_->getMemFlags() & (CL_MEM_USE_HOST_PTR |
|
||||
CL_MEM_ALLOC_HOST_PTR | CL_MEM_USE_PERSISTENT_MEM_AMD)) {
|
||||
void* srcDstBuffer = mem->cpuMap(device);
|
||||
void* srcDstBuffer = nullptr;
|
||||
if (memory_->getMemFlags() & CL_MEM_USE_PERSISTENT_MEM_AMD) {
|
||||
// Lock protected multiple maps for persistent memory
|
||||
amd::ScopedLock lock(mem->owner()->lockMemoryOps());
|
||||
srcDstBuffer = mem->cpuMap(device);
|
||||
}
|
||||
else {
|
||||
srcDstBuffer = mem->cpuMap(device);
|
||||
}
|
||||
// Make HD transfer to the host accessible memory
|
||||
bool writeBuffer(type() == CL_COMMAND_READ_SSG_FILE_AMD);
|
||||
if (!file()->transferBlock(writeBuffer, srcDstBuffer, mem->size(),
|
||||
@@ -600,7 +608,14 @@ TransferBufferFileCommand::submit(device::VirtualDevice& device)
|
||||
setStatus(CL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
mem->cpuUnmap(device);
|
||||
if (memory_->getMemFlags() & CL_MEM_USE_PERSISTENT_MEM_AMD) {
|
||||
// Lock protected multiple maps for persistent memory
|
||||
amd::ScopedLock lock(mem->owner()->lockMemoryOps());
|
||||
mem->cpuUnmap(device);
|
||||
}
|
||||
else {
|
||||
mem->cpuUnmap(device);
|
||||
}
|
||||
}
|
||||
else {
|
||||
device.submitTransferBufferFromFile(*this);
|
||||
|
||||
Reference in New Issue
Block a user