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
This commit is contained in:
foreman
2015-10-28 17:25:52 -04:00
parent 99906c0e05
commit 715cbfd662
5 changed files with 120 additions and 14 deletions
+50 -3
View File
@@ -223,9 +223,6 @@ protected:
exception_(0), data_(NULL), eventWaitList_(nullWaitList)
{ }
//! Destroy the command object.
virtual ~Command();
bool terminate() {
if (Agent::shouldPostEventEvents() && type() != 0) {
Agent::postEventFree(as_cl(static_cast<Event*>(this)));
@@ -1472,6 +1469,56 @@ public:
Memory* getSvmMem() const {return svmMem_;}
};
/*! \brief A generic write memory from file command.
*
* \details Currently supports buffers only. Buffers
* are treated as 1D structures so origin_[0] and size_[0]
* are equivalent to offset_ and count_ respectively.
*/
class WriteBufferFromFileCommand : public OneMemoryArgCommand
{
private:
const Coord3D origin_; //!< Origin of the region to write to
const Coord3D size_; //!< Size of the region to write to
LiquidFlashFile* file_; //!< The file object for data read
size_t fileOffset_; //!< Offset in the file for data read
public:
WriteBufferFromFileCommand(
HostQueue& queue,
const EventWaitList& eventWaitList,
Memory& memory, const Coord3D& origin,
const Coord3D& size, LiquidFlashFile* file, size_t fileOffset)
: OneMemoryArgCommand(queue, CL_COMMAND_WRITE_BUFFER_FROM_FILE_AMD,
eventWaitList, memory)
, origin_(origin)
, size_(size)
, file_(file)
, fileOffset_(fileOffset)
{
// Sanity checks
assert(size.c[0] > 0 && "invalid");
}
virtual void submit(device::VirtualDevice& device);
//! Return the memory object to write to
Memory& memory() const { return *memory_; }
//! Return the host memory to read from
LiquidFlashFile* file() const { return file_; }
//! Returns file offset
size_t fileOffset() const { return fileOffset_; }
//! Return the region origin
const Coord3D& origin() const { return origin_; }
//! Return the region size
const Coord3D& size() const { return size_; }
bool validateMemory();
};
/*! @}
* @}
*/