How to implement efficient sorting algorithms for multiple processors in Scala? Here's the link for radix algorithm in GPU:
-
Do you want Scala to see how to compete with the GPU solution, or to try to implement it on the processor in Scala, or to have Scala be able to access the GPU in the implementation?James Black– James Black2009-11-09 00:20:08 +00:00Commented Nov 9, 2009 at 0:20
-
I'm trying to implement it on the processor in Scala.Roman Kagan– Roman Kagan2009-11-09 10:27:57 +00:00Commented Nov 9, 2009 at 10:27
1 Answer
Use scala.actors.Futures. It isn't a good solution, because you are talking about parallel computation, not concurrent computation, and Futures is aimed at the latter, not the former.
Things like parallel arrays that are coming with Java 7 and a later (not 2.8) version of Scala are more appropriate for parallel algorithms.
Just explaining, a parallel algorithm is one which does the same computation on multiple processing units. It is easy to see that each of which runs the same code. A concurrent computation is one in which each processing unit is running a potentially different code.
Also related, in parallel algorithms, the code being run doesn't change, only the data. In concurrent computation you have code changing constantly.
By the way, though that is not what you are asking, let me state that there's a library for Scala to run OpenCL code (ie, run computation on GPU). It's called ScalaCL.