tools/config/utils/platform.R

#' utility functions that may potentially become platform-specific in future

nproc <- function() {
  # Try to run `nproc` to detect number of cores available
  tryCatch(
    as.integer(system2("nproc", stdout = TRUE, stderr = NULL)),
    error = function(e) 2L
  )
}

Try the cuda.ml package in your browser

Any scripts or data that you put into this service are public.

cuda.ml documentation built on April 29, 2026, 5:10 p.m.