Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:57:15+00:00 2026-06-15T19:57:15+00:00

I am trying to get a simple renderscript function to take two numnbers, add

  • 0

I am trying to get a simple renderscript function to take two numnbers, add them and return the result, however I have not managed to find an example project to do that smoothly.
I keep getting a weird error when I try to load the file:

ScriptC_myexamplescript myScript;
RenderScript rs = RenderScript.create(this);

I get the error:

Symbol not found: .rs.dtor  on the next line:
myScript = new ScriptC_myexamplescript(rs, getResources(), R.raw.myexamplescript);

My .rs file is just something simple:

#pragma version(1)
#pragma rs java_package_name(com.exercise.<my pacakge name>);

void init(){

}

void root(const float *v_in, float *v_out) {

   const float *data = v_in;
   float *outData = v_out;
   *outData = *data;    

}

Does anyone know what this means, or if there is a simple project I can download for Android ICS and later that does maths, not actual rendering that just works?

(I can get a rendering script file to work, but that isn’t what I want. I don’t want any graphics in it)

EDIT
Today I have tried to make it run, and get the following problem:

Allocation mInAllocation = null;
Allocation mOutAllocation;

float[] A = new float[1];
for (int i = 0; i < 1; i++) {
A[i] = 2;
}



Allocation inFloatPointer = Allocation.createSized(rs, Element.F32(rs), A.length, Allocation.USAGE_SCRIPT);
Allocation outFloatPointer = Allocation.createSized(rs, Element.F32(rs), A.length, Allocation.USAGE_SCRIPT);  
inFloatPointer.copyFrom(A); // copies from an array of floats (random numbers in this test case).
mScript.forEach_root(inFloatPointer, outFloatPointer);            

I get the error message:
the method forEach_root is undedifed for type ScriptC_RenderScript
There is no function forEach_root in the .java file and even after I clean the project it still is not there.

Is there a simple project I can download with just a maths function I can download?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:57:16+00:00Added an answer on June 15, 2026 at 7:57 pm

    Are you sure that there is indeed an error here? I believe you are just seeing extra verbose logging information. Can you post the exact logcat (or Java exception trace)? Note that if you actually want to execute your function, you will need to create an input and output allocation and then call “myScript.forEach_root(input, output);” in order to have it execute the root() function on each cell of input/output. When that is done, you can read the results back from the output allocation and use them from Java.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i am trying to get a simple system working where i have an
I have been struggling all afternoon trying to get a simple mailto: tag to
Trying to get a simple test perl script working. Have the following files/folder structure
Just trying to get simple http server running and have no clue about ruby
I have been trying to get simple YES/NO radio buttons list working but facing
I have been trying to get a simple networking test program to run with
I'm trying to get a simple sort function going using anonymous functions. One each
I am trying to get a simple page up that will have four links
I'm trying to get a simple true/false json return from a JsonAction, but it
I am trying get my first simple project in rails to run. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.