OpenCL FFT对Nvidia和AMD硬件? [英] OpenCL FFT on both Nvidia and AMD hardware?

查看:163
本文介绍了OpenCL FFT对Nvidia和AMD硬件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要在Nvidia和AMD显卡上使用FFT的项目。我最初寻找一个可以同时工作的图书馆(认为这是OpenCL的方式),但我没有任何运气。

I'm working on a project that needs to make use of FFTs on both Nvidia and AMD graphics cards. I initially looked for a library that would work on both (thinking this would be the OpenCL way) but I wasn't having any luck.

有人建议我将必须使用每个供应商的FFT实现,并编写一个包装器,选择在平台上做什么。我发现AMD的实现很容易,但实际上我正在使用Nvidia卡(这是更重要的一个为我的特定应用程序)。

Someone suggested to me that I would have to use each vendor's FFT implementation and write a wrapper that chose what to do based on the platform. I found AMD's implementation pretty easily, but I'm actually working with an Nvidia card in the meantime (and this is the more important one for my particular application).

只有Nvidia实现我可以找到的是CUFFT一个。有人知道我怎么可以实际使用OpenCL的CUFFT库?我唯一能想到的方法是在我的OpenCL代码旁边放置一些CUDA代码。我读过,我不能只使用OpenCL缓冲区作为CUDA指针(尝试在openvix与CUDA在Nvidia的SDK模板中混合使用)。相反,我必须在运行OpenCL内核后将缓冲区复制回主机,然后使用CUDA内存传输例程将它们复制回GPU?我不喜欢这种方法,因为它似乎涉及无意义的内存传输,我更喜欢它,如果我只能使用CUCLFT从OpenCL。

The only Nvidia implementation I can find is the CUFFT one. Does anyone know how I can actually use the CUFFT library from OpenCL? The only way I can think of is by having some CUDA code alongside my OpenCL code. I've read that I can't just use OpenCL buffers as CUDA pointers ( Trying to mix in openCL with CUDA in Nvidia's SDK template ). Instead, would I have to copy the buffers back to the host after running OpenCL kernels and then copy them back to the GPU using the CUDA memory transfer routines? I don't really like this approach as it seems to involve pointless memory transfers, I would much prefer it if I could just use CUFFT from OpenCL.

推荐答案

NVIDIA没有做任何工作来支持OpenCL库,例如FFT。它还没有为它的CUDA库提供源码,所以没有办法运行这些使用OpenCL。

NVIDIA has not done any work to support OpenCL libraries, like FFT. It also has not provided source to its CUDA libraries, so there is no way to run those using OpenCL.

AMD的FFT库是你的最好的选择,将运行在任何其他OpenCL兼容设备,包括NVIDIA的GPU。 ArrayFire OpenCL 利用AMD的FFT库,我在英特尔,NVIDIA,和我们实验室中的AMD设备。

AMD's FFT library is your best bet and will run on any other OpenCL-compliant device, including NVIDIA's GPUs. ArrayFire OpenCL leverages AMD's FFT library, and I've run that on Intel, NVIDIA, and AMD devices in our lab.

这篇关于OpenCL FFT对Nvidia和AMD硬件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆