convertToPtr: Convert an R object to a pointer for use with CUDA

Description Usage Arguments Value Author(s) See Also

Description

This is (currently) a simple function that takes an R vector/matrix and returns a pointer to the elements so that they can be used to copy the contents to a CUDA device. We specify the desired type of the individual elements. If this a float, we create a new array at the native level and arrange to free that when it is no longer referenced. For an integer or numeric vector, this returns the pointer to the actual elements in the R object.

Usage

1

Arguments

value

the R vector

type

the name of the type of element we want

Value

An external pointer object.

Author(s)

Duncan Temple Lang

See Also

mallocPitch and the assignment method for PitchMemory2.


duncantl/RCUDA documentation built on May 15, 2019, 5:26 p.m.