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

Interface between application and the FPGA resource manager. More...

Public Member Functions

 Coral ()
 
 ~Coral ()
 

Static Public Member Functions

static int Submit (Request &req)
 Submit a synchronous request to the FPGA resource manager. More...
 
static int SubmitAsync (Request &req)
 Submit an asynchronous request to the FPGA resource manager. More...
 
static int Await (const Request &req)
 Block until the completion of the supplied request. More...
 
static int Await (int request_id)
 Block until the completion of the request corresponding to the supplied request_id. More...
 

Static Public Attributes

static const std::string INACCEL_NAMESPACE
 Namespace for InAccel's shared memory files. More...
 
static const std::string HOSTNAME
 Hostname of the FPGA resource manager. More...
 
static const int PORT
 Listening port of the FPGA resource manager. More...
 

Detailed Description

Interface between application and the FPGA resource manager.

This class provides a simple interface to interact with the FPGA resource manager (InAccel backend engine). This interaction is achieved through requests which are submitted to the manager who is responsible to convey those requests to the FPGAs while utilizing the cluster of FPGAs in an optimal way. The user should create Request objects compliant with the bitstreams supplied to the resource manager (Check out here on how to deploy your own bitstream and advertise it to the resource manager)

Constructor & Destructor Documentation

inaccel::Coral::Coral ( )
inline
inaccel::Coral::~Coral ( )
inline

Member Function Documentation

int inaccel::Coral::Await ( const Request req)
static

Block until the completion of the supplied request.

This method should be invoked after a SubmitAsync() to await for the completion of the request. An invocation of this method without prior request submission will cause the method to block forever.

Parameters
reqThe request on which we should await.
Returns
EXIT_SUCCESS if request completed successfully or EXIT_FAILURE otherwise to indicate program execution status.
int inaccel::Coral::Await ( int  request_id)
static

Block until the completion of the request corresponding to the supplied request_id.

This method should be invoked after a SubmitAsync() to await for the completion of the request. An invocation of this method without prior request submission will cause the method to block forever.

Parameters
request_idThe id corresponding to the request on which we should await.
Returns
EXIT_SUCCESS if request completed successfully or EXIT_FAILURE otherwise to indicate program execution status.
int inaccel::Coral::Submit ( Request req)
static

Submit a synchronous request to the FPGA resource manager.

The Request argument should be in a format compliant with the specifications demonstated in Request docs. This methods blocks until the completion of the submitted request. The exit status is then used to infer the status of the request execution.

Parameters
reqThe request to be submitterd to the FPGA resource manager
Returns
EXIT_SUCCESS if request completed successfully or EXIT_FAILURE otherwise to indicate program execution status.
int inaccel::Coral::SubmitAsync ( Request req)
static

Submit an asynchronous 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 Await() should be later called to wait for its completion.

@param req The request to be submitted to the FPGA resource manager
@returns EXIT_SUCCESS if request completed successfully or EXIT_FAILURE
otherwise to indicate program execution status.

Field Documentation

const std::string inaccel::Coral::HOSTNAME
static
Initial value:
= getenv(HOSTNAME_ENV_VAR) ?
std::string(getenv(HOSTNAME_ENV_VAR)) : DEFAULT_HOSTNAME

Hostname of the FPGA resource manager.

You should not modify directly this value. Instead modify accordingly CORAL_HOSTNAME environment variable in order to override default value (ensure first that resource manager resides in such hostname)

const std::string inaccel::Coral::INACCEL_NAMESPACE
static
Initial value:
= getenv(INACCEL_NAMESPACE_ENV_VAR) ?
std::string(getenv(INACCEL_NAMESPACE_ENV_VAR)) : DEFAULT_INACCEL_NAMESPACE

Namespace for InAccel's shared memory files.

Do not movidefy directly this value. Instead modify accordingly INACCEL_NAMESPACE environment variable in order to override default value

const int inaccel::Coral::PORT
static
Initial value:
= (getenv(PORT_ENV_VAR) && std::atoi(getenv(PORT_ENV_VAR))) ?
std::atoi(getenv(PORT_ENV_VAR)) : DEFAULT_PORT

Listening port of the FPGA resource manager.

Do not modify directly this value. Instead modify accordingly CORAL_PORT environment variable in order to override default value (ensure that resource manager indeed listens on the port you supplied)