Note that there are some explanatory texts on larger screens.

plurals
  1. POData transfer between rs and android?
    primarykey
    data
    text
    <p>i am working with render script. i want to pass elements of an array to render script and want to perform the squaring of each element in render script and get back the data to android frame work.</p> <p>I am trying to do this by following codes .</p> <p>1.java code 2.RS code</p> <p>But via these code this thing is not possible.will u plz tell me what r errors i m doing with these codes.</p> <p>============================================================================</p> <h1>java code</h1> <pre><code> public class SUM extends Activity { private int[] input; private int[] output; private RenderScript mRS; private Allocation mInAllocation; private Allocation mOutAllocation; private ScriptC_Sum mScript; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); input= new int[4]; input[0]=0; input[1]=1; input[2]=2; input[3]=3; output =new int[4]; createScript(); } private void createScript() { mRS = RenderScript.create(this); mInAllocation = Allocation.createSized(mRS, Element.U32(mRS),4); mOutAllocation = Allocation.createTyped(mRS,mInAllocation.getType()); mScript = new ScriptC_Sum(mRS, getResources(), R.raw.sum); mScript.bind_v_in(mInAllocation); mScript.bind_v_out(mOutAllocation); mScript.invoke_square(mInAllocation,mOutAllocation); } } </code></pre> <p>=========================================================== RS CODE</p> <pre><code>#pragma version(1) #pragma rs java_package_name(com.cdacb.mars.summation) #include "rs_types.rsh" #include "rs_graphics.rsh" #include "rs_core.rsh" int32_t *v_in ; int32_t *v_out; void square(){ } void root(int32_t *v_in,int32_t *v_out ) { square(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload