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
This commit is contained in:
foreman
2016-02-23 07:57:16 -05:00
parent 131b479d5a
commit 1cb5415538
6 changed files with 33 additions and 25 deletions
+8 -6
View File
@@ -574,7 +574,7 @@ ThreadTraceMemObjectsCommand::validateMemory()
}
void
WriteBufferFromFileCommand::releaseResources()
TransferBufferFileCommand::releaseResources()
{
for (uint i = 0; i < NumStagingBuffers; ++i) {
if (NULL != staging_[i]) {
@@ -587,25 +587,27 @@ WriteBufferFromFileCommand::releaseResources()
}
void
WriteBufferFromFileCommand::submit(device::VirtualDevice& device)
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* dstBuffer = mem->cpuMap(device);
void* srcDstBuffer = mem->cpuMap(device);
// Make HD transfer to the host accessible memory
if (!file()->readBlock(dstBuffer, fileOffset(), origin()[0], size()[0])) {
bool writeBuffer(type() == CL_COMMAND_WRITE_BUFFER_FROM_FILE_AMD);
if (!file()->transferBlock(writeBuffer, srcDstBuffer,
fileOffset(), origin()[0], size()[0])) {
return;
}
mem->cpuUnmap(device);
}
else {
device.submitWriteBufferFromFile(*this);
device.submitTransferBufferFromFile(*this);
}
}
bool
WriteBufferFromFileCommand::validateMemory()
TransferBufferFileCommand::validateMemory()
{
if (queue()->device().info().type_ & CL_DEVICE_TYPE_GPU) {
// Check if the destination buffer has direct host access