Skip to content

Rcpp integration for the Bandicoot templated C++ GPU computational library based on Armadillo

License

Notifications You must be signed in to change notification settings

coatless-rpkg/rcppbandicoot

Repository files navigation

RcppBandicoot

R-CMD-check

Overview

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.

Installation

You can install RcppBandicoot from GitHub:

# install.packages("remotes")
remotes::install_github("coatless/rcppbandicoot")

Usage

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> and coot::Row<T>
  • R 3D arrays ↔ coot::Cube<T>

All computations are performed on the GPU for maximum performance.

Status

The package is under active development with releases to CRAN about once a month.

Requirements

  • 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

Authors

James Joseph Balamuta

License

GPL (>= 2)

About

Rcpp integration for the Bandicoot templated C++ GPU computational library based on Armadillo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published