Posted on

CUDA like API in Honeycomb!!


Android 3.0 (Honeycomb) is Introducing a new Scripting language called as Renderscript. Lets see what it is.

Renderscript is a new API targeted at high-performance 3D rendering and compute operations. The goal of Renderscript is to bring a lower level, higher performance API to Android developers. The target audience is the set of developers looking to maximize the performance of their applications and are comfortable working closer to the metal to achieve this.

It provides the developer three primary tools:

  • A simple 3D rendering API on top of hardware acceleration,
  • a developer friendly compute API similar to CUDA (NVIDIA),
  • and a language adhering the C99 standard.

Renderscript has been used in the creation of the new visually-rich YouTube and Books apps.

What will be the Performance?

The performance gain comes from executing native code on the device. However, unlike the existing NDK, this solution is cross-platform. The development language for Renderscript is C99 with extensions, which is compiled to a device-agnostic intermediate format during the development process and placed into the application package. When the app is run, the scripts are compiled to machine code and optimized on the device. This eliminates the problem of needing to target a specific machine architecture during the development process.

GPU or CPU???

It may seem interesting that nothing above talked about running code on CPUs vs. GPUs. The reason is that this decision is made on the device at runtime. Simple scripts will be able to run on the GPU as compute workloads when capable hardware is available. More complex scripts will run on the CPU(s). The CPU also serves as a fallback to ensure that scripts are always able to run even if a suitable GPU or other accelerator is not present. This is intended to be transparent to the developer. In general, simpler scripts will be able to run in more places in the future. For now we simply leverage the CPU resources and distribute the work across as many CPUs as are present in the device.

Renderscript compute in action on Android Tablet

Full Article here.

Advertisements

About GPUToaster

https://gputoaster.wordpress.com/about

One response to “CUDA like API in Honeycomb!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s