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
  )
}
mlverse/cuda.ml documentation built on Jan. 14, 2022, 11:14 a.m.