-2

I'm wondering if anybody has developed a Renderscript Program that runs on GPU. I've tried some simple implementations, like doing IntrinsicBlur via RS but it turned out that it runs on CPU rather than GPU.

PKUEcho
  • 51
  • 5

1 Answers1

1

Intrinsics will always run on the processor that will do them the fastest. If it is running on the CPU, that means that the GPU is not suitable for running it quickly. Reasons for this might be that the GPU is usually used for drawing the screen (which takes a lot of effort too), and so there isn't additional compute bandwidth there.

Stephen Hines
  • 2,612
  • 1
  • 13
  • 12
  • Thanks for your comments. I understand that it's decided by OS or hardware to run on which processor rather than developers. So do you know which kind of code will on GPU in Nexus 4 or 5? I just tried a lot kinds of code but none of them worked. They all run on CPU. – PKUEcho Jan 07 '16 at 10:00
  • Write some user scripts instead of using the intrinsics. There are very few accelerated intrinsics on N4/N5, because the GPUs are pretty anemic (and already overloaded for graphics work). We have great examples in https://android.googlesource.com/platform/frameworks/rs/+/master/java/tests/ImageProcessing/ that can be run on plenty of GPUs (N5/N6/N7/N9/N10/N5x/N6p). – Stephen Hines Jan 07 '16 at 19:26
  • Hello Stephen. I tried that ImageProcessing application as you recommended. I click the button "Benchmark All" but I saw no GPU workloads. This is really weird as I saw many people mentioned their applications did run on GPU. Do you have any idea what's wrong with my testing? What I can do with this? – PKUEcho Jan 14 '16 at 05:52
  • What device are you using? Nexus devices ship with GPGPU drivers, but not every other device does. – Stephen Hines Jan 14 '16 at 15:21
  • Sorry I made a mistake. I checked the CPU usage and it's quite high around 70%, which made me believe it run on CPU rather than GPU. I just checked the GPU workloads and I now believe some scripts do run on GPU. Thanks again for your comments. – PKUEcho Jan 15 '16 at 07:19