FPGA Resource Manager C++ API  1.8
inaccel::request Class Reference

A high-level class to represent accelerated functions. More...

Public Member Functions

 request ()
 Constructs a request for the Coral FPGA resource manager. More...
 
 request (const request &req)
 Constructs a request for the Coral FPGA resource manager. More...
 
 request (const std::string type)
 Constructs a request for the Coral FPGA resource manager. More...
 
 ~request ()
 
template<typename T >
requestarg (const T &value, flag flags=NONE)
 Adds a(n) (non vector) argument to the request. More...
 
template<typename T >
requestarg (unsigned index, const T &value, flag flags=NONE)
 Adds a(n) (non vector) argument the request at the specified index. More...
 
std::string string_view () const
 Provides a string representation of the request. More...
 
void type (std::string new_type)
 Modifies the request type. More...
 
std::string packet_view () const
 Provides a string representation of the request to be submitted. More...
 
void cleanup () const
 For all arguments that are inaccel vectors, unsets the dirty bit. More...
 

Friends

wire * submit (request &req)
 Submit a request to the FPGA resource manager. More...
 
void wait (wire *session)
 

Detailed Description

A high-level class to represent accelerated functions.

This class provides an intermediate representation of an accelerated function advertised to the Coral FPGA resource manager. You should use this class to form an acceleration request which you will later submit to Coral FPGA resource manager. Your interaction with this class should ideally be limited to declaring the function you wish to execute and populating this function with arguments.

Constructor & Destructor Documentation

inaccel::request::request ( )

Constructs a request for the Coral FPGA resource manager.

Basically the available request types comprise all the accelerated functions advertised to Coral FPGA resource manager (Check out here how to advertise your functions to Coral). The request is tightly coupled with the accelerated function it will serve, and you should ensure that you provide a valid name. Be aware that no validation is check is performed on whether a valid function name is supplied. Therefore, check out examples for proper usage.

inaccel::request::request ( const request req)

Constructs a request for the Coral FPGA resource manager.

Basically the available request types comprise all the accelerated functions advertised to Coral FPGA resource manager (Check out here how to advertise your functions to Coral). The request is tightly coupled with the accelerated function it will serve, and you should ensure that you provide a valid name. Be aware that no validation is check is performed on whether a valid function name is supplied. Therefore, check out examples for proper usage.

inaccel::request::request ( const std::string  type)

Constructs a request for the Coral FPGA resource manager.

Basically the available request types comprise all the accelerated functions advertised to Coral FPGA resource manager (Check out here how to advertise your functions to Coral). The request is tightly coupled with the accelerated function it will serve, and you should ensure that you provide a valid name. Be aware that no validation is check is performed on whether a valid function name is supplied. Therefore, check out examples for proper usage.

Parameters
typeThe alias name of the accelerated function.
inaccel::request::~request ( )

Member Function Documentation

template<class T >
request & inaccel::request::arg ( const T &  value,
flag  flags = NONE 
)

Adds a(n) (non vector) argument to the request.

You should use this method to provide scalars or structs as arguments.

Parameters
valueThe argument value to be added to the request
Returns
The current request object
template<class T >
request & inaccel::request::arg ( unsigned  index,
const T &  value,
flag  flags = NONE 
)

Adds a(n) (non vector) argument the request at the specified index.

You should use this method to provide scalars or structs as arguments.

Parameters
indexThe index of the argument to be added
valueThe argument value to be added to the request
Returns
The current request object
void inaccel::request::cleanup ( ) const

For all arguments that are inaccel vectors, unsets the dirty bit.

This method is automatically called by wire::finalize()

std::string inaccel::request::packet_view ( ) const

Provides a string representation of the request to be submitted.

This method is intended only for debug purposes

Returns
A string representation of the request to be submitted
std::string inaccel::request::string_view ( ) const

Provides a string representation of the request.

You should not directly invoke this method since Coral will automatically invoke it in case of a request submission. It should be used only for debug purposes.

Returns
A string representation of the request intended for the FPGA resource manager
void inaccel::request::type ( std::string  new_type)
inline

Modifies the request type.

You should use this method to choose one from the available accelerated functions advertised to coral. This method can also be used to modify the type of a request in case you want to invoke another accelerator with the same input arguments

Parameters
new_typeThe new alias name of the accelerated function

Friends And Related Function Documentation

wire* submit ( request req)
friend

Submit a request to the FPGA resource manager.

The request argument should be in a format compliant with the specifications demonstated in request docs. This method exits as soon as the request is transmitted to the resource manager and wait() should be later called to wait for its completion.

Parameters
reqThe request to be submitted to the FPGA resource manager
Returns
The session id to later wait the request.
void wait ( wire *  session)
friend