1

我有一个需要大量图像处理的项目,并希望添加 GPU 支持以加快速度。

我想知道我是否将我的 matlab 编译成 c++ 共享库并从 OpenCL 程序中调用它,这是否意味着 matlab 代码将在 GPU 上运行?

4

4 回答 4

1

我自己的(半受过教育的)猜测是你会发现这很难做到。但是,其他人也走了同样的路。 这篇论文可能是您开始研究的好地方。谷歌搜索出现了Accelereyes和一些关于 Mathworks 文件交换项目的参考资料,您可能想跟进这些项目。

于 2010-07-03T17:28:44.410 回答
1

夹克中的所有内容都是用 c/c++/cuda 编写的。事实上,我们现在有一个 beta 版本的 libjacket (http://www.accelereyes.com/downloadLibjacket),如果你愿意的话,它不仅可以用来扩展 matlab,还可以用来扩展其他语言。

@OSaad 我们的大多数功能都是最快的选项。无论是C还是matlab。

于 2010-12-08T19:57:39.957 回答
0

Typically, if you can write your Matlab code in a "vectorized" way, then the packages like AccelerEyes and Jacket have a reasonable chance of making things run on the GPU. You can verify this to some extent beforehand by checking whether Matlab itself is able to run on multiple cores on the CPU (these days Matlab will use multiple cores if things are parallelizable in an obvious way).

If that doesn't work, then you need to drop down to C/C++ via mex and then, from there, call OpenCL yourself. Mex is how Matlab talks to C code, so you write C code that is called by Matlab (and receives the matrices, etc), then initialises and calls OpenCL. This is more work, but may be your only route (and, even if the automated packages work to some extent, this approach can still give more speedups because you can be smarter about memory management, for example, if you know what your are doing).

于 2010-12-17T19:09:48.607 回答
0

即将发布的 R2010b(9 月 1 日发布)中的并行计算工具箱支持 GPU 处理的多种功能。不幸的是,它只支持 CUDA(1.3 版及更高版本),所以如果使用 ATI 显卡,你就不走运了。但是,无论如何,您可能只想购买专用 GPU。

于 2010-07-03T19:11:52.907 回答