compile_options: Define a list of user-defined options used for compilation in...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/default_options.R

Description

To compile new user-defined operators, rkeops requires compilation options that control the compilation process and the way user-defined operators behave (precision, verbosity, use of GPU, storage order, debug flag, and path to different required files).

The function default_compile_options returns a list of class rkeops_compile_options with default values for the corresponding options (see Details).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
compile_options(
  precision = "float",
  verbosity = FALSE,
  use_cuda_if_possible = TRUE,
  col_major = TRUE,
  debug = FALSE,
  rkeops_dir = NULL,
  build_dir = NULL,
  src_dir = NULL
)

Arguments

precision

string, precision for floating point computations (float or double). Default value is float.

verbosity

boolean indicator regarding verbosity level. Default value is FALSE.

use_cuda_if_possible

boolean indicator regarding compilation of the user-defined operators to be GPU-compatible (if possible on the system, i.e. if CUDA is available). Default value is TRUE. If set to TRUE and CUDA is not available, user-defined operators are compiled for CPU computations.

col_major

boolean indicator regarding storage order (default is TRUE).

debug

boolean indicator regarding debuging flag for compilation. Default value is FALSE.

rkeops_dir

string, path to rkeops install directory on the system. If NULL, default path described in Details section is used. Default value is NULL.

build_dir

string, path to the directory where new custom user-defined operators will be compiled. If NULL, default path described in Details section is used. Default value is NULL.

src_dir

string, path to keops (C++) source files required for compilation of user-defined operators. If NULL, default path described in Details section is used. Default value is NULL.

Details

The aforementioned compile options are the following:

Note on storage order: Column-major storage means that elements of each column of a matrix are contiguous in memory (called Fortran-style). Row-major storage means that each row of a matrix are contiguous in memory (called C-style). In R, matrices are stored with column-major order in R, so we recommend to use column-major order in for KeOps compilation (to avoid useless matrix conversion).

Note: Default options are set up when loading rkeops. To reset rkeops options to default, you should use the function set_rkeops_options(). To set up a particular option, you should use the function set_rkeops_option().

Some wrappers are available to enable some compilation options, see compile4float32(), compile4float64(), compile4cpu(), compile4gpu().

Value

a list (of class rkeops_compile_options) with the following elements:

rkeops_dir

string, path to rkeops install directory on the system.

build_dir

string, path to the directory where new custom user-defined operators will be compiled.

src_dir

string, path to keops (C++) source files required for compilation of user-defined operators.

precision

string, precision for floating point computations (float or double).

verbosity

integer, 0-1 indicator (boolean) for verbosity.

use_cuda_if_possible

integer, 0-1 indicator (boolean) regarding use of GPU in computations (if possible).

col_major

integer, 0-1 indicator (boolean) for storage order.

debug

integer, 0-1 indicator (boolean) for debugging flag.

Author(s)

Ghislain Durif

See Also

default_compile_options(), set_rkeops_options(), set_rkeops_option(), compile4float32(), compile4float64(), compile4cpu(), compile4gpu()

Examples

1
2
3
4
5
6
compile_options(
    precision = 'float', verbosity = FALSE, 
    use_cuda_if_possible = TRUE, 
    col_major = TRUE, debug = FALSE, 
    rkeops_dir = NULL, build_dir = NULL, 
    src_dir = NULL)

rkeops documentation built on Feb. 17, 2021, 5:08 p.m.