Steve Ng
Steve Ng

Reputation: 1189

Android Renderscript for CPU computation

Firstly, I read that there's a possibility of using renderscript for compute task on nexus 10 at http://android-developers.blogspot.sg/2013/01/evolution-of-renderscript-performance.html

I was wondering if anyone has tried it out, does it help in computationally intensive algorithm such as N-Queen? Or does it only work on algorithms that can be splited into many small tasks to make use of GPU cores.

Secondly for Renderscript allocation, are they usable for only mainly graphics? API at http://developer.android.com/reference/android/renderscript/Allocation.html

Is there any chance that I can pass an array of integer over to the script?

Upvotes: 0

Views: 313

Answers (1)

Tim Murray
Tim Murray

Reputation: 2205

It probably depends on how you implement n-queens. We support recursion, but you'd need to split your task into some reasonable number of subtasks such that we could parallelize it over multiple cores (or on a GPU).

To pass an array of integers to RenderScript, create an Allocation of the appropriate size with Element.I32, then copy the array to the Allocation.

Upvotes: 2

Related Questions