如何让已经编写好的并发程序在 GPU 阵列上运行? [英] How do I make an already written concurrent program run on a GPU array?

查看:14
本文介绍了如何让已经编写好的并发程序在 GPU 阵列上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用 Erlang 编写的神经网络,我刚买了一张带有 240 核 GPU 的 GeForce GTX 260 卡.使用 CUDA 作为胶水在显卡上运行它是不是很简单?

I have a neural network written in Erlang, and I just bought a GeForce GTX 260 card with a 240 core GPU on it. Is it trivial to use CUDA as glue to run this on the graphics card?

推荐答案

不,使用 CUDA 不是小事.

No, using CUDA is not a trivial matter.

CUDA 编程模型基本上使用 C(添加了一些内容),但为了充分利用 GPGPU 的功能,您必须确保您的算法遵循 CUDA 指南.(参见NVidia CUDA 编程指南)

The CUDA programming model basically uses C (with some additions) but in order to get the most of the GPGPU's capabilities you would have to ensure that your algorithms follow the CUDA guidelines. (see NVidia CUDA Programming Guide)

例如,为了获得最佳内存性能(大约 70Gbps),您需要在流模式下通过合并访问内存,而且 GPU 上的分支成本非常高,因此您应该尽可能避免使用条件语句.查看 SDK 提供的指南和示例,它们将提供一个很好的起点

For example in order to get the best memory performance (somewhere around 70Gbps) you need to access memory in streaming mode with coalescing, also branches are very costly on the GPUs so you should avoid conditionals as much as possible. Check out the guide and samples provided with the SDK, they'll provide an excellent starting point

这篇关于如何让已经编写好的并发程序在 GPU 阵列上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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