P4 to Git Change 1239589 by mtomarov@stg-ocl-mtomarov on 2016/02/23 07:47:15

SWDEV-76870 - Add write feature to AMD extension (Merging //depot/rel/r6/15.30.1023/stream/opencl/... to //depot/stg/opencl/drivers/opencl/...)

	Add clEnqueueReadBufferToFileAMD function to AMD extension (added declaration in cl_context.cpp)
	1. Added clEnqueueReadBufferToFileAMD_fn function declaration to cl_ext.h
	2. Added LiquidFlashFile::writeBlock method who implements transfer from GPU to SSD. In order to avoid code duplication LiquidFlashFile::readBlock and LiquidFlashFile::writeBlock is called from new method LiquidFlashFile::transferBlock (changes in cl_lqdflash_amd.cpp)
	3. clEnqueueWriteBufferFromFileAMD and clEnqueueWriteBufferFromFileAMD call internal function EnqueueTransferBufferFromFileAMD who makes the same preparations as clEnqueueWriteBufferFromFileAMD in the prvious release
	4. WriteBufferFromFileCommand class is renamed to TransferBufferFromFileCommand and new class makes the same preparation except assigning transfer direction (read or write)

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#48 integrate
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#13 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.h#4 integrate
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#24 integrate
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#267 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#396 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#138 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#74 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#81 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#96 edit
Cette révision appartient à :
foreman a révisé 2016-02-23 07:57:16 -05:00
1 Parent 131b479d5a
révision 1cb5415538
6 fichiers modifiés
+33 -25

Aucun fichier ne correspond à votre recherche

+14 -10
Voir le fichier
@@ -3515,32 +3515,36 @@ VirtualGPU::assignDebugTrapHandler(const DebugToolInfo& dbgSetting,
addVmMemory(trapBufferMem);
addVmMemory(rtTrapHandlerMem);
addVmMemory(rtTrapBufferMem);
}
void
VirtualGPU::submitWriteBufferFromFile(amd::WriteBufferFromFileCommand& cmd)
VirtualGPU::submitTransferBufferFromFile(amd::TransferBufferFileCommand& cmd)
{
size_t copySize = cmd.size()[0];
size_t fileOffset = cmd.fileOffset();
size_t dstOffset = cmd.origin()[0];
size_t srcDstOffset = cmd.origin()[0];
Memory* mem = dev().getGpuMemory(&cmd.memory());
uint idx = 0;
assert((cmd.type() == CL_COMMAND_WRITE_BUFFER_FROM_FILE_AMD) ||
(cmd.type() == CL_COMMAND_READ_BUFFER_FROM_FILE_AMD));
bool writeBuffer(cmd.type() == CL_COMMAND_WRITE_BUFFER_FROM_FILE_AMD);
while (copySize > 0) {
Memory* staging = dev().getGpuMemory(&cmd.staging(idx));
size_t dstSize = amd::WriteBufferFromFileCommand::StagingBufferSize;
dstSize = std::min(dstSize, copySize);
void* dstBuffer = staging->cpuMap(*this);
if (!cmd.file()->readBlock(dstBuffer, fileOffset, 0, dstSize)) {
size_t srcDstSize = amd::TransferBufferFileCommand::StagingBufferSize;
srcDstSize = std::min(srcDstSize, copySize);
void* srcDstBuffer = staging->cpuMap(*this);
if (!cmd.file()->transferBlock(writeBuffer, srcDstBuffer, fileOffset, 0, srcDstSize)) {
return;
}
staging->cpuUnmap(*this);
bool result = blitMgr().copyBuffer(*staging, *mem,
fileOffset, dstOffset, dstSize, false);
fileOffset, srcDstOffset, srcDstSize, false);
flushDMA(getGpuEvent(staging->gslResource())->engineId_);
dstOffset += dstSize;
copySize -= dstSize;
srcDstOffset += srcDstSize;
copySize -= srcDstSize;
}
}