library(OpenCL)
cat("== Platforms:\n")
(platforms <- oclPlatforms())
if (length(platforms)) {
cat("== Devices:\n")
## pick the first platform
print(devices <- oclDevices(platforms[[1]]))
if (length(devices)) {
cat("== Context:\n")
## pick the first device
print(ctx <- oclContext(devices[[1]]))
}
cat("== Default context:\n")
## Note that context can find device on its own
## (may be different from above if you have multiple devices)
print(c2 <- oclContext())
}
Run the code above in your browser using DataLab