Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there functional programming languages that run on the GPU?

Using the traditional, sequential reduction approach, the following graph is reduced as:

(+ (+ 1 2) (+ 3 4)) ->
(+ 3 (+ 3 4)) ->
(+ 3 7) ->
10

Graph reductions are, though, inherently parallel. One could, instead, reduce it as:

(+ (+ 1 2) (+ 3 4)) ->
(+ 3 7) ->
10

As far as I know, every functional programming language uses the first approach. I believe this is mostly because, on the CPU, scheduling threads overcompensate the benefits of doing parallel reductions. Recently, though, we've been starting to use the GPU more than the CPU for parallel applications. If a language ran entirely on the GPU, those communication costs would vanish.

Are there functional languages making use of that idea?

like image 682
MaiaVictor Avatar asked Feb 05 '14 16:02

MaiaVictor


People also ask

Which programming language uses GPU?

GPU Accelerated Computing with C and C++ Using the CUDA Toolkit you can accelerate your C or C++ applications by updating the computationally intensive portions of your code to run on GPUs.

Which programming language is used in Nvidia?

ISO Fortran Just as with ISO C++, NVIDIA has been working with application developers to use standard language parallelism in Fortran to modernize their applications and make them parallel-first.

Is functional programming language still used?

Many functional programming languages are in use today in many industries. There are many other programming languages that support functional programming or implement such features. It is widely used in some specific domains such as the web, statistics, financial analysis, machine learning, and so on.


1 Answers

What makes you think on GPU scheduling would not overcomponsate the benefits?

In fact, the kind of parallelism used in GPUs is far harder to schedule: it's SIMD parallelism, i.e. a whole batch of stream processors do all essentially the same thing at a time, except each one crushes a different bunch of numbers. So, not only would you need to schedule the subtasks, you would also need to keep them synchronised. Doing that automatically for general computations is virtually impossible.

Doing it for specific tasks works out quite well and has been embedded into functional languages; check out the Accelerate project.

like image 132
leftaroundabout Avatar answered Oct 27 '22 13:10

leftaroundabout