Skip to content

C++

This API mainly works as a wrapper to the Java one and supports all the functionality for allocating buffers to the FPGA resources as well as handling acceleration requests.

To install the API simply run the following

wget -q --show-progress http://jfrog.inaccel.com/artifactory/generic-local/packages/coral.deb -O /path/to/coral.deb

apt install /path/to/coral.deb

InAccel Coral C++ API requires Java 8 installed and set

You can find the complete API documentation here

Upon installing you can very easily write your own accelerated applications. Just include the desired header and create an FPGA request. Below you can find the complete headers list.

Header List-

Headers for Memory Operations

Class Header
SharedByteVector coral/shm/SharedByteVector.h
SharedDoubleVector coral/shm/SharedDoubleVector.h
SharedFloatVector coral/shm/SharedFloatVector.h
SharedIntVector coral/shm/SharedIntVector.h
SharedLongVector coral/shm/SharedLongVector.h
SharedShortVector coral/shm/SharedShortVector.h
SharedByteMatrix coral/shm/SharedByteMatrix.h
SharedDoubleMatrix coral/shm/SharedDoubleMatrix.h
SharedFloatMatrix coral/shm/SharedFloatMatrix.h
SharedIntMatrix coral/shm/SharedIntMatrix.h
SharedLongMatrix coral/shm/SharedLongMatrix.h
SharedShortMatrix coral/shm/SharedShortMatrix.h

Header for Request Operations

Class Header
InAccel coral/InAccel

To-do

Add link to API complete documentation.


Compilation-

To compile your applications you have to add Java include dirs to the g++ command. Also to create the executable for your application you now have to link against Coral library and Java VM.

Below you can see an example of compiling the above VaddExample.cpp application:

$ g++ -std=c++17 -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -c VaddExample.cpp -o VaddExample.o

$ g++ VaddExample.o -lCoral -L${JAVA_HOME}/jre/lib/amd64/server -ljvm -o VaddExample

Note that you have to compile any source file with -std=c++17 flag otherwise you will get compilation errors.

To run an application using manager's C++ API make sure you have first pulled and started InAccel Coral docker.