Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pure functional programming to the GPU [closed]

I've been wanting to play around with functional code, and thought what fun it would be to do some interactive real-time ray-tracing of some randomly composed functions. Does anyone know of any compiler or converter that can take code from a functional language (or any language, with high order functions) and convert it into something that can be used in CUDA or OpenCL?

like image 355
clinux Avatar asked Sep 20 '12 09:09

clinux


3 Answers

There are several embedded languages in Haskell that target CUDA and/or OpenCL.

The most high level is accelerate, a subset of Haskell for array processing, embedded in Haskell. It works with CUDA.

Conal Elliott has a shader language embedded in Haskell, for graphics programming

like image 160
Don Stewart Avatar answered Oct 13 '22 02:10

Don Stewart


There are several embedded languages in Haskell that target CUDA and/or OpenCL.

The most high level is accelerate, a subset of Haskell for array processing, embedded in Haskell. It works with CUDA.

Conal Elliott has a shader language embedded in Haskell, for graphics programming

like image 37
Don Stewart Avatar answered Oct 13 '22 02:10

Don Stewart


There are some attempts, such as Obsidian (Haskell) and SaC (Single Assignment C).

More about this and some other attempts are described in this paper: Functional Programming for High-Performance Computing on Heterogeneous Architectures

like image 45
Peladao Avatar answered Oct 13 '22 02:10

Peladao