ZHIYUAN (ZOE) LIN
  • Home
  • Academic Notes
  • Thoughts
  • Chinese

Using (scala) CUDA in Spark(1) -- based on JCuda

11/9/2015

1 Comment

 
Many people want to leverage CUDA for some scala (machine learning) code. But cuda doesn't support scala TAT. 
Hope never ends! We can always try the following approaches:
1. Leverage libraries like ScalaCL (Scala & OpenCL). (though someone said it won't scale, suspicious:-(
2. Use Scala as the front end and write CUDA backend in C++. Then build the scala-c++ interface (wrapper) automatically by SWIG.
3. Find a Java-based library, then call it from Scala. (I think this is the easiest way, and I will discuss this in details in my next post)
Scala is compatible with Java:
-The standard backend Scala is Java VM. Scala classes are Java classes, and vice versa. You can call the methods of either language from methods in the other one. You can extend Java classes in Scala, and vice versa.
-Scala classes become same-named Java classes. Scala classes can subclass Java classes, you can instantiate Java classes in Scala.
-The main limitation is that some Scala features do not have equivalent in Java. Accessing Java classes from Scala is no problem at all, while using a Scala class from Java can be tricky.
4. Breeze author David also has a github project on cuda binding in scala. 

scala-jcuda example: a problematic one  another  scalalab
1 Comment
Judy Romero link
5/18/2022 12:40:16

Thanks for posting thhis

Reply



Leave a Reply.

    Categories

    All
    Artificial Intelligence
    GPU Programming
    Paper Review
    Scala
    Spark

    Archives

    December 2015
    November 2015
    October 2015
    September 2015
    August 2015

    RSS Feed

                                                                                                                   © 2015 Zhiyuan Lin Reserved