8.5 gpuR

Charles Determan 开发的 gpuR 基于 OpenCL 加速,目前处于活跃维护状态。而 Charles Determan 开发的另一个 gpuRcuda 包是基于 CUDA 加速

赵鹏 的博客 ParallelR 关注基于 CUDA 的 GPU 加速

此外还有 gputools

library(gpuR)
set.seed(2019)
gpuA <- gpuMatrix(rnorm(16), nrow = 4, ncol = 4)
gpuA
An object of class "fgpuMatrix"
Slot "address":
<pointer: 0x000000000fbe9760>

Slot ".context_index":
[1] 1

Slot ".platform_index":
[1] 1

Slot ".platform":
[1] "Intel(R) OpenCL"

Slot ".device_index":
[1] 1

Slot ".device":
[1] "Intel(R) HD Graphics 4600"
gpuB <- gpuA %*% gpuA
print(gpuB)
Source: gpuR Matrix [4 x 4]

            [,1]      [,2]      [,3]       [,4]
[1,]  2.61787200 -1.274909 -2.150301 -2.0073860
[2,] -0.02231596  1.566433  0.986027  0.7339008
[3,] -0.12862393  1.848340  3.261899  1.6919358
[4,] -1.90084898 -1.863014 -1.312350 -0.2553876