#include "RenderScript.h" #include "ScriptC_sql1.h" using namespace android; using namespace RSC; int main(int argc, char **argv) { sp rs = new RS(); bool status = rs->init(); sp dataElement1 = Element::I32_4(rs); sp dataElement2 = Element::I32_4(rs); Type::Builder tb(ts, dataElement1); tb.setX(100000/4); sp t = tb.create(); sp data1 = Allocation::createSized(rs, dataElement1, 100000/4); sp data2 = Allocation::createSized(rs, dataElement2, 100000/4); sp data1in = Allocation::createTyped(rs, t); sp data2in = Allocation::createTyped(rs, t); /* this seems sub-optimal ?? */ ScriptC_sql1 *sc = new ScriptC_sql1(rs); /* make up some data */ int *buf = new int[t->getCount()]; for (int ct=0; ct < t->getCount(); ct++) { buf[ct] = 90; } /* copy from column */ data1in->copy1DRangeFrom(0, t->getCount(), buf); for (int ct=0; ct < t->getCount(); ct++) { buf[ct] = -7; } data2in->copy1DRangeFrom(0, t->getCount(), buf); sc->forEach_x2_root(data1in, data2in, maskOut); rs->finish(); delete sc; return 0; }