d2h: Cuda class methods: d2hVector, d2hMatrix

Description Usage Arguments Value Examples

Description

Retrieve vector or matrix data from device.

Usage

1
2
3
cu <- new(Cuda) 
cu$d2hVector(x) 
ch$d2hMatrix(x)

Arguments

x

XPtr to device memory, such as returned by h2dVector or h2dMatrix

Value

A vector or matrix containing the data retrieved from the device.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
cu <- new(Cuda)

# create data vector and load on device
x <- rnorm(20)
x_dev <- cu$h2dVector(x)

# copy our data back from device
copy <- cu$d2hVector(x_dev)
all.equal(x, copy)

## End(Not run)

erikor/cudalite documentation built on May 31, 2019, 8:07 a.m.