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

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

问题描述

我有一个用 Erlang 编写的神经网络,我刚买了一块 GeForce GTX 260 卡,上面有 240 核 GPU.使用 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天全站免登陆