has_cuda: Check if package was compiled with CUDA support

View source: R/RcppExports.R

has_cudaR Documentation

Check if package was compiled with CUDA support

Description

Queries whether matrixprofiler was compiled with NVIDIA CUDA GPU acceleration (MATRIXPROFILER_ENABLE_CUDA=1).

Usage

has_cuda()

Details

By default, matrixprofiler is compiled without CUDA to maintain portability and compliance with CRAN policies, running all algorithms on multi-threaded CPU engines powered by RcppThread.

If an NVIDIA GPU and the CUDA Toolkit are available on the host system, the package can be recompiled with CUDA acceleration for supported algorithms (such as rfcp and mpx) using the helper script inst/cuda/build_cuda_rcpp.sh or by setting the environment variables:

  • MATRIXPROFILER_ENABLE_CUDA=1

  • MATRIXPROFILER_CUDA_OBJECT pointing to precompiled CUDA object files (.o)

  • MATRIXPROFILER_CUDA_LIBS pointing to the CUDA runtime library (e.g. -lcudart)

When has_cuda() returns FALSE, attempting to execute an algorithm with backend = "cuda" will stop with an informative error instructing how to enable CUDA.

Value

A logical value: TRUE if CUDA support was enabled at compile time, FALSE otherwise.

Examples

has_cuda()

matrixprofiler documentation built on Oct. 14, 2026, 9:07 a.m.