R/zzz.R

Defines functions .onLoad .onAttach .onUnload

#' @importFrom utils strOptions packageVersion tail

.onLoad <- function(libname, pkgname) {
    options(gpuR.print.warning=TRUE)
    options(gpuR.default.type = "float")
    # options(gpuR.default.device.type = "gpu")
}

.onAttach <- function(libname, pkgname) {
    # Initialize all possible contexts
    if (!identical(Sys.getenv("APPVEYOR"), "True")) {
        # initialize contexts
        # default_device <- initContexts()
        initContexts()
        # print("context initialization successful")
        # packageStartupMessage(paste0("gpuR ", packageVersion('gpuR'), "\nDefault device: ", default_device))
        packageStartupMessage(paste0("gpuR ", packageVersion('gpuR')))
        # print("startup message not problem")
    }
}

.onUnload <- function(libpath) {
    options(gpuR.print.warning=NULL)
    options(gpuR.default.type = NULL)
    # options(gpuR.default.device.type = NULL)
}

Try the gpuR package in your browser

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

gpuR documentation built on May 30, 2019, 1:02 a.m.