Jimmy Ren
Jimmy Ren

Reputation: 397

Renderscript with rs_allocation array can't run on GPU

My dev env is as follows:

Device: Nexus 5
Android: 4.4.2
SDK Tools: 22.6.1
Platform Tools: 19.0.1
Build tools: 19.0.3
Build Target: level 19
Min Target: level 19

The problem is when I try to put rs_allocation arrays in .rs file such as

rs_allocation[3] allocs

in a .rs file, everything seems fine, it's compiles, java glue code is properly generated, code runs correctly. Just I found the code will always end up running in CPU instead of GPU (told by CPU usage). If I don't use rs_allocation array and use rs_allocation directly, the code runs on GPU. I'm wondering if this is a current limitation. Or am I missing something? Thank you.

Upvotes: 0

Views: 260

Answers (1)

Tim Murray
Tim Murray

Reputation: 2205

yeah, this is not unexpected. depending on how allocations are read, GPU drivers may have issues with this. for example, arrays of textures weren't supported on NV GPUs with CUDA for years--I think not until Fermi. it will vary based on the vendor, chip, and driver revision.

Upvotes: 1

Related Questions