Skip to content

Latest commit

 

History

History
213 lines (123 loc) · 5.56 KB

acap.rst

File metadata and controls

213 lines (123 loc) · 5.56 KB

ACAP++ environment

Some ACAP++ examples are found in tests/acap, tests/acap-buffer, tests/acap-lock, tests/acap-mem, tests/air.

The Doxygen-ized version of the API documentation can be found in the precompiled https://pages.gitenterprise.xilinx.com/rkeryell/acappp/Doxygen/acappp/html/group__acap.html but you can also compile the latest version yourself as explained in doc/architecture.rst

Installation

Since it is based on modern C++, the best way to have everything installed is to run Linux with the latest distribution, such as Debian/unstable or Ubuntu 21.10, but it might work on older system too.

Such machines do exist at Xilinx, such as xsjsycl40.xilinx.com or xsjsycl41.xilinx.com we use to develop ACAP++ and you can ssh -X into it to give a (graphical) try and skip directly to the next section.

Some generic information about setting up such a machine or environment can be found in https://gitenterprise.xilinx.com/rkeryell/survival_kit

For example to install the latest Clang/LLVM, look at http://apt.llvm.org

The most recent C++ compilers, the Boost library, GTKmm graphics C++ library are used.

To install them on latest Linux Debian/unstable (this should work on latest Ubuntu too, just adapt the compiler versions):

sudo apt-get install git make cmake clang-14 libomp-14-dev \
  llvm-14-dev g++-11 libboost-all-dev libgtkmm-3.0-dev libpocl-dev

Runtime environment

Get ACAP++ itself with:

git clone https://gitenterprise.xilinx.com/rkeryell/acappp.git

Some examples of ACAP++ uses a lot of stack storage and often the default environment limits the amount to a small value such as 8 MiB, which causes the program just to crash boldly when using more stack allocation with a blunt message like:

acap/wave_propagation
Segmentation fault (core dumped)

To avoid this, increase the allowed stack size for example on a bash-flavored shell:

ulimit -s unlimited

or with a csh-flavored shell:

limit stacksize unlimited

There is also a bug in the graphics library preventing the graphics environment to shutdown cleanly when closing the graphics window. When it happens, just quit the main program, such as with ^C.

Compiling with Make

To compile a given test program, go into the tests directory and execute:

make acap/hello_world_uniform_lambda

and run the program with:

acap/hello_world_uniform_lambda

Compiling with CMake

Create a build directory somewhere and jump into it. From there, run:

CXX=clang++-14 cmake /where-the-acap++top-directory-is/ -DCMAKE_EXPORT_COMPILE_COMMANDS=1

Compile everything with:

cmake --build tests/acap --parallel `nproc`

or just the ACAP main examples with:

cmake --build tests/acap --parallel `nproc`

Then all you can run for example:

tests/acap/acap_mandelbrot

Note that all executables have the test directory itself like acap_ prepended to the name to avoid target name conflicts across the directories for now.