andrewssobral / dtt

A C++ header-only for data transfer between linear algebra libraries (Eigen, Armadillo, OpenCV, ArrayFire, LibTorch).
MIT License
79 stars 15 forks source link
armadillo arrayfire cpp eigen libtorch linear-algebra opencv

Data Transfer Tools for C++ Linear Algebra Libraries.

DTT is a header-only library that provides data transfer tools between C++ linear algebra libraries. Currently, it supports data transfer between the following libraries:

Current status:

Last page update: 25/08/2019

From/To Eigen Armadillo OpenCV ArrayFire LibTorch
Eigen - X X X X
Armadillo X - X X X
OpenCV X X - X X
ArrayFire X X X - X
LibTorch X X X X -

Tested on:

Install dependencies:

brew install eigen
brew install armadillo
# download and install ArrayFire: https://arrayfire.com/download/
# download and install LibTorch: https://pytorch.org/get-started/locally/
# download adn install OpenCV: https://opencv.org/releases/

How to compile and run:

git clone https://github.com/andrewssobral/dtt.git
cd dtt && mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=$LIBTORCH_HOME ..
./dtt_test

How to use:

#include <dtt.h>
using namespace dtt;
// that's all!

List of available functions:

See test/dtt_test.h and test/dtt_test.cpp for usage examples.