View All Fusion Blogs

Java Meets the APU

by Margaret Lewis

A New Era of Software Development with the GPU

Lately I have been talking to a lot of multimedia and web developers.  When they hear about GPU computing and our upcoming AMD Fusion Accelerated Processing unit (APU) family, which puts CPU and GPU cores on the same die, they inevitably start to get excited about the possibilities.  Then come the questions.  Where do I start?  What are the best tools for developing code that leverages the computational capabilities of the GPU?  Where can I go to learn more?

A limitation of GPU computing to Java developers is the fact that you cannot execute Java code directly on the GPU. To access the GPU, code must be created in a C-like language called OpenCL C, which is part of the OpenCL specification.  While OpenCL C provides an excellent environment for creating code that can execute on both the CPU and GPU, it takes the Java developer outside of his familiar world.

Recently at the JavaOne event, my colleague Gary Frost unveiled a project that can enable Java developers to more easily take advantage of the world of GPU compute.  With the alpha release of Aparapi (A PARallel API) AMD is showcasing the potential of using the GPU to help improve the performance of numerically intense data parallel compute workloads.  The inherent goal of Java’s “write once, run anywhere” programming model is extended beyond crossing over multiple operating systems to now include crossing over multiple different processing units. 

Specifically, AMD’s Aparapi is an API for expressing data parallel workloads in Java, which will allow these workloads to be optionally executed on a GPU device. Whether the workload is executed on the GPU will depend on the specific platform (whether OpenCL is available for example) and on the nature of the code (some Java capabilities cannot be offloaded).  If the workload cannot be executed on the GPU the code will execute using a traditional Java thread pool on the CPU. 

The main advantage of Aparapi over existing Java OpenCL bindings is that the developer writes their code once in Java and at runtime Aparapi decides whether the code can be executed on the GPU or not.

But that only answers half the question; and you likely still want to know where developers can go to learn more.  AMD Developer Central’s OpenCL Zone is an excellent resource and a good starting point.  We have introductory tutorials and some great reference material there.  In fact, there’s even some video content from our OpenCL experts.  We’ll also continue to add examples, updates and tutorials on Aparapi at developer.amd.com in the Java Zone.  Finally, check out Gary’s interview with InfoQ after the JavaOne event. 

OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.

Margaret Lewis (@margaretjlewis) is a Product Marketing Director at AMD. Her postings are her own opinions and may not represent AMD’s positions, strategies or opinions. Links to third party sites are provided for convenience and unless explicitly stated, AMD is not responsible for the contents of such linked sites and no endorsement is implied.

SHARE: twitter stumble upon delicious facebook

COMMENTS: 1

1 Comment

  • wwyc October 25, 2010

    Hi there,

    After this API is out of beta and is ready for production environment, will AMD try to push this into one of the JSR’s? I meant, having a Java API that can make use of GPU’s power is great. But I don’t think it will be useful and popular if it does not comes with the Java VM. Not many end-user is willing to download another file to enable something as most people has this, “If it ain’t break, don’t fix it,” attitude toward computers.

    wwyc

Submit a Comment

Connect with Facebook

Reminder about Comments:

All comments will be moderated by AMD before they are published. Unrelated comments or requests for support will not be published. Please post your technical questions in the AMD Forums or for drivers and other support resources visit AMD Support. By submitting a comment, you are agreeing to AMD Terms and Conditions.