2010年1月3日日曜日

Java から GPU へのブリッジ

 Java から GPU のカーネルをユーザー透過に呼び出す仕組みがいずれ出てくるだろうと思っていたが、2009年の Europar という国際学会で発表されていたようだ。
Java プログラムから CUDA のカーネルを呼び出すように記述すると、プリプロセッサが自動的に Java と CUDA のブリッジコード(データ転送も含む)を生成する。どちらにしても、JNI コールを使っていると思われ、オーバーヘッドは存在するだろうが、ターゲットアプリケーションは無視できるのであろう。
A recent trend in mainstream desktop systems is the use of general-purpose graphics processor units (GPGPUs) to obtain order-of-magnitude performance improvements. CUDA has emerged as a popular programming model for GPGPUs for use by C/C++ programmers. Given the widespread use of modern object-oriented languages with managed runtimes like Java and C#, it is natural to explore how CUDA-like capabilities can be made accessible to those programmers as well. In this paper, we present a programming interface called JCUDA that can be used by Java programmers to invoke CUDA kernels. Using this interface, programmers can write Java codes that directly call CUDA kernels, and delegate the responsibility of generating the Java-CUDA bridge codes and host-device data transfer calls to the compiler. Our preliminary performance results show that this interface can deliver significant performance improvements to Java programmers. For future work, we plan to use the JCUDA interface as a target language for supporting higher level parallel programming languages like X10 and Habanero-Java.

0 件のコメント:

コメントを投稿