Bandicoot is a C++ header-only GPU accelerated linear algebra library written by developers behind Armadillo that provides high-level syntax for performing computations on graphics processing units.
The RcppBandicoot package includes the header files from the Bandicoot library and integrates a seamless experience with R by using the Rcpp package. Therefore, users do not need to install Bandicoot to use RcppBandicoot.
You can install RcppBandicoot from GitHub:
# install.packages("remotes")
remotes::install_github("coatless/rcppbandicoot")To use RcppBandicoot in your package, add the following to your DESCRIPTION file:
LinkingTo: Rcpp, RcppBandicoot
Imports: Rcpp
Then in your C++ code, include the main header:
#include <RcppBandicoot.h>
// [[Rcpp::depends(RcppBandicoot)]]
// [[Rcpp::export]]
coot::mat gpu_multiply(const coot::mat& A, const coot::mat& B) {
return A * B; // Computed on GPU
}The RcppBandicoot integration provides automatic conversion between:
- R matrices ↔
coot::Mat<T> - R vectors ↔
coot::Col<T>andcoot::Row<T> - R 3D arrays ↔
coot::Cube<T>
All computations are performed on the GPU for maximum performance.
The package is under active development with releases to CRAN about once a month.
- C++14 compatible compiler (required by Bandicoot library)
- OpenCL 1.2+ or CUDA 9.8+ for GPU support
- GPU device with appropriate drivers
- CLBlast (recommended) or clBLAS for OpenCL BLAS operations
James Joseph Balamuta
GPL (>= 2)