Skip to content

OpenCL

Interface allowing R to use OpenCL

v0.2-11 · Jan 19, 2026 · BSD_3_clause + file LICENSE

Description

This package provides an interface to OpenCL, allowing R to leverage computing power of GPUs and other HPC accelerator devices.

Downloads

463

Last 30 days

7736th

463

Last 90 days

463

Last year

CRAN Check Status

3 ERROR
9 NOTE
Show all 12 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
r-devel-linux-x86_64-fedora-clang NOTE
r-devel-linux-x86_64-fedora-gcc NOTE
r-devel-macos-arm64 ERROR
r-oldrel-macos-arm64 ERROR
r-oldrel-macos-x86_64 NOTE
r-oldrel-windows-x86_64 NOTE
r-patched-linux-x86_64 NOTE
r-release-linux-x86_64 NOTE
r-release-macos-arm64 ERROR
r-release-macos-x86_64 NOTE
Check details (27 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-devel-linux-x86_64-debian-clang

tests

  Running ‘buffer.R’ [0s/1s]
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
  Running ‘kernel.R’ [3s/6s]
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< >
NOTE r-devel-linux-x86_64-debian-gcc

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-devel-linux-x86_64-debian-gcc

tests

  Running ‘buffer.R’ [0s/1s]
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
  Running ‘kernel.R’ [2s/2s]
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< >
NOTE r-devel-linux-x86_64-fedora-clang

DESCRIPTION meta-information

Licence stub is invalid DCF.
NOTE r-devel-linux-x86_64-fedora-clang

tests

  Running ‘buffer.R’
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
  Running ‘kernel.R’
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< >
NOTE r-devel-linux-x86_64-fedora-gcc

DESCRIPTION meta-information

Licence stub is invalid DCF.
NOTE r-devel-linux-x86_64-fedora-gcc

tests

  Running ‘buffer.R’
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
  Running ‘kernel.R’
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...
5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< >
NOTE r-devel-macos-arm64

DESCRIPTION meta-information

License stub is invalid DCF.
ERROR r-devel-macos-arm64

examples

Running examples in ‘OpenCL-Ex.R’ failed
The error most likely occurred in:

> ### Name: clBuffer
> ### Title: Create and handle OpenCL buffers
> ### Aliases: clBuffer as.clBuffer as.double.clBuffer as.integer.clBuffer
> ###   is.clBuffer print.clBuffer length.clBuffer [.clBuffer [<-.clBuffer
> ### Keywords: interface
> 
> ### ** Examples
> 
> library(OpenCL)
> 
> ## Only proceed if this machine has at least one OpenCL platform
> if (length(oclPlatforms())) {
+ 
+ ctx<-oclContext()
+ 
+ buf<-clBuffer(ctx, 16, "numeric")
+ # Do not write buf<-..., as this replaces buf with a vector.
+ buf[]<-sqrt(1:16)
+ buf
+ 
+ intbuf<-as.clBuffer(1:16, ctx)
+ print(intbuf)
+ 
+ length(buf)
+ as.numeric(buf)
+ buf[]
+ 
+ buf[3:5]
+ buf[1:2] = 0
+ buf
+ 
+ ## clBuffer is the required argument and return type of oclRun.
+ ## See oclRun() examples.
+ }
Error in oclDevices(type = device) : 
  clGetDeviceIDs failed, oclError -30: invalid value (CL_INVALID_VALUE)
Calls: oclContext -> oclDevices
Execution halted
ERROR r-devel-macos-arm64

tests

  Running ‘buffer.R’ [0s/0s]
Running the tests in ‘tests/buffer.R’ failed.
Complete output:
  > # 0. Create context
  > library(OpenCL)
  > 
  > if (!length(oclPlatforms())) {
  +     cat("== Cannot run tests as there is no platform")
  +     q("no")
  + }
  > 
  > ctx<-oclContext()
  Error in oclDevices(type = device) : 
    clGetDeviceIDs failed, oclError -30: invalid value (CL_INVALID_VALUE)
  Calls: oclContext -> oclDevices
  Execution halted
NOTE r-oldrel-macos-arm64

DESCRIPTION meta-information

License stub is invalid DCF.
ERROR r-oldrel-macos-arm64

examples

Running examples in ‘OpenCL-Ex.R’ failed
The error most likely occurred in:

> ### Name: clBuffer
> ### Title: Create and handle OpenCL buffers
> ### Aliases: clBuffer as.clBuffer as.double.clBuffer as.integer.clBuffer
> ###   is.clBuffer print.clBuffer length.clBuffer [.clBuffer [<-.clBuffer
> ### Keywords: interface
> 
> ### ** Examples
> 
> library(OpenCL)
> 
> ## Only proceed if this machine has at least one OpenCL platform
> if (length(oclPlatforms())) {
+ 
+ ctx<-oclContext()
+ 
+ buf<-clBuffer(ctx, 16, "numeric")
+ # Do not write buf<-..., as this replaces buf with a vector.
+ buf[]<-sqrt(1:16)
+ buf
+ 
+ intbuf<-as.clBuffer(1:16, ctx)
+ print(intbuf)
+ 
+ length(buf)
+ as.numeric(buf)
+ buf[]
+ 
+ buf[3:5]
+ buf[1:2] = 0
+ buf
+ 
+ ## clBuffer is the required argument and return type of oclRun.
+ ## See oclRun() examples.
+ }
Error in oclDevices(type = device) : 
  clGetDeviceIDs failed, oclError -30: invalid value (CL_INVALID_VALUE)
Calls: oclContext -> oclDevices
Execution halted
NOTE r-oldrel-macos-arm64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
ERROR r-oldrel-macos-arm64

tests

  Running ‘buffer.R’ [0s/0s]
Running the tests in ‘tests/buffer.R’ failed.
Complete output:
  > # 0. Create context
  > library(OpenCL)
  > 
  > if (!length(oclPlatforms())) {
  +     cat("== Cannot run tests as there is no platform")
  +     q("no")
  + }
  > 
  > ctx<-oclContext()
  Error in oclDevices(type = device) : 
    clGetDeviceIDs failed, oclError -30: invalid value (CL_INVALID_VALUE)
  Calls: oclContext -> oclDevices
  Execution halted
NOTE r-oldrel-macos-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-oldrel-macos-x86_64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
NOTE r-oldrel-windows-x86_64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
NOTE r-patched-linux-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-patched-linux-x86_64

tests

  Running ‘buffer.R’ [0s/1s]
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
  Running ‘kernel.R’ [3s/5s]
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< >
NOTE r-release-linux-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-release-linux-x86_64

tests

  Running ‘buffer.R’ [0s/1s]
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
  Running ‘kernel.R’ [3s/5s]
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< >
NOTE r-release-macos-arm64

DESCRIPTION meta-information

License stub is invalid DCF.
ERROR r-release-macos-arm64

examples

Running examples in ‘OpenCL-Ex.R’ failed
The error most likely occurred in:

> ### Name: clBuffer
> ### Title: Create and handle OpenCL buffers
> ### Aliases: clBuffer as.clBuffer as.double.clBuffer as.integer.clBuffer
> ###   is.clBuffer print.clBuffer length.clBuffer [.clBuffer [<-.clBuffer
> ### Keywords: interface
> 
> ### ** Examples
> 
> library(OpenCL)
> 
> ## Only proceed if this machine has at least one OpenCL platform
> if (length(oclPlatforms())) {
+ 
+ ctx<-oclContext()
+ 
+ buf<-clBuffer(ctx, 16, "numeric")
+ # Do not write buf<-..., as this replaces buf with a vector.
+ buf[]<-sqrt(1:16)
+ buf
+ 
+ intbuf<-as.clBuffer(1:16, ctx)
+ print(intbuf)
+ 
+ length(buf)
+ as.numeric(buf)
+ buf[]
+ 
+ buf[3:5]
+ buf[1:2] = 0
+ buf
+ 
+ ## clBuffer is the required argument and return type of oclRun.
+ ## See oclRun() examples.
+ }
Error in oclDevices(type = device) : 
  clGetDeviceIDs failed, oclError -30: invalid value (CL_INVALID_VALUE)
Calls: oclContext -> oclDevices
Execution halted
ERROR r-release-macos-arm64

tests

  Running ‘buffer.R’ [0s/0s]
Running the tests in ‘tests/buffer.R’ failed.
Complete output:
  > # 0. Create context
  > library(OpenCL)
  > 
  > if (!length(oclPlatforms())) {
  +     cat("== Cannot run tests as there is no platform")
  +     q("no")
  + }
  > 
  > ctx<-oclContext()
  Error in oclDevices(type = device) : 
    clGetDeviceIDs failed, oclError -30: invalid value (CL_INVALID_VALUE)
  Calls: oclContext -> oclDevices
  Execution halted
NOTE r-release-macos-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-release-macos-x86_64

tests

  Running ‘buffer.R’ [0s/0s]
  Comparing ‘buffer.Rout’ to ‘buffer.Rout.save’ ...5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
77c71
< OpenCL buffer, 16 elements of type single 
---
> OpenCL buffer, 16 elements of type double 
79c73
<  [9] 3.316625 3.464102 3.605551 3.741657 3.872983 4.000000 4.123106 4.242640
---
>  [9] 3.316625 3.464102 3.605551 3.741657 3.872983 4.000000 4.123106 4.242641
  Running ‘kernel.R’ [0s/1s]
  Comparing ‘kernel.Rout’ to ‘kernel.Rout.save’ ...5,10d4
< > 
< > if (!length(oclPlatforms())) {
< +     cat("== Cannot run tests as there is no platform")
< +     q("no")
< + }
< > 
29c23
< OpenCL buffer, 16 elements of type single 
---
> OpenCL buffer, 16 elements of type double 
32,35c26,27
< OpenCL buffer, 16 elements of type single 
<  [1]   1.00000   4.00000   9.00000  16.00000  25.00000  36.00001  48.99999
<  [8]  63.99999  81.00000 100.00000 121.00002 144.00000 169.00000 196.00003
< [15] 225.00003 256.00000
---
> OpenCL buffer, 16 elements of type double 
>  [1]   1   4   9  16  25  36  49  64  81 100 121 144 169 196 225 256
42c34
< OpenCL buffer, 16 elements of type single 
---
> OpenCL buffer, 16 elements of type double

Additional Issues

Check History

ERROR 0 OK · 9 NOTE · 0 WARNING · 3 ERROR · 0 FAILURE Mar 9, 2026
NOTE r-devel-linux-x86_64-debian-clang

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-devel-linux-x86_64-debian-gcc

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-devel-linux-x86_64-fedora-clang

DESCRIPTION meta-information

Licence stub is invalid DCF.
NOTE r-devel-linux-x86_64-fedora-gcc

DESCRIPTION meta-information

Licence stub is invalid DCF.
ERROR r-devel-macos-arm64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-patched-linux-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-release-linux-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
ERROR r-release-macos-arm64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-release-macos-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
ERROR r-oldrel-macos-arm64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-oldrel-macos-x86_64

DESCRIPTION meta-information

License stub is invalid DCF.
NOTE r-oldrel-windows-x86_64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.

Version History

new 0.2-11 Mar 9, 2026