XRTDataMover class Provides the API to interact with the data buffers responsible for memory operations making use of the Xilinx Runtime (XRT).
More...
#include <datamover.hpp>
|
| XRTDataMover (const uint64_t addr, std::shared_ptr< HardwareParameters > hwparams) |
| Construct a new XRTDataMover object. More...
|
|
| XRTDataMover ()=delete |
| Default constructor. More...
|
|
virtual | ~XRTDataMover () |
| ~XRTDataMover destructor method Destroy the XRTDataMover object.
|
|
std::shared_ptr< IMemory > | GetBuffer (const size_t size, const int memory_bank=0, const MemoryType type=MemoryType::Dual) override |
| GetBuffer method This method allocates a memory buffer. Depending on the MemoryType, it allocates memory in a contiguous or memory region (non-pageable) or non contiguous memory region depending on the Memory. The memory can be mirrored with pageable memory for its use in the host (or CPU). More...
|
|
Status | Upload (const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) override |
| Upload method. More...
|
|
Status | Download (const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) override |
| Download method. More...
|
|
Status | Sync (const SyncType type) override |
| Sync method. More...
|
|
DeviceStatus | GetStatus () override |
| GetStatus method Returns the status of the data mover in terms of transactions. More...
|
|
virtual | ~IDataMover ()=default |
| ~IDataMover destructor method Destroy the IDataMover object.
|
|
virtual Status | Upload (std::shared_ptr< IExecutionGraph > graph, const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) |
| Upload method (asynchronous) Please, refer to IDataMover::Upload for reference. This overload performs an asynchronous execution of the function based on a graph of operations. It returns as soon as the operation is scheduled. More...
|
|
virtual Status | Download (std::shared_ptr< IExecutionGraph > graph, const std::shared_ptr< IMemory > mem, const size_t size, const size_t offset, const ExecutionType exetype) |
| Download method (asynchronous) Please, refer to IDataMover::Download for reference. This overload performs an asynchronous execution of the function based on a graph of operations. It returns as soon as the operation is scheduled. More...
|
|
virtual Status | Sync (std::shared_ptr< IExecutionGraph > graph, const SyncType type) |
| Sync method (asynchronous) Please, refer to IDataMover::Sync for reference. This overload performs an asynchronous execution of the function based on a graph of operations. It returns as soon as the operation is scheduled. More...
|
|
XRTDataMover class Provides the API to interact with the data buffers responsible for memory operations making use of the Xilinx Runtime (XRT).
◆ XRTDataMover() [1/2]
cynq::XRTDataMover::XRTDataMover |
( |
const uint64_t |
addr, |
|
|
std::shared_ptr< HardwareParameters > |
hwparams |
|
) |
| |
Construct a new XRTDataMover object.
This constructs a data mover that uses XRT to execute the transfers between the host and the device. Moreover, it uses XRT buffer object as memory buffers.
- Parameters
-
addr | XRT address in the physical memory map |
hwparams | Hardware-specific params |
◆ XRTDataMover() [2/2]
cynq::XRTDataMover::XRTDataMover |
( |
| ) |
|
|
delete |
Default constructor.
The default constructor is deleted since the address is mandatory for the XRT transfer.
◆ Download()
Status cynq::XRTDataMover::Download |
( |
const std::shared_ptr< IMemory > |
mem, |
|
|
const size_t |
size, |
|
|
const size_t |
offset, |
|
|
const ExecutionType |
exetype |
|
) |
| |
|
overridevirtual |
Download method.
This method moves the data from the device to the host using a XRT engine. In the case of XRT-based allocators. It invokes the IMemory::Sync if execution type is ExecutionType::Sync
- Parameters
-
mem | IMemory instance to download. |
size | Size in bytes of data being downloaded from the memory device by making use of the buffer. |
offset | Offset in bytes where the device pointer should start |
exetype | The execution type to use for the download, this is either sync (synchronous) or async (asynchronous) execution. |
- Returns
- Status
Implements cynq::IDataMover.
◆ GetBuffer()
std::shared_ptr< IMemory > cynq::XRTDataMover::GetBuffer |
( |
const size_t |
size, |
|
|
const int |
memory_bank = 0 , |
|
|
const MemoryType |
type = MemoryType::Dual |
|
) |
| |
|
overridevirtual |
GetBuffer method This method allocates a memory buffer. Depending on the MemoryType, it allocates memory in a contiguous or memory region (non-pageable) or non contiguous memory region depending on the Memory. The memory can be mirrored with pageable memory for its use in the host (or CPU).
- Parameters
-
size | Size in bytes of the buffer. |
type | One of the values in the MemoryType enum class which can be one of the following: |
- Dual (DIMM memory)
- Cacheable (cache)
- Host (Memory from the host)
- Device (Memory from the device to be mapped)
- Parameters
-
memory_bank | Memory bank corresponding to the memory to be allocated. Use the IAccelerator::GetMemoryBank(pos) to query the corresponding memory bank |
- Returns
- std::shared_ptr<IMemory>
Implements cynq::IDataMover.
◆ GetStatus()
DeviceStatus cynq::XRTDataMover::GetStatus |
( |
| ) |
|
|
overridevirtual |
GetStatus method Returns the status of the data mover in terms of transactions.
- Returns
- DeviceStatus
Implements cynq::IDataMover.
◆ Sync()
Status cynq::XRTDataMover::Sync |
( |
const SyncType |
type | ) |
|
|
overridevirtual |
Sync method.
Synchronizes data movements in case of asynchronous Upload/Download.
- Parameters
-
type | sync type. Depending on the transaction, it will trigger sync |
- Returns
- Status
Implements cynq::IDataMover.
◆ Upload()
Status cynq::XRTDataMover::Upload |
( |
const std::shared_ptr< IMemory > |
mem, |
|
|
const size_t |
size, |
|
|
const size_t |
offset, |
|
|
const ExecutionType |
exetype |
|
) |
| |
|
overridevirtual |
Upload method.
This method moves the data from the host to the device using a XRT engine. In the case of XRT-based allocators. It invokes the IMemory::Sync if execution type is ExecutionType::Sync
- Parameters
-
mem | XRTMemory instance to upload. |
size | Size in bytes of data being uploaded in the memory device by making use of the buffer. |
offset | Offset in bytes where the device pointer should start |
exetype | The execution type to use for the upload, this is either sync (synchronous) or async (asynchronous) execution. |
- Returns
- Status
Implements cynq::IDataMover.
The documentation for this class was generated from the following files:
- /mnt/usbkey/lleon/cynq/include/cynq/xrt/datamover.hpp
- /mnt/usbkey/lleon/cynq/src/cynq/xrt/datamover.cpp