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
Cette révision appartient à :
1 Parent
e8488126a8
révision
9d739c200c
5 fichiers modifiés
+67
-24
Aucun fichier ne correspond à votre recherche
@@ -3562,31 +3562,56 @@ VirtualGPU::submitTransferBufferFromFile(amd::TransferBufferFileCommand& cmd)
|
||||
{
|
||||
size_t copySize = cmd.size()[0];
|
||||
size_t fileOffset = cmd.fileOffset();
|
||||
size_t srcDstOffset = cmd.origin()[0];
|
||||
Memory* mem = dev().getGpuMemory(&cmd.memory());
|
||||
uint idx = 0;
|
||||
|
||||
assert((cmd.type() == CL_COMMAND_READ_SSG_FILE_AMD) ||
|
||||
(cmd.type() == CL_COMMAND_WRITE_SSG_FILE_AMD));
|
||||
bool writeBuffer(cmd.type() == CL_COMMAND_READ_SSG_FILE_AMD);
|
||||
(cmd.type() == CL_COMMAND_WRITE_SSG_FILE_AMD));
|
||||
const bool writeBuffer(cmd.type() == CL_COMMAND_READ_SSG_FILE_AMD);
|
||||
|
||||
while (copySize > 0) {
|
||||
Memory* staging = dev().getGpuMemory(&cmd.staging(idx));
|
||||
size_t srcDstSize = amd::TransferBufferFileCommand::StagingBufferSize;
|
||||
srcDstSize = std::min(srcDstSize, copySize);
|
||||
void* srcDstBuffer = staging->cpuMap(*this);
|
||||
if (!cmd.file()->transferBlock(writeBuffer,
|
||||
srcDstBuffer, staging->size(), fileOffset, 0, srcDstSize)) {
|
||||
cmd.setStatus(CL_INVALID_OPERATION);
|
||||
return;
|
||||
if (writeBuffer) {
|
||||
size_t dstOffset = cmd.origin()[0];
|
||||
while (copySize > 0) {
|
||||
Memory* staging = dev().getGpuMemory(&cmd.staging(idx));
|
||||
size_t dstSize = amd::TransferBufferFileCommand::StagingBufferSize;
|
||||
dstSize = std::min(dstSize, copySize);
|
||||
void* dstBuffer = staging->cpuMap(*this);
|
||||
if (!cmd.file()->transferBlock(writeBuffer,
|
||||
dstBuffer, staging->size(), fileOffset, 0, dstSize)) {
|
||||
cmd.setStatus(CL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
staging->cpuUnmap(*this);
|
||||
|
||||
bool result = blitMgr().copyBuffer(*staging, *mem,
|
||||
0, dstOffset, dstSize, false);
|
||||
flushDMA(getGpuEvent(staging->gslResource())->engineId_);
|
||||
fileOffset += dstSize;
|
||||
dstOffset += dstSize;
|
||||
copySize -= dstSize;
|
||||
}
|
||||
staging->cpuUnmap(*this);
|
||||
}
|
||||
else {
|
||||
size_t srcOffset = cmd.origin()[0];
|
||||
while (copySize > 0) {
|
||||
Memory* staging = dev().getGpuMemory(&cmd.staging(idx));
|
||||
size_t srcSize = amd::TransferBufferFileCommand::StagingBufferSize;
|
||||
srcSize = std::min(srcSize, copySize);
|
||||
bool result = blitMgr().copyBuffer(*mem, *staging,
|
||||
srcOffset, 0, srcSize, false);
|
||||
|
||||
bool result = blitMgr().copyBuffer(*staging, *mem,
|
||||
fileOffset, srcDstOffset, srcDstSize, false);
|
||||
flushDMA(getGpuEvent(staging->gslResource())->engineId_);
|
||||
srcDstOffset += srcDstSize;
|
||||
copySize -= srcDstSize;
|
||||
void* srcBuffer = staging->cpuMap(*this);
|
||||
if (!cmd.file()->transferBlock(writeBuffer,
|
||||
srcBuffer, staging->size(), fileOffset, 0, srcSize)) {
|
||||
cmd.setStatus(CL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
staging->cpuUnmap(*this);
|
||||
|
||||
fileOffset += srcSize;
|
||||
srcOffset += srcSize;
|
||||
copySize -= srcSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur