FPGA Resource Manager C++ API  1.5
inaccel::Request Class Reference

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

Public Member Functions

 Request (const std::string &req_type)
 Constructs a request for the Coral FPGA resource manager. More...
 
 Request (const Request &req)
 Copy constructor for a Request object. More...
 
 ~Request ()
 
RequestArg (char value)
 Adds an argument of primitive type char to the request. More...
 
RequestArg (int value)
 Adds an argument of primitive type int to the request. More...
 
RequestArg (long value)
 Adds an argument of primitive type long to the request. More...
 
RequestArg (short value)
 Adds an argument of primitive type short to the request. More...
 
RequestArg (float value)
 Adds an argument of primitive type float to the request. More...
 
RequestArg (double value)
 Adds an argument of primitive type double to the request. More...
 
template<typename T >
RequestArg (const vector< T > &vin)
 Adds an inaccel::vector as argument to the request. More...
 
std::string Wrap ()
 Wraps the request for submission. More...
 
void Seed (std::string value)
 
std::string StringView () const
 Provides a string representation of the request. More...
 

Data Fields

int id
 A uniquely identifying ID corresponding to this Request object. More...
 

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 ( const std::string &  req_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
req_typeThe alias name of the accelerated function.
inaccel::Request::Request ( const Request req)
inline

Copy constructor for a Request object.

inaccel::Request::~Request ( )
inline

Member Function Documentation

Request & inaccel::Request::Arg ( char  value)

Adds an argument of primitive type char to the request.

You should use this method to populate the Request with argument of char type. This method returns current Request object to enable arguments to be populated in a single line.

Parameters
valueThe argument to be added to the request
Returns
The current Request object
Request & inaccel::Request::Arg ( int  value)

Adds an argument of primitive type int to the request.

You should use this method to populate the Request with argument of int type. This method returns current Request object to enable arguments to be populated in a single line.

Parameters
valueThe argument to be added to the request
Returns
The current Request object
Request & inaccel::Request::Arg ( long  value)

Adds an argument of primitive type long to the request.

You should use this method to populate the Request with argument of long type. This method returns current Request object to enable arguments to be populated in a single line.

Parameters
valueThe argument to be added to the request
Returns
The current Request object
Request & inaccel::Request::Arg ( short  value)

Adds an argument of primitive type short to the request.

You should use this method to populate the Request with argument of short type. This method returns current Request object to enable arguments to be populated in a single line.

Parameters
valueThe argument to be added to the request
Returns
The current Request object
Request & inaccel::Request::Arg ( float  value)

Adds an argument of primitive type float to the request.

You should use this method to populate the Request with argument of float type. This method returns current Request object to enable arguments to be populated in a single line.

Parameters
valueThe argument to be added to the request
Returns
The current Request object
Request & inaccel::Request::Arg ( double  value)

Adds an argument of primitive type double to the request.

You should use this method to populate the Request with argument of double type. This method returns current Request object to enable arguments to be populated in a single line.

Parameters
valueThe argument to be added to the request
Returns
The current Request object
template<class T >
Request & inaccel::Request::Arg ( const vector< T > &  vin)

Adds an inaccel::vector as argument to the request.

You should use this method to provide vectors as argument. The inaccel::vector is an alias of an std::vector with a different allocation schema.

Parameters
vinThe inaccel::vector to be added as request argument
Returns
The current Request object
void inaccel::Request::Seed ( std::string  value)
inline
std::string inaccel::Request::StringView ( ) const
inline

Provides a string representation of the request.

Returns
The Request object as a string
std::string inaccel::Request::Wrap ( )

Wraps the request for submission.

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 complete request intended for the FPGA resource manager

Field Documentation

int inaccel::Request::id

A uniquely identifying ID corresponding to this Request object.