float gpu 加速_(总结篇)使用 MATLAB GPU 加速计算|MATLAB 并行计算与分布式服务器|MATLAB技术论坛...

本帖最后由 蓝云风翼 于 2013-12-18 17:28 编辑

注:

利用gpu加速有一下工具

1.JACKET 可从帖子中寻找

2.MATLAB a.并行计算工具箱 gpuArray,查看支持gpuArray的函数methods('gpuArray')

b.已经支持GPU的一些工具箱

c.使用mex方式 http://www.matlabsky.com/thread-33511-1-1.html

d.使用产生ptx方法编写cuda kernel

这些都可以通过help gpuArray查看,建议使用最新版本2013a

查看GPU是否支持gpuDevice命令

3.GPUMAT帖子中找

4. nvmex方式即cudawhitepaper可从帖子中直接下载

http://www.matlabsky.com/thread-20597-1-1.html

http://www.matlabsky.com/thread-25951-1-1.html

SIMULINK  :http://www.matlabsky.com/forum.php?mod=viewthread&tid=27230

目前,GPU在通用数值计算领域的应用已经越来越广泛,MATLAB通过以下几种方式支持GPU。

一、MATLAB内嵌GPU函数fft, filter,及linear algebra operations等。

二、内嵌工具箱支持GPU的函数: Communications System Toolbox, Neural Network Toolbox, Phased Array Systems Toolbox, and Signal Processing Toolbox (GPU support for signal processing algorithms)

三、在MATLAB中接入CUDA kernel,通过PTX方式或者MEX方式。

Multiple GPUs在单机和计算集群上的使用通过MATLAB 的并行计算工具箱(PCT)及MATLAB分布式计算工具箱(MDCS)(matlab worker)

一、PCT  GPUArray

Parallel Computing Toolbox 提供 GPUArray,这是一个具有多个关联函数的特殊数组类型,可让您直接从 MATLAB 在启用 CUDA 的 NVIDIA GPU 上执行计算。这些函数包括 fft、元素级运算和几种线性代数运算,如 lu 和 mldivide(也称作反斜杠运算符 (\))。该工具箱还提供一种机制,可让您直接从 MATLAB 使用现有的基于 CUDA 的 GPU 内核。

使用 MATLAB 进行 GPU 计算。使用 GPUArrays 和 启用 GPU 的 MATLAB 函数,有助于加速 MATLAB 运算,而无需进行低级的 CUDA 编程。

PCT工具箱支持NVIDIA CUDA GPUs(计算能力大于1.3,K20C 计算能力为3.5)

FunctionsCreate array on GPU

Transfer distributed array data or gpuArray to local workspace

Determine if gpuArray or CUDAKernel is available on GPU

Query or select GPU device

Number of GPU devices present

Time required to run function on GPU

Reset GPU device and clear its memory

Wait for job to change state or for GPU calculation to complete

Apply function to each element of array on GPU

Binary singleton expansion function for gpuArray

Apply function to each page of array on GPU

Create GPU CUDA kernel object from PTX and CU code

Evaluate kernel on GPU

Set some constant memory on GPU

ClassesArray of data stored on GPU

Graphics processing unit (GPU)

Kernel executable on GPU

1.使用GPU

首先在命令行窗口输入 gpuDevice 查看当前计算机上是否已经正确安装了GPU设备(硬件+驱动)。

查看所有支持的GPU:

for ii = 1:gpuDeviceCount

g = gpuDevice(ii);

fprintf(1, 'Device %i has ComputeCapability %s \n', ...

g.Index, g.ComputeCapability)

end复制代码

查看gpuArray支持的函数methods('gpuArray')

>> help gpuArray

gpuArray create data on the GPU

G = gpuArray( X ) copies the numeric data X to the GPU. This data can be

operated on by passing it to the FEVAL method of parallel.gpu.CUDAKernel

objects, or by using one of the methods defined for gpuArray objects.  See

the Parallel Computing Toolbox documentation for a

list of methods supported by gpuArray.

The MATLAB data X must be numeric (for example: single, double, int8 etc.)

or logical, and the GPU device must have sufficient free memory to store the

data. X must be full.

Examp

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值