Search code examples
androidgpurenderscript

Is it possible to program GPU for Android


I am now programming on Android and I wonder whether we can use GPGPU for Android now? I once heard that Renderscript can potentially execute on GPGPU in the future. But I wonder whether it is possible for us to programming on GPGPU now? And if it is possible for me to program on the Android GPGPU, where can I find some tutorials or sample programs? Thank you for your help and suggestions.

Up till now I know that the OpenGL ES library was now accelerated use GPU, but I want to use the GPU for computing. What I want to do is to accelerate computing so that I hope to use some libraries of APIs such as OpenCL.


Solution

  • 2021-April Update

    Google has announced deprecation of the RenderScript API in favor of Vulkan with Android 12.

    The option for manufacturers to include the Vulkan API was made available in Android 7.0 Compatibility Definition Document - 3.3.1.1. Graphic Libraries.

    Original Answer

    Actually Renderscript Compute doesn't use the GPU at this time, but is designed for it

    From Romain Guy who works on the Android platform:

    • Renderscript Compute is currently CPU bound but with the for_each construct it will take advantage of multiple cores immediately
    • Renderscript Compute was designed to run on the GPU and/or the CPU
    • Renderscript Compute avoids having to write JNI code and gives you architecture independent, high performance results
    • Renderscript Compute can, as of Android 4.1, benefit from SIMD optimizations (NEON on ARM)

    https://groups.google.com/d/msg/android-developers/m194NFf_ZqA/Whq4qWisv5MJ