Combine RS kernels in a single Script.

Change-Id: Ib9cf2194a8f2e52086f1ca22004fb7ab296e27b6
diff --git a/tests/src/android/renderscript/cts/fe_all.rs b/tests/src/android/renderscript/cts/fe_all.rs
new file mode 100644
index 0000000..419d3d5
--- /dev/null
+++ b/tests/src/android/renderscript/cts/fe_all.rs
@@ -0,0 +1,174 @@
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+void test_i8(const char *ain, uchar *aout) {
+    aout[0] = ain[0] + 1;
+    return;
+}
+
+void test_i8_2(const char2 *ain, uchar2 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    return;
+}
+
+void test_i8_3(const char3 *ain, uchar3 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    return;
+}
+
+void test_i8_4(const char4 *ain, uchar4 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    aout[0].w = ain[0].w + 1;
+    return;
+}
+
+void test_i16(const short *ain, ushort *aout) {
+    aout[0] = ain[0] + 1;
+    return;
+}
+
+void test_i16_2(const short2 *ain, ushort2 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    return;
+}
+
+void test_i16_3(const short3 *ain, ushort3 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    return;
+}
+
+void test_i16_4(const short4 *ain, ushort4 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    aout[0].w = ain[0].w + 1;
+    return;
+}
+
+void test_i32(const int *ain, uint *aout) {
+    aout[0] = ain[0] + 1;
+    return;
+}
+
+void test_i32_2(const int2 *ain, uint2 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    return;
+}
+
+void test_i32_3(const int3 *ain, uint3 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    return;
+}
+
+void test_i32_4(const int4 *ain, uint4 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    aout[0].w = ain[0].w + 1;
+    return;
+}
+
+void test_i64(const long *ain, ulong *aout) {
+    aout[0] = ain[0] + 1;
+    return;
+}
+
+void test_i64_2(const long2 *ain, ulong2 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    return;
+}
+
+void test_i64_3(const long3 *ain, ulong3 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    return;
+}
+
+void test_i64_4(const long4 *ain, ulong4 *aout) {
+    aout[0].x = ain[0].x + 1;
+    aout[0].y = ain[0].y + 1;
+    aout[0].z = ain[0].z + 1;
+    aout[0].w = ain[0].w + 1;
+    return;
+}
+
+void test_f32(const float *ain, float *aout) {
+    aout[0] = ain[0] + 1.0f;
+    return;
+}
+
+void test_f32_2(const float2 *ain, float2 *aout) {
+    aout[0].x = ain[0].x + 1.0f;
+    aout[0].y = ain[0].y + 1.0f;
+    return;
+}
+
+void test_f32_3(const float3 *ain, float3 *aout) {
+    aout[0].x = ain[0].x + 1.0f;
+    aout[0].y = ain[0].y + 1.0f;
+    aout[0].z = ain[0].z + 1.0f;
+    return;
+}
+
+void test_f32_4(const float4 *ain, float4 *aout) {
+    aout[0].x = ain[0].x + 1.0f;
+    aout[0].y = ain[0].y + 1.0f;
+    aout[0].z = ain[0].z + 1.0f;
+    aout[0].w = ain[0].w + 1.0f;
+    return;
+}
+
+void test_f64(const double *ain, double *aout) {
+    aout[0] = ain[0] + 1.0;
+    return;
+}
+
+void test_f64_2(const double2 *ain, double2 *aout) {
+    aout[0].x = ain[0].x + 1.0;
+    aout[0].y = ain[0].y + 1.0;
+    return;
+}
+
+void test_f64_3(const double3 *ain, double3 *aout) {
+    aout[0].x = ain[0].x + 1.0;
+    aout[0].y = ain[0].y + 1.0;
+    aout[0].z = ain[0].z + 1.0;
+    return;
+}
+
+void test_f64_4(const double4 *ain, double4 *aout) {
+    aout[0].x = ain[0].x + 1.0;
+    aout[0].y = ain[0].y + 1.0;
+    aout[0].z = ain[0].z + 1.0;
+    aout[0].w = ain[0].w + 1.0;
+    return;
+}
+
+struct fe_test {
+    int i;
+    float f;
+};
+
+void test_struct(const struct fe_test *ain, struct fe_test *aout) {
+    aout[0].i = ain[0].i + 1;
+    aout[0].f = ain[0].f + 1.0f;
+    return;
+}
+
+void test_bool(const bool *ain, bool *aout) {
+    aout[0] = !ain[0];
+    return;
+}
diff --git a/tests/src/android/renderscript/cts/fe_bool.rs b/tests/src/android/renderscript/cts/fe_bool.rs
deleted file mode 100644
index 727635a..0000000
--- a/tests/src/android/renderscript/cts/fe_bool.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const bool *ain, bool *aout) {
-    aout[0] = !ain[0];
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f32.rs b/tests/src/android/renderscript/cts/fe_f32.rs
deleted file mode 100644
index 3c649e2..0000000
--- a/tests/src/android/renderscript/cts/fe_f32.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const float *ain, float *aout) {
-    aout[0] = ain[0] + 1.0f;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f32_2.rs b/tests/src/android/renderscript/cts/fe_f32_2.rs
deleted file mode 100644
index 571100b..0000000
--- a/tests/src/android/renderscript/cts/fe_f32_2.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const float2 *ain, float2 *aout) {
-    aout[0].x = ain[0].x + 1.0f;
-    aout[0].y = ain[0].y + 1.0f;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f32_3.rs b/tests/src/android/renderscript/cts/fe_f32_3.rs
deleted file mode 100644
index 1df67a7..0000000
--- a/tests/src/android/renderscript/cts/fe_f32_3.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const float3 *ain, float3 *aout) {
-    aout[0].x = ain[0].x + 1.0f;
-    aout[0].y = ain[0].y + 1.0f;
-    aout[0].z = ain[0].z + 1.0f;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f32_4.rs b/tests/src/android/renderscript/cts/fe_f32_4.rs
deleted file mode 100644
index 50a50ec..0000000
--- a/tests/src/android/renderscript/cts/fe_f32_4.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const float4 *ain, float4 *aout) {
-    aout[0].x = ain[0].x + 1.0f;
-    aout[0].y = ain[0].y + 1.0f;
-    aout[0].z = ain[0].z + 1.0f;
-    aout[0].w = ain[0].w + 1.0f;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f64.rs b/tests/src/android/renderscript/cts/fe_f64.rs
deleted file mode 100644
index b609a08..0000000
--- a/tests/src/android/renderscript/cts/fe_f64.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const double *ain, double *aout) {
-    aout[0] = ain[0] + 1.0;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f64_2.rs b/tests/src/android/renderscript/cts/fe_f64_2.rs
deleted file mode 100644
index a97628b..0000000
--- a/tests/src/android/renderscript/cts/fe_f64_2.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const double2 *ain, double2 *aout) {
-    aout[0].x = ain[0].x + 1.0;
-    aout[0].y = ain[0].y + 1.0;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f64_3.rs b/tests/src/android/renderscript/cts/fe_f64_3.rs
deleted file mode 100644
index b6e97b8..0000000
--- a/tests/src/android/renderscript/cts/fe_f64_3.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const double3 *ain, double3 *aout) {
-    aout[0].x = ain[0].x + 1.0;
-    aout[0].y = ain[0].y + 1.0;
-    aout[0].z = ain[0].z + 1.0;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_f64_4.rs b/tests/src/android/renderscript/cts/fe_f64_4.rs
deleted file mode 100644
index 959c30b..0000000
--- a/tests/src/android/renderscript/cts/fe_f64_4.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const double4 *ain, double4 *aout) {
-    aout[0].x = ain[0].x + 1.0;
-    aout[0].y = ain[0].y + 1.0;
-    aout[0].z = ain[0].z + 1.0;
-    aout[0].w = ain[0].w + 1.0;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i16.rs b/tests/src/android/renderscript/cts/fe_i16.rs
deleted file mode 100644
index e45a0a8..0000000
--- a/tests/src/android/renderscript/cts/fe_i16.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const short *ain, ushort *aout) {
-    aout[0] = ain[0] + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i16_2.rs b/tests/src/android/renderscript/cts/fe_i16_2.rs
deleted file mode 100644
index 8eb8245..0000000
--- a/tests/src/android/renderscript/cts/fe_i16_2.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const short2 *ain, ushort2 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i16_3.rs b/tests/src/android/renderscript/cts/fe_i16_3.rs
deleted file mode 100644
index 09113a5..0000000
--- a/tests/src/android/renderscript/cts/fe_i16_3.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const short3 *ain, ushort3 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i16_4.rs b/tests/src/android/renderscript/cts/fe_i16_4.rs
deleted file mode 100644
index 4a5ca2c..0000000
--- a/tests/src/android/renderscript/cts/fe_i16_4.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const short4 *ain, ushort4 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    aout[0].w = ain[0].w + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i32.rs b/tests/src/android/renderscript/cts/fe_i32.rs
deleted file mode 100644
index 402a1f7..0000000
--- a/tests/src/android/renderscript/cts/fe_i32.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const int *ain, uint *aout) {
-    aout[0] = ain[0] + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i32_2.rs b/tests/src/android/renderscript/cts/fe_i32_2.rs
deleted file mode 100644
index bff5460..0000000
--- a/tests/src/android/renderscript/cts/fe_i32_2.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const int2 *ain, uint2 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i32_3.rs b/tests/src/android/renderscript/cts/fe_i32_3.rs
deleted file mode 100644
index ce666c0..0000000
--- a/tests/src/android/renderscript/cts/fe_i32_3.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const int3 *ain, uint3 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i32_4.rs b/tests/src/android/renderscript/cts/fe_i32_4.rs
deleted file mode 100644
index ab66082..0000000
--- a/tests/src/android/renderscript/cts/fe_i32_4.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const int4 *ain, uint4 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    aout[0].w = ain[0].w + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i64.rs b/tests/src/android/renderscript/cts/fe_i64.rs
deleted file mode 100644
index 352a48e..0000000
--- a/tests/src/android/renderscript/cts/fe_i64.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const long *ain, ulong *aout) {
-    aout[0] = ain[0] + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i64_2.rs b/tests/src/android/renderscript/cts/fe_i64_2.rs
deleted file mode 100644
index f39531d..0000000
--- a/tests/src/android/renderscript/cts/fe_i64_2.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const long2 *ain, ulong2 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i64_3.rs b/tests/src/android/renderscript/cts/fe_i64_3.rs
deleted file mode 100644
index 1229137..0000000
--- a/tests/src/android/renderscript/cts/fe_i64_3.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const long3 *ain, ulong3 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i64_4.rs b/tests/src/android/renderscript/cts/fe_i64_4.rs
deleted file mode 100644
index 5e2b2ae..0000000
--- a/tests/src/android/renderscript/cts/fe_i64_4.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const long4 *ain, ulong4 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    aout[0].w = ain[0].w + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i8.rs b/tests/src/android/renderscript/cts/fe_i8.rs
deleted file mode 100644
index 067ef50..0000000
--- a/tests/src/android/renderscript/cts/fe_i8.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const char *ain, uchar *aout) {
-    aout[0] = ain[0] + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i8_2.rs b/tests/src/android/renderscript/cts/fe_i8_2.rs
deleted file mode 100644
index cec1f57..0000000
--- a/tests/src/android/renderscript/cts/fe_i8_2.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const char2 *ain, uchar2 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i8_3.rs b/tests/src/android/renderscript/cts/fe_i8_3.rs
deleted file mode 100644
index 9254ba5..0000000
--- a/tests/src/android/renderscript/cts/fe_i8_3.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const char3 *ain, uchar3 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_i8_4.rs b/tests/src/android/renderscript/cts/fe_i8_4.rs
deleted file mode 100644
index 0c1fd1d..0000000
--- a/tests/src/android/renderscript/cts/fe_i8_4.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-void root(const char4 *ain, uchar4 *aout) {
-    aout[0].x = ain[0].x + 1;
-    aout[0].y = ain[0].y + 1;
-    aout[0].z = ain[0].z + 1;
-    aout[0].w = ain[0].w + 1;
-    return;
-}
diff --git a/tests/src/android/renderscript/cts/fe_struct.rs b/tests/src/android/renderscript/cts/fe_struct.rs
deleted file mode 100644
index b22604d..0000000
--- a/tests/src/android/renderscript/cts/fe_struct.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-struct fe_test {
-    int i;
-    float f;
-};
-
-void root(const struct fe_test *ain, struct fe_test *aout) {
-    aout[0].i = ain[0].i + 1;
-    aout[0].f = ain[0].f + 1.0f;
-    return;
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/ForEachTest.java b/tests/tests/renderscript/src/android/renderscript/cts/ForEachTest.java
index 5adc78a..f633168 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/ForEachTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/ForEachTest.java
@@ -61,418 +61,356 @@
         Type t = new Type.Builder(mRS, Element.I8(mRS)).setX(x).create();
         Allocation badOut = Allocation.createTyped(mRS, t);
 
+        ScriptC_fe_all fe_all = new ScriptC_fe_all(mRS, mRes, R.raw.fe_all);
+
         // I8
-        ScriptC_fe_i8 fe_i8 = new ScriptC_fe_i8(mRS, mRes, R.raw.fe_i8);
         Allocation in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U8(mRS)).setX(x).create();
         Allocation out = Allocation.createTyped(mRS, t);
-        fe_i8.forEach_root(in, out);
+        fe_all.forEach_test_i8(in, out);
         mRS.finish();
         try {
-            fe_i8.forEach_root(in, badOut);
+            fe_all.forEach_test_i8(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I8_2
-        ScriptC_fe_i8_2 fe_i8_2 = new ScriptC_fe_i8_2(mRS,
-                                                      mRes,
-                                                      R.raw.fe_i8_2);
         t = new Type.Builder(mRS, Element.I8_2(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U8_2(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i8_2.forEach_root(in, out);
+        fe_all.forEach_test_i8_2(in, out);
         mRS.finish();
         try {
-            fe_i8_2.forEach_root(in, badOut);
+            fe_all.forEach_test_i8_2(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I8_3
-        ScriptC_fe_i8_3 fe_i8_3 = new ScriptC_fe_i8_3(mRS,
-                                                      mRes,
-                                                      R.raw.fe_i8_3);
         t = new Type.Builder(mRS, Element.I8_3(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U8_3(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i8_3.forEach_root(in, out);
+        fe_all.forEach_test_i8_3(in, out);
         mRS.finish();
         try {
-            fe_i8_3.forEach_root(in, badOut);
+            fe_all.forEach_test_i8_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I8_4
-        ScriptC_fe_i8_4 fe_i8_4 = new ScriptC_fe_i8_4(mRS,
-                                                      mRes,
-                                                      R.raw.fe_i8_4);
         t = new Type.Builder(mRS, Element.I8_4(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U8_4(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i8_4.forEach_root(in, out);
+        fe_all.forEach_test_i8_4(in, out);
         mRS.finish();
         try {
-            fe_i8_4.forEach_root(in, badOut);
+            fe_all.forEach_test_i8_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I16
-        ScriptC_fe_i16 fe_i16 = new ScriptC_fe_i16(mRS, mRes, R.raw.fe_i16);
         t = new Type.Builder(mRS, Element.I16(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U16(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i16.forEach_root(in, out);
+        fe_all.forEach_test_i16(in, out);
         mRS.finish();
         try {
-            fe_i16.forEach_root(in, badOut);
+            fe_all.forEach_test_i16(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I16_2
-        ScriptC_fe_i16_2 fe_i16_2 = new ScriptC_fe_i16_2(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i16_2);
         t = new Type.Builder(mRS, Element.I16_2(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U16_2(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i16_2.forEach_root(in, out);
+        fe_all.forEach_test_i16_2(in, out);
         mRS.finish();
         try {
-            fe_i16_2.forEach_root(in, badOut);
+            fe_all.forEach_test_i16_2(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I16_3
-        ScriptC_fe_i16_3 fe_i16_3 = new ScriptC_fe_i16_3(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i16_3);
         t = new Type.Builder(mRS, Element.I16_3(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U16_3(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i16_3.forEach_root(in, out);
+        fe_all.forEach_test_i16_3(in, out);
         mRS.finish();
         try {
-            fe_i16_3.forEach_root(in, badOut);
+            fe_all.forEach_test_i16_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I16_4
-        ScriptC_fe_i16_4 fe_i16_4 = new ScriptC_fe_i16_4(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i16_4);
         t = new Type.Builder(mRS, Element.I16_4(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U16_4(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i16_4.forEach_root(in, out);
+        fe_all.forEach_test_i16_4(in, out);
         mRS.finish();
         try {
-            fe_i16_4.forEach_root(in, badOut);
+            fe_all.forEach_test_i16_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I32
-        ScriptC_fe_i32 fe_i32 = new ScriptC_fe_i32(mRS, mRes, R.raw.fe_i32);
         t = new Type.Builder(mRS, Element.I32(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U32(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i32.forEach_root(in, out);
+        fe_all.forEach_test_i32(in, out);
         mRS.finish();
         try {
-            fe_i32.forEach_root(in, badOut);
+            fe_all.forEach_test_i32(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I32_2
-        ScriptC_fe_i32_2 fe_i32_2 = new ScriptC_fe_i32_2(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i32_2);
         t = new Type.Builder(mRS, Element.I32_2(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U32_2(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i32_2.forEach_root(in, out);
+        fe_all.forEach_test_i32_2(in, out);
         mRS.finish();
         try {
-            fe_i32_2.forEach_root(in, badOut);
+            fe_all.forEach_test_i32_2(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I32_3
-        ScriptC_fe_i32_3 fe_i32_3 = new ScriptC_fe_i32_3(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i32_3);
         t = new Type.Builder(mRS, Element.I32_3(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U32_3(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i32_3.forEach_root(in, out);
+        fe_all.forEach_test_i32_3(in, out);
         mRS.finish();
         try {
-            fe_i32_3.forEach_root(in, badOut);
+            fe_all.forEach_test_i32_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I32_4
-        ScriptC_fe_i32_4 fe_i32_4 = new ScriptC_fe_i32_4(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i32_4);
         t = new Type.Builder(mRS, Element.I32_4(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U32_4(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i32_4.forEach_root(in, out);
+        fe_all.forEach_test_i32_4(in, out);
         mRS.finish();
         try {
-            fe_i32_4.forEach_root(in, badOut);
+            fe_all.forEach_test_i32_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I64
-        ScriptC_fe_i64 fe_i64 = new ScriptC_fe_i64(mRS, mRes, R.raw.fe_i64);
         t = new Type.Builder(mRS, Element.I64(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U64(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i64.forEach_root(in, out);
+        fe_all.forEach_test_i64(in, out);
         mRS.finish();
         try {
-            fe_i64.forEach_root(in, badOut);
+            fe_all.forEach_test_i64(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I64_2
-        ScriptC_fe_i64_2 fe_i64_2 = new ScriptC_fe_i64_2(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i64_2);
         t = new Type.Builder(mRS, Element.I64_2(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U64_2(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i64_2.forEach_root(in, out);
+        fe_all.forEach_test_i64_2(in, out);
         mRS.finish();
         try {
-            fe_i64_2.forEach_root(in, badOut);
+            fe_all.forEach_test_i64_2(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I64_3
-        ScriptC_fe_i64_3 fe_i64_3 = new ScriptC_fe_i64_3(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i64_3);
         t = new Type.Builder(mRS, Element.I64_3(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U64_3(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i64_3.forEach_root(in, out);
+        fe_all.forEach_test_i64_3(in, out);
         mRS.finish();
         try {
-            fe_i64_3.forEach_root(in, badOut);
+            fe_all.forEach_test_i64_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // I64_4
-        ScriptC_fe_i64_4 fe_i64_4 = new ScriptC_fe_i64_4(mRS,
-                                                         mRes,
-                                                         R.raw.fe_i64_4);
         t = new Type.Builder(mRS, Element.I64_4(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.U64_4(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i64_4.forEach_root(in, out);
+        fe_all.forEach_test_i64_4(in, out);
         mRS.finish();
         try {
-            fe_i64_4.forEach_root(in, badOut);
+            fe_all.forEach_test_i64_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F32
-        ScriptC_fe_f32 fe_f32 = new ScriptC_fe_f32(mRS, mRes, R.raw.fe_f32);
         t = new Type.Builder(mRS, Element.F32(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f32.forEach_root(in, out);
+        fe_all.forEach_test_f32(in, out);
         mRS.finish();
         try {
-            fe_f32.forEach_root(in, badOut);
+            fe_all.forEach_test_f32(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F32_2
-        ScriptC_fe_f32_2 fe_f32_2 = new ScriptC_fe_f32_2(mRS,
-                                                         mRes,
-                                                         R.raw.fe_f32_2);
         t = new Type.Builder(mRS, Element.F32_2(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.F32_2(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_f32_2.forEach_root(in, out);
+        fe_all.forEach_test_f32_2(in, out);
         mRS.finish();
         try {
-            fe_f32_2.forEach_root(in, badOut);
+            fe_all.forEach_test_f32_2(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F32_3
-        ScriptC_fe_f32_3 fe_f32_3 = new ScriptC_fe_f32_3(mRS,
-                                                         mRes,
-                                                         R.raw.fe_f32_3);
         t = new Type.Builder(mRS, Element.F32_3(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f32_3.forEach_root(in, out);
+        fe_all.forEach_test_f32_3(in, out);
         mRS.finish();
         try {
-            fe_f32_3.forEach_root(in, badOut);
+            fe_all.forEach_test_f32_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F32_4
-        ScriptC_fe_f32_4 fe_f32_4 = new ScriptC_fe_f32_4(mRS,
-                                                         mRes,
-                                                         R.raw.fe_f32_4);
         t = new Type.Builder(mRS, Element.F32_4(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f32_4.forEach_root(in, out);
+        fe_all.forEach_test_f32_4(in, out);
         mRS.finish();
         try {
-            fe_f32_4.forEach_root(in, badOut);
+            fe_all.forEach_test_f32_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F64
-        ScriptC_fe_f64 fe_f64 = new ScriptC_fe_f64(mRS, mRes, R.raw.fe_f64);
         t = new Type.Builder(mRS, Element.F64(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f64.forEach_root(in, out);
+        fe_all.forEach_test_f64(in, out);
         mRS.finish();
         try {
-            fe_f64.forEach_root(in, badOut);
+            fe_all.forEach_test_f64(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F64_2
-        ScriptC_fe_f64_2 fe_f64_2 = new ScriptC_fe_f64_2(mRS,
-                                                         mRes,
-                                                         R.raw.fe_f64_2);
         t = new Type.Builder(mRS, Element.F64_2(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f64_2.forEach_root(in, out);
+        fe_all.forEach_test_f64_2(in, out);
         mRS.finish();
         try {
-            fe_f64_2.forEach_root(in, badOut);
+            fe_all.forEach_test_f64_2(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F64_3
-        ScriptC_fe_f64_3 fe_f64_3 = new ScriptC_fe_f64_3(mRS,
-                                                         mRes,
-                                                         R.raw.fe_f64_3);
         t = new Type.Builder(mRS, Element.F64_3(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f64_3.forEach_root(in, out);
+        fe_all.forEach_test_f64_3(in, out);
         mRS.finish();
         try {
-            fe_f64_3.forEach_root(in, badOut);
+            fe_all.forEach_test_f64_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // F64_4
-        ScriptC_fe_f64_4 fe_f64_4 = new ScriptC_fe_f64_4(mRS,
-                                                         mRes,
-                                                         R.raw.fe_f64_4);
         t = new Type.Builder(mRS, Element.F64_4(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_f64_4.forEach_root(in, out);
+        fe_all.forEach_test_f64_4(in, out);
         mRS.finish();
         try {
-            fe_f64_4.forEach_root(in, badOut);
+            fe_all.forEach_test_f64_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // fe_test (struct)
-        ScriptC_fe_struct fe_struct = new ScriptC_fe_struct(mRS,
-                                                            mRes,
-                                                            R.raw.fe_struct);
         in = new ScriptField_fe_test(mRS, x).getAllocation();
         out = new ScriptField_fe_test(mRS, x).getAllocation();
-        fe_struct.forEach_root(in, out);
+        fe_all.forEach_test_struct(in, out);
         mRS.finish();
         try {
-            fe_struct.forEach_root(in, badOut);
+            fe_all.forEach_test_struct(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
         }
 
         // BOOLEAN
-        ScriptC_fe_bool fe_bool = new ScriptC_fe_bool(mRS, mRes, R.raw.fe_bool);
         t = new Type.Builder(mRS, Element.BOOLEAN(mRS)).setX(x).create();
         in = Allocation.createTyped(mRS, t);
         out = Allocation.createTyped(mRS, t);
-        fe_bool.forEach_root(in, out);
+        fe_all.forEach_test_bool(in, out);
         mRS.finish();
         try {
-            fe_bool.forEach_root(in, badOut);
+            fe_all.forEach_test_bool(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
@@ -483,10 +421,10 @@
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.A_8(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i8.forEach_root(in, out);
+        fe_all.forEach_test_i8(in, out);
         mRS.finish();
         try {
-            fe_i8.forEach_root(in, badOut);
+            fe_all.forEach_test_i8(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
@@ -497,10 +435,10 @@
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.RGBA_8888(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i8_4.forEach_root(in, out);
+        fe_all.forEach_test_i8_4(in, out);
         mRS.finish();
         try {
-            fe_i8_4.forEach_root(in, badOut);
+            fe_all.forEach_test_i8_4(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {
@@ -511,10 +449,10 @@
         in = Allocation.createTyped(mRS, t);
         t = new Type.Builder(mRS, Element.RGB_888(mRS)).setX(x).create();
         out = Allocation.createTyped(mRS, t);
-        fe_i8_3.forEach_root(in, out);
+        fe_all.forEach_test_i8_3(in, out);
         mRS.finish();
         try {
-            fe_i8_3.forEach_root(in, badOut);
+            fe_all.forEach_test_i8_3(in, badOut);
             mRS.finish();
             fail("should throw RSRuntimeException");
         } catch (RSRuntimeException e) {