Convert the type of a GPU object

Share:

Description

This function is used to convert the type (i.e. "double", "single", "integer" or "logical") of a gmatrix or gvector object.

Usage

1
convertType(x, to, dup = TRUE)

Arguments

x

A GPU object of class gvector or gmatrix

to

The type to convert the object to. There are three different ways to specify this. One may use the "double", "single", "integer" or "logical" notation. Alternatively the short form "d", "s", "i" or "s" notation may be used. Finally the internal integer representation of 0L, 1L, 2L or 3L may be used.

dup

This may be set to 'FALSE' to avoid duplicating x in the event the original type and the to type are the same

Value

Returns the x after converting it to a new type.

Author(s)

Nathan Morris

See Also

type

Examples

1
2
3
x=gseq(1,10)
y=convertType(x,'d')
type(y)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.