View source: R/createStreamsGpu.R
createStreamsGpu | R Documentation |
Generate streams on a GPU device
createStreamsGpu(n = prod(getOption("clrng.Nglobal")))
n |
a integer specifying number of streams to create, default is the number of total work items in use |
a stream object of class 'vclMatrix' on GPU
library(clrng)
if (detectGPUs() >= 1) {
setBaseCreator(rep(12345,6))
setContext(grep("gpu", listContexts()$device_type)[1])
myStreamsGpu = createStreamsGpu(4)
t(as.matrix(myStreamsGpu))
myStreamsGpu2 = createStreamsGpu(6)
t(as.matrix(myStreamsGpu2)) }else {
message("No GPU context available")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.