Ships statistical and mathematical routines from R internal
'nmath' ('Mathlib') as 'OpenCL' C sources under directory 'inst/cl/', with R
wrappers that use the GPU when 'OpenCL' is available at compile time and
fall back to 'stats' equivalents otherwise. Aimed at package developers
building custom kernels (for example Bayesian GLMs via suggested package
'glmbayes') using 'opencltools' kernel loaders and related helpers. Contains
translated shims, an illustrative GLM-related kernel subsystem, vignettes,
and optional GPU acceleration. The ported routines are translated from the
'nmath' ('Mathlib') and 'Rmath' sources of R Core Team (2026) "R: A
Language and Environment for Statistical Computing"
<doi:10.32614/R.manuals>. 'OpenCL' GPU execution follows the standard
described in Stone, Gohara, and Shi (2010) <doi:10.1109/MCSE.2010.69>. The
likelihood subgradient simulation methodology implemented by the
illustrative GLM kernel subsystem is described in Nygren and Nygren (2006)
<doi:10.1198/016214506000000357>.
| Version: |
0.8.2 |
| Depends: |
MASS, R (≥ 3.5.0) |
| Imports: |
stats, Rcpp (≥ 1.1.1), RcppParallel, Rdpack (≥ 0.11-0), opencltools (≥ 0.8.1) |
| LinkingTo: |
Rcpp, RcppArmadillo, RcppParallel, opencltools |
| Suggests: |
glmbayes (≥ 0.9.3), knitr, rmarkdown, testthat (≥ 3.0.0), spelling |
| Published: |
2026-06-21 |
| DOI: |
10.32614/CRAN.package.nmathopencl |
| Author: |
Kjell Nygren [aut, cre],
The R Core Team [ctb, cph] (R 'Mathlib' sources and derived/adapted
routines),
The R Foundation [cph] (Portions of R 'Mathlib' and R source code),
Ross Ihaka [ctb, cph] (R 'Mathlib'),
Robert Gentleman [ctb, cph] (Portions of R 'Mathlib'),
Morten Welinder [ctb, cph] (Portions of R 'Mathlib' (pgamma, phyper,
ebd0)),
Martin Maechler [ctb] (Portions of R 'Mathlib'),
Catherine Loader [ctb] (Author of the dbinom/bd0/stirlerr density
routines in R 'Mathlib' ported here),
Claus Ekstrøm [ctb] (Author of the noncentral t density (dnt) in R
'Mathlib' ported here),
Peter Ruckdeschel [ctb] (Author of the noncentral F density (dnf) in R
'Mathlib' ported here),
Alfred H. Morris, Jr. [ctb] (ACM TOMS 708 incomplete beta code
(toms708) ported here),
Armido R. Didonato [ctb] (ACM TOMS 708 incomplete beta code (toms708)
ported here),
The Khronos Group Inc [cph] ('OpenCL' API headers in inst/include/CL
(Apache License 2.0)) |
| Maintainer: |
Kjell Nygren <kjell.a.nygren at gmail.com> |
| BugReports: |
https://github.com/knygren/nmathopencl/issues |
| License: |
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Copyright: |
see file COPYRIGHTS |
| URL: |
https://github.com/knygren/nmathopencl,
https://knygren.r-universe.dev/nmathopencl |
| NeedsCompilation: |
yes |
| SystemRequirements: |
Optional 'OpenCL' support. If available, GPU
acceleration will be used; otherwise, computation runs on CPU. |
| Language: |
en-US |
| Citation: |
nmathopencl citation info |
| Materials: |
README, NEWS |
| CRAN checks: |
nmathopencl results |