我在使用Renderscript时遇到了一些问题。我做了一些测试,以评估Renderscript GPU计算的性能。我使用了ImageProcessing Renderscript Benchmark(android / platform / frameworks / rs / java / tests / ImageProcessing)。我还使用了" adb shell setprop debug.rs.default-CPU-driver 1"强制脚本在CPU上运行。
获得的执行时间是:
GPU CPU
Test Levels Vec3 Relaxed 13.594595ms 13.413333ms
Test Levels Vec4 Relaxed 14.4ms 14.027778ms
Test Levels Vec3 Full 14.594203ms 15.0ms
Test Levels Vec4 Full 15.227273ms 15.242424ms
Test Blur radius 25 388.0ms 379.66666ms
Test Intrinsic Blur radius 25 52.842106ms 52.1ms
Test Greyscale 13.302631ms 13.493333ms
Test Grain 136.25ms 137.5ms
Test Fisheye Full 57.61111ms 59.235294ms
Test Fisheye Relaxed 59.764706ms 57.055557ms
Test Fisheye Approximate Full 54.473682ms 58.555557ms
Test Fisheye Approx Relaxed 58.555557ms 55.833332ms
Test Vignette Full 28.885714ms 27.86111ms
Test Vignette Relaxed 29.028572ms 28.166666ms
Test Vignette Approximate Full 22.288889ms 21.680851ms
Test Vignette Approx Relaxed 21.553192ms 21.76087ms
Test Group Test (emulated) 6.4166665ms 6.429487ms
Test Group Test (native) 6.335443ms 6.3757963ms
Test Convolve 3x3 38.653847ms 39.423077ms
Test Intrinsics Convolve 3x3 4.2777777ms 4.3608694ms
...
CPU和GPU执行没有任何差异。看起来S6设备总是选择CPU而不是GPU。我在其他设备上执行了相同的测试,GPU执行速度比CPU快。
ARM mali Renderscript驱动程序是否包含在S6设备中?