The Kernel class is used to manage the computational kernel of the accelerator.
More...
#include <kernel.h>
|
| Kernel (std::shared_ptr< Context > context) |
| Construct a new kernel that can operate within a specific context.
|
|
bool | ImplementsSchemaSet (const std::vector< std::shared_ptr< arrow::Schema > > &schema_set) |
| Returns true if the kernel implements an operation over a set of arrow::Schemas. Not implemented.
|
|
Status | Reset () |
| Reset the Kernel.
|
|
Status | SetRange (size_t recordbatch_index, int32_t first, int32_t last) |
| Set the first (inclusive) and last (exclusive) row to process of some RecordBatch.
|
|
Status | SetArguments (const std::vector< uint32_t > &arguments) |
| Set custom arguments to the kernel. Writes consecutive MMIO registers starting from custom register offset.
|
|
Status | Start () |
| Start the kernel.
|
|
Status | GetStatus (uint32_t *status_out) |
| Read the status register of the Kernel.
|
|
Status | GetReturn (uint32_t *ret0, uint32_t *ret1=nullptr) |
| Read the return registers of the Kernel. If ret1 is nullptr, REG_RETURN1 is ignored.
|
|
Status | PollUntilDoneInterval (unsigned int poll_interval_usec) |
| Poll (blocking) the done flag of the status register for assertion with an interval.
|
|
Status | PollUntilDone () |
| Poll the done flag of the status register for assertion (blocking). Polls at maximum speed.
|
|
std::shared_ptr< Context > | context () |
| Return the context of this Kernel.
|
|
Status | WriteMetaData () |
| Write RecordBatch metadata from the Context to the Kernel MMIO registers.
|
|
|
uint32_t | ctrl_start = 1ul << FLETCHER_REG_CONTROL_START |
| Control register start command value.
|
|
uint32_t | ctrl_reset = 1ul << FLETCHER_REG_CONTROL_RESET |
| Control register reset command value.
|
|
uint32_t | done_status = 1ul << FLETCHER_REG_STATUS_DONE |
| Status register done value.
|
|
uint32_t | done_status_mask = 1ul << FLETCHER_REG_STATUS_DONE |
| Status register done mask bits.
|
|
|
bool | metadata_written = false |
| Whether RecordBatch metadata was written.
|
|
std::shared_ptr< Context > | context_ |
| The context that this kernel should operate on.
|
|
The Kernel class is used to manage the computational kernel of the accelerator.
Definition at line 29 of file kernel.h.
◆ Kernel()
fletcher::Kernel::Kernel |
( |
std::shared_ptr< Context > |
context | ) |
|
|
explicit |
Construct a new kernel that can operate within a specific context.
- Parameters
-
[in] | context | The context to operate in. |
◆ context()
std::shared_ptr< Context > fletcher::Kernel::context |
( |
| ) |
|
Return the context of this Kernel.
◆ GetReturn()
Status fletcher::Kernel::GetReturn |
( |
uint32_t * |
ret0, |
|
|
uint32_t * |
ret1 = nullptr |
|
) |
| |
Read the return registers of the Kernel. If ret1 is nullptr, REG_RETURN1 is ignored.
- Parameters
-
[out] | ret0 | A pointer to a value to store return value 0. |
[out] | ret1 | A pointer to a value to store return value 1. |
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ GetStatus()
Status fletcher::Kernel::GetStatus |
( |
uint32_t * |
status_out | ) |
|
Read the status register of the Kernel.
- Parameters
-
[out] | status_out | A pointer to a value to store the status. |
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ ImplementsSchemaSet()
bool fletcher::Kernel::ImplementsSchemaSet |
( |
const std::vector< std::shared_ptr< arrow::Schema > > & |
schema_set | ) |
|
Returns true if the kernel implements an operation over a set of arrow::Schemas. Not implemented.
- Parameters
-
[in] | schema_set | A vector of shared pointers to arrow::Schemas to check. |
- Returns
- Returns true if the kernel implements an operation over a set of arrow::Schemas.
◆ PollUntilDone()
Status fletcher::Kernel::PollUntilDone |
( |
| ) |
|
Poll the done flag of the status register for assertion (blocking). Polls at maximum speed.
- Returns
- Status::OK() when the kernel is finished, otherwise a descriptive error status.
Polling at maximum speed can cause a significant amount of traffic on the accelerator interface; use with care.
◆ PollUntilDoneInterval()
Status fletcher::Kernel::PollUntilDoneInterval |
( |
unsigned int |
poll_interval_usec | ) |
|
Poll (blocking) the done flag of the status register for assertion with an interval.
- Parameters
-
[in] | poll_interval_usec | The interval at which to poll the Kernel. |
- Returns
- Status::OK() when the kernel is finished, otherwise a descriptive error status.
◆ Reset()
Status fletcher::Kernel::Reset |
( |
| ) |
|
Reset the Kernel.
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ SetArguments()
Status fletcher::Kernel::SetArguments |
( |
const std::vector< uint32_t > & |
arguments | ) |
|
Set custom arguments to the kernel. Writes consecutive MMIO registers starting from custom register offset.
- Parameters
-
[in] | arguments | A vector of arguments to write. |
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ SetRange()
Status fletcher::Kernel::SetRange |
( |
size_t |
recordbatch_index, |
|
|
int32_t |
first, |
|
|
int32_t |
last |
|
) |
| |
Set the first (inclusive) and last (exclusive) row to process of some RecordBatch.
- Parameters
-
[in] | recordbatch_index | The index of the RecordBatch to set the range for. |
[in] | first | The first index of the range (inclusive). |
[in] | last | The last index of the range (exclusive). |
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ Start()
Status fletcher::Kernel::Start |
( |
| ) |
|
Start the kernel.
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ WriteMetaData()
Status fletcher::Kernel::WriteMetaData |
( |
| ) |
|
Write RecordBatch metadata from the Context to the Kernel MMIO registers.
- Returns
- Status::OK() if successful, otherwise a descriptive error status.
◆ context_
std::shared_ptr<Context> fletcher::Kernel::context_ |
|
protected |
The context that this kernel should operate on.
Definition at line 125 of file kernel.h.
◆ ctrl_reset
uint32_t fletcher::Kernel::ctrl_reset = 1ul << FLETCHER_REG_CONTROL_RESET |
Control register reset command value.
Definition at line 115 of file kernel.h.
◆ ctrl_start
uint32_t fletcher::Kernel::ctrl_start = 1ul << FLETCHER_REG_CONTROL_START |
Control register start command value.
Definition at line 113 of file kernel.h.
◆ done_status
uint32_t fletcher::Kernel::done_status = 1ul << FLETCHER_REG_STATUS_DONE |
◆ done_status_mask
uint32_t fletcher::Kernel::done_status_mask = 1ul << FLETCHER_REG_STATUS_DONE |
◆ metadata_written
bool fletcher::Kernel::metadata_written = false |
|
protected |
Whether RecordBatch metadata was written.
Definition at line 123 of file kernel.h.
The documentation for this class was generated from the following file: