关于C#调用GPU计算,下面是stackoverflow的一段总结:

链接:<https://stackoverflow.com/questions/375011/utilizing-the-gpu-with-c-sharp> :

Most of these answers are quite old, so I thought I'd give an updated summary of where I think each project is:

  • GPU.Net (TidePowerd) - I tried this 6 months ago or so, and did get it working though it took a little bit of work. Converts C# kernel code to cuda at compile time. Unfortunately their website has been down and their github hasn't been updated for a couple of years, which might indicate the project is dead....
  • Cudafy - Open source and very easy to use. Converts C# kernel code to cuda at runtime (with ability to serialize and cache). Can easily run the same kernel code on the CPU (mostly for debugging). Supports multiple GPUs. More examples available than others here. The boilerplate code referred to by other answers is minimal, and in my case at least helped with my understanding of how the code works. Cuda/Nvidia only though. Unfortunately, it seems that they didn't update their solutions for a couple of years too (latest commit in 2015 -- support of cuda 7.0).
  • Hybridizer. Commercial solution compiling C# to CUDA. Provides a free community edition on visual studio marketplace and samples on github.
  • AleaGPU Commercial solution with a free community edition for consumer GPUS. See Daniel's comments for details.
  • Brahma - runs LINQ expressions via OpenCL (so supports AMD too). Not much documentation / examples. Last update in 2011.
  • C$ - last development was over 10 years ago...
  • Microsoft Accelerator - similarly doesn't look like it is being actively developed any longer.
  • some others (C++ AMP, OpenTK -- dead/Cloo) - many of these are just bindings - ie enable you to call the GPU from C#, but your kernel code (code which is actually run on the GPU) needs to be written in C or OpenCL, meaning you must use (and learn) another language.

As I said, I would recommend Cudafy over all the others - if it could run on OpenCL as well as Cuda it would be perfect.

EDIT SEP 2013 Cudafy now allows you to compile for both CUDA and OpenCL, so will run the same C# code on on all GPUs. This sounds fantastic, though I haven't tested the OpenCL compiling yet.

综上,考虑到类库的完成性以及便利性,我选择使用了 Alea 库。

关于Alea GPU:

对于单GPU调用计算,alea gpu是免费的,多gpu调用是需要另外收取费用。

alea gpu比较方便C#程序员开发程序,其自动内存管理特性,自动将内存在CPU和GPU之间复制,对小白来说是比较友好的功能了。

gpu.for 函数,可以很方便的将CPU并行级的 Paraller.For 改成gpu.for,从而实现GPU上的并行计算(可以很明显的降低CPU的利用率)。

gpu.for和kernel函数都支持委托,很方便将现有代码改成gpu上运行的代码。

除此之外,也支持开发者自己考虑分配内存。

官方说明文档(学习资料):http://www.aleagpu.com/release/3_0_4/doc/introduction.html

文档介绍的很详细,开发环境配置、CUDA编程模式、C#调用教程以及C#Demo 都很详细,就不做赘述了,有问题可以留言。

了解cuda编程基础,可以看看这个:https://zhuanlan.zhihu.com/p/34587739

C# 调用GPU计算(Alea库、英伟达GPU)相关推荐

  1. check your GPU Compute Capability| 2021 英伟达 GPU 的计算能力排名

  2. 谷歌TPU2代有望取代英伟达GPU?测评结果显示…

    原作:Elmar Haußmann 安妮 Root 编译自 RiseML Blog 量子位 出品 | 公众号 QbitAI 去年5月,谷歌推出了第二代TPU芯片,这是一个自定义开发的深度学习加速芯片, ...

  3. 5 年提速 500 倍,英伟达 GPU 创纪录突破与技术有哪些?

    作者:诗颖 摘要:日前,英伟达 Developer Blog 上一篇博文详细陈述了英伟达 Volta Tensor Core GPU 在深度学习社群取得的巨大突破,以及种种突破背后的技术细节. 201 ...

  4. 玩深度学习选哪块英伟达 GPU?有性价比排名还不够!

    本文來源地址:https://www.leiphone.com/news/201705/uo3MgYrFxgdyTRGR.html 与"传统" AI 算法相比,深度学习(DL)的计 ...

  5. gpu超算算法_英伟达推GPU加速Arm服务器参考设计!微软Azure启动GPU超算实例

    芯潮(ID:aichip001)文 | 韦世玮 芯潮11月20日消息,昨天,英伟达在2019国际超级计算大会(SC19)上推出用于构建GPU加速Arm服务器的参考设计,以及用于优化网络和存储数据处理的 ...

  6. 英伟达GPU中的Tnesor Cores数量多寡与显卡性能有什么关联?

    前言 最近在调研常用显卡的参数,看到Nvidia Tensor Cores常用于其中作为对比,呈现在性能好的显卡比如A100比RTX 3060更多更全面,开始思考Tensor Cores细致的作用是什 ...

  7. AMD与Intel,挑战英伟达GPU

    AMD与Intel,挑战英伟达GPU 作为CPU界的霸主,英特尔对高性能GPU市场一直没有死心.从1998年和Real3D合作推出的i740独显,到2009年无故流产的Larrabee独显,再到去年公 ...

  8. 薅资本主义羊毛新姿势,英伟达GPU免费用

    作者 | 阿司匹林 出品 | 人工智能头条(公众号ID:AI_Thinker) 在到处都是开源工具和学习资料的今天,深度学习的门槛已经大大降低.然而,学习的门槛降低并不意味着学习的成本降低了,比如说动 ...

  9. 本周AI热点回顾:百度推出全球首个mRNA疫苗不稳定性解决方案、性能提升20倍:英伟达GPU旗舰A100

    01 百度推出全球首个mRNA疫苗不稳定性解决方案LinearDesign 新冠疫情爆发后,RNA设计领域世界知名专家.斯坦福大学生物化学系Rhiju Das教授关注到疫苗研发存在的一个非常棘手的问题 ...

  10. 英伟达GPU“屠榜”,谷歌TPU“退赛”,MLPerf最新推理榜单出炉

    晓查 发自 凹非寺  量子位 报道 | 公众号 QbitAI MLPerf推理基准测试第二版(v0.7)近日发布. 在数据中心分类下,英伟达2年前的推理卡T4依然能"大杀特杀",7 ...

最新文章

  1. yolo v3制作自己的数据_小白也能弄懂的目标检测之YOLO系列 第一期
  2. (Builder)建造者模式的Java实现
  3. 设计模式07----代理模式
  4. iOS开发篇——OC之NSNumber数字对象讲解
  5. set获取元素_C++与STL入门(4):关联容器:集合set
  6. pandas不可哈希化问题,unhashable type: ‘pandas._libs.tslibs.offsets.Hour
  7. Sql 正确删除用户过期的数据
  8. 不允许有匹配 “[xX][mM][lL]“ 的处理指令目标。
  9. Qt读写Excel--QXlsx工作表显示/隐藏状态设置4
  10. 台式计算机进入安全模式蓝屏,电脑进安全模式蓝屏怎么办
  11. 关于产品的一些思考——八千里科技之谁叫我起床
  12. 面试复盘系列:从象棋提升之道趣说面试提升之法
  13. mysql init 崩溃_MySQL · 引擎特性 · InnoDB崩溃恢复
  14. 向上的路,从来都不好走(好文力荐)
  15. 个人所得税税率怎么算
  16. 微信小程序面试题大全
  17. 快速过一遍计算机网络!
  18. Linux7/Centos7磁盘分区、格式化及LVM管理
  19. cocoscreator getSpriteFrame is not a function 问题
  20. LTE:RA-RNTI、T-CRNTI、C-RNTI

热门文章

  1. Git-02-分支使用
  2. ViewModel 在 Activity 中的实现原理
  3. 开通快手磁力金牛遇到这些问题怎么解决?
  4. SEO外链的精华是神马?
  5. Git图形界面的使用
  6. easyexcel一个模板动态多个sheet填充
  7. 长沙理工大学计算机学院导师,长沙理工大学计算机与通信工程学研究生导师基本信息表...
  8. ROS与移动底盘通信
  9. 理解逻辑回归中的ROC曲线和KS值
  10. c语言switch case 空,switch语句中case为空时的意义