P4 to Git Change 1205056 by gandryey@gera-w8 on 2015/10/28 17:13:54
SWDEV-78467 - OpenCL LiquidFlash feature - Add WriteBufferFromFile command Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#8 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#21 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#189 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#259 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#333 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#72 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#79 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#93 edit ... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#35 edit
Этот коммит содержится в:
@@ -217,10 +217,6 @@ Command::Command(
|
||||
std::mem_fun(&Command::retain));
|
||||
}
|
||||
|
||||
Command::~Command()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Command::releaseResources()
|
||||
{
|
||||
@@ -577,4 +573,35 @@ ThreadTraceMemObjectsCommand::validateMemory()
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
WriteBufferFromFileCommand::submit(device::VirtualDevice& device)
|
||||
{
|
||||
device::Memory* mem = memory_->getDeviceMemory(queue()->device());
|
||||
void* dstBuffer = mem->cpuMap(device);
|
||||
// Make HD transfer to the host accessible memory
|
||||
if (!file()->readBlock(dstBuffer, fileOffset(), origin()[0], size()[0])) {
|
||||
return;
|
||||
}
|
||||
mem->cpuUnmap(device);
|
||||
}
|
||||
|
||||
bool
|
||||
WriteBufferFromFileCommand::validateMemory()
|
||||
{
|
||||
if (!(memory_->getMemFlags() & (CL_MEM_USE_HOST_PTR |
|
||||
CL_MEM_ALLOC_HOST_PTR | CL_MEM_USE_PERSISTENT_MEM_AMD))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (queue()->device().info().type_ & CL_DEVICE_TYPE_GPU) {
|
||||
device::Memory* mem = memory_->getDeviceMemory(queue()->device());
|
||||
if (NULL == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!",
|
||||
memory_->getSize());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace amd
|
||||
|
||||
Ссылка в новой задаче
Block a user