在 GPU 而非 CPU 上执行运算(计算 Pi)

发布于 2024-07-30 20:12:17 字数 1542 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

陌上青苔 2024-08-06 20:12:19

有一组 Nvidia CUDA api 的 .Net 绑定,称为 CUDA.net。 您可以参考参考指南 查看一些示例 C# 代码。

访问协处理器 (GPU) 的首选方法是使用 OpenCL,以便您的代码可以与 ATI 卡一起移植,但我相信可能需要额外的编码,并且我不确定 OpenCL 对 .Net 平台有多少支持。

如果您想使用 C++,这里有一个快速概述 如何获取一些使用 Visual Studio 编译的示例代码。

There is a set of .Net bindings for Nvidia's CUDA api, it's called CUDA.net. You can refer to the reference guide to look at some sample C# code.

The preferred way to access your co-proccesor (GPU) would be using OpenCL so that your code would be portable with ATI cards, but I believe there may be additional coding required and I'm not sure how much support OpenCL has for the .Net platform.

If you want to use C++, here's a quick overview on how to get some sample code compiling with Visual Studio.

烟火散人牵绊 2024-08-06 20:12:19

CUDA.NET 应该正是您正在寻找的,它似乎支持您的特定显卡。

CUDA.NET should be exactly what you're looking for, and it seems to support your specific graphics card.

鹤仙姿 2024-08-06 20:12:19

对于 C# 的 GPU 计算,另一个没有提到的选项是 Brahma

Brahma 为 GPU 计算提供基于 LINQ 的抽象 - 它基本上是 LINQ to GPU。 它可以在 OpenGL 和 DirectX 上运行,无需额外的库(但需要 SM3)。 有些样本相当惊人。

Another option that hasn't been mentioned for GPU calculation from C# is Brahma.

Brahma provides a LINQ-based abstraction for GPU calculations - it's basically LINQ to GPU. It works over OpenGL and DirectX without extra libraries (but requires SM3). Some of the samples are fairly amazing.

放飞的风筝 2024-08-06 20:12:19

您可能想看看这个问题

您可能正在寻找加速器,但如果您对游戏开发感兴趣,我建议您参加看看XNA

You might want to look at this question

You're probably looking for Accelerator, but if you are interested in game development in general I'll suggest you take a look at XNA

寒江雪… 2024-08-06 20:12:19

您可以使用 Windows API 代码包从 .NET 访问最新的 Direct3D API。 Direct3D 11 附带计算着色器。 它们与 CUDA 大致相当,但也可以在非 NVIDIA GPU 上运行。

请注意,托管 DirectX 和 XNA 仅限于 Direct3D 9 功能集,这对于 GPGPU 使用有些困难。

You can access the latest Direct3D APIs from .NET using the Windows API Code Pack. Direct3D 11 comes with Compute Shaders. These are roughly comparable to CUDA, but work also on non-NVIDIA GPUs.

Note that Managed DirectX and XNA are limited to the Direct3D 9 feature set, which is somewhat difficult to use for GPGPU.

不再让梦枯萎 2024-08-06 20:12:19

仅供参考:加速器 (http://research.microsoft.com/en-us/projects /Accelerator/)在一些测试中运行良好。

FYI: Accelerator (http://research.microsoft.com/en-us/projects/Accelerator/) was working great for a couple of tests.

绝不服输 2024-08-06 20:12:17

这是一项非常新的技术,但您可能会研究CUDA。 由于您的问题是用 C# 标记的,因此这里是 .Net包装器

作为奖励,您的 8800 GTX 似乎支持 CUDA。

It's a very new technology, but you might investigate CUDA. Since your question is tagged with C#, here is a .Net wrapper.

As a bonus, it appears that your 8800 GTX supports CUDA.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文