Learn R Programming

HiPLARM (version 0.1)

setGPU: ~~ Methods for Function setGPU in Package HiPLARM ~~

Description

~~ Methods for function setGPU in package HiPLARM ~~

Usage

setGPU(proc, interface)

Arguments

proc
A numeric or logical value that enables or disable the argument passed to interface, i.e the CPU or GPU interface or if no argument is passed to interface then the MAGMA library is enabled or disabled.
interface
A character string of either "CPU" or "GPU" determining which interface to use. If no argument is given the MAGMA library is disabled.

Methods

signature(proc = "logical", interface = "character")
This allows the user to choose the CPU or GPU interface. Should the user wish to enable a certain interface the string "CPU" or "GPU" are passed as the interface argument and the proc argument is set to TRUE or FALSE.
signature(proc = "logical", interface = "missing")
This allows the user to enable or disable the GPU if no argument is passed to interface. Setting proc to TRUE or FALSE enables or disables the GPU.
signature(proc = "numeric", interface = "character")
This allows the user to choose the CPU or GPU interface. Should the user wish to enable a certain interface the string "CPU" or "GPU" are passed as the interface argument and the proc argument is set to 1 or 0.
signature(proc = "numeric", interface = "missing")
This allows the user to enable or disable the GPU if no argument is passed to interface. Setting proc to 1 or 0 enables or disables the GPU.

Details

The MAGMA library provides two different interfaces to the GPU. The "CPU" interface automatically transfers the data to and from the GPU as well as choosing the multi-gpu option automatically should the user have multiple GPUs. This is the most flexible or options and should it be available is used by default. However, some MAGMA functions are only implemented for the "GPU" interface. In this case the data transfers and other options must be given explicitly for the function call. If this is the case, this is the default option, however, at an R level the user will see no difference. We also provide the option of disabling the GPU and using the regular LAPACK call should the user wish to test results.

Examples

Run this code
setGPU(TRUE,"CPU") # enables CPU interface where available
setGPU(TRUE,"GPU") # enables GPU interface only
setGPU(FALSE) #disables MAGMA library

Run the code above in your browser using DataLab