C++ Run-time Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
fletcher::Kernel Class Reference

The Kernel class is used to manage the computational kernel of the accelerator. More...

#include <kernel.h>

Public Member Functions

 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< Contextcontext ()
 Return the context of this Kernel.
 
Status WriteMetaData ()
 Write RecordBatch metadata from the Context to the Kernel MMIO registers.
 

Public Attributes

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.
 

Protected Attributes

bool metadata_written = false
 Whether RecordBatch metadata was written.
 
std::shared_ptr< Contextcontext_
 The context that this kernel should operate on.
 

Detailed Description

The Kernel class is used to manage the computational kernel of the accelerator.

Definition at line 29 of file kernel.h.

Constructor & Destructor Documentation

◆ Kernel()

fletcher::Kernel::Kernel ( std::shared_ptr< Context context)
explicit

Construct a new kernel that can operate within a specific context.

Parameters
[in]contextThe context to operate in.

Member Function Documentation

◆ 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]ret0A pointer to a value to store return value 0.
[out]ret1A 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_outA 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_setA 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_usecThe 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]argumentsA 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_indexThe index of the RecordBatch to set the range for.
[in]firstThe first index of the range (inclusive).
[in]lastThe 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.

Member Data Documentation

◆ 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

Status register done value.

Definition at line 117 of file kernel.h.

◆ done_status_mask

uint32_t fletcher::Kernel::done_status_mask = 1ul << FLETCHER_REG_STATUS_DONE

Status register done mask bits.

Definition at line 119 of file kernel.h.

◆ 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: