Do Accelerate and Repa have different use cases?

落爺英雄遲暮 提交于 2019-12-03 10:15:28

Repa is a library for efficient array construction and traversal, programmed in Haskell and run in the Haskell runtime. Repa relies on GHC's optimizer and threads for performance. You can mix arbitrary Haskell code with Repa (Repa functions such as map take Haskell functions as parameters).

Accelerate is an embedded language for GPU programming. Accelerate relies on its own compiler and GPU parallelism for performance. A piece of code using the Accelerate library doesn't actually do array computation. It generates an Accelerate program, which is processed by Accelerate's own compiler to generate the code that actually processes your array data.

If you want to program GPUs in Haskell, Accelerate is the primary option. If you want your code to run on CPUs, Repa is the way to go. Accelerate doesn't generate multicore code. It's architected in a way that could support another target, but as far as I can tell, the motivation to support CPUs with Accelerator is low because there's more competition.

Edit: Obsidian and Nikola are alternatives for GPU programming. From a brief investigation of the documentation, Obsidian seems narrower in scope; it can express pipelines in the form (f >=> g >=> h). Nikola's feature set appears to be closer to Accelerate's. I don't have the experience to really compare them.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!