Matrix: Create a matrix

Description Usage Arguments Value Examples

View source: R/pkgFunc.R

Description

The function create a matrix, it is only useful in the openCL functions. it can also be called in R, but its argument may or may not take any effect.

Usage

1
2
3
4
5
6
7
8
Matrix(
  nrow = 1,
  ncol = 1,
  precision = GPUVar$default_float,
  constDef = FALSE,
  shared = FALSE,
  location = "global"
)

Arguments

nrow, ncol

The matrix dimension.

precision

The variable type, please refer to gpuMagic.getAvailableType() to see the available data type.

constDef

Specify if the variable can be redefined. The package will automatically update the variable definition when it is needed, if you do not need this feature, you can manually turn the feature off. It is useful in some special cases such as turning off the auto update to do the integer division (By default, the package will convert the variable to the default float type before doing the division).

shared

If the matrix is shared by all the workers in a work group. Do not use it if you don't know its meaning.

location

The physical memory location of the matrix, it can be either 'global' or 'local'. Do not use it if you don't know its meaning.

Value

a matrix initialize with 0.

Examples

1
2
#Create a 10-by-10 matrix
A=Matrix(10,10)

gpuMagic documentation built on Nov. 8, 2020, 5:15 p.m.