loadKernel: Cuda class method: loadKernel

Description Arguments Details Examples

Description

Read a kernel from source file, compile it, and load it on device.

Arguments

fn

Name (including path) of kernel source file (typically .cu) which defines a kernexec function.

Details

Note: the name of the entry function for your kernel MUST be 'kernexec', since that is what will eventually be called when the kernel is launched. More flexible names may be supported in the future.

If the kernel fails to compile, an error will be thrown but the output will not be terribly helpful for debugging. In this event, try compiling the kernel file on the command line with nvcc yourkernel.cu. This will always produce an error about missing main entry point, but any other errors will need to be fixed.

Simple example kernels are in the "extdata" folder of this package (for a listing try dir(system.file("extdata", package="cudalite")))

Examples

1
2
3
4
5
6
## Not run: 
cu <- new(Cuda)
k <- system.file("extdata", "hello.cu", package="cudalite")
cu$loadKernel(k)

## End(Not run)

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