Multi-core Android

后端 未结 2 1981
北海茫月
北海茫月 2021-01-03 03:04

I have run simple parallel algorithm drawing the mandelbrot set to test parallel computations on a Nexus 7 (Tegra 3, 4+1 cores). After running several times I get 1.5 secon

2条回答
  •  半阙折子戏
    2021-01-03 03:27

    This sounds like a candidate for RenderScript. In a nutshell, it allows you to do computationally expensive operations that take advantage of all available acceleration resources (multiple cores, GPU compute, dsp, etc). From the docs:

    Renderscript gives your apps the ability to run operations with automatic parallelization across all available processor cores. It also supports different types of processors such as the CPU, GPU or DSP. Renderscript is useful for apps that do image processing, mathematical modeling, or any operations that require lots of mathematical computation.

    You'd have to rewrite your Mandelbrot code in C, but you won't have to break it apart into pieces since parallelization will be taken care of for you.

    Using RenderScript from Android code is straightforward as described here.

提交回复
热议问题