Learn R Programming

clrng (version 0.0.5)

createStreamsGpu: createStreamsGpu

Description

Generate streams on a GPU device

Usage

createStreamsGpu(n = prod(getOption("clrng.Nglobal")))

Value

a stream object of class 'vclMatrix' on GPU

Arguments

n

a integer specifying number of streams to create, default is the number of total work items in use

Examples

Run this code
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")
}

Run the code above in your browser using DataLab