diff options
author | Yang Ni <yangni@google.com> | 2016-05-12 00:43:59 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-05-12 00:43:59 +0000 |
commit | 344ead09e775f70cedef4ac206fa99ab3b3b1b75 (patch) | |
tree | 9b3dd33ee910f4171722d270ccf50cdcbc860238 | |
parent | d19babd46408f143f2d5d6478ebd90c48db8d6ec (diff) | |
parent | bb0a08cc28a83c86ca90954633885d318045a20a (diff) | |
download | rs-344ead09e775f70cedef4ac206fa99ab3b3b1b75.tar.gz |
Merge "Test for old style kernels in single-source RS" into nyc-dev
am: bb0a08cc28
* commit 'bb0a08cc28a83c86ca90954633885d318045a20a':
Test for old style kernels in single-source RS
Change-Id: I46f94462aa907e42c7f7064e60614af9184658de
-rw-r--r-- | java/tests/RsTest/src/com/android/rs/test/UT_single_source_script.java | 3 | ||||
-rw-r--r-- | java/tests/RsTest/src/com/android/rs/test/single_source_script.rs | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/java/tests/RsTest/src/com/android/rs/test/UT_single_source_script.java b/java/tests/RsTest/src/com/android/rs/test/UT_single_source_script.java index 5765d4e2..d9b041a4 100644 --- a/java/tests/RsTest/src/com/android/rs/test/UT_single_source_script.java +++ b/java/tests/RsTest/src/com/android/rs/test/UT_single_source_script.java @@ -47,6 +47,9 @@ public class UT_single_source_script extends UnitTest { initializeGlobals(pRS, s); s.invoke_entrypoint(testAllocation1, testAllocation2); + s.forEach_oldFoo(testAllocation2, testAllocation2); + s.forEach_oldGoo(testAllocation2, testAllocation2); + s.invoke_validate(testAllocation2); pRS.finish(); waitForMessage(); diff --git a/java/tests/RsTest/src/com/android/rs/test/single_source_script.rs b/java/tests/RsTest/src/com/android/rs/test/single_source_script.rs index 9f49ec49..f3bc1c05 100644 --- a/java/tests/RsTest/src/com/android/rs/test/single_source_script.rs +++ b/java/tests/RsTest/src/com/android/rs/test/single_source_script.rs @@ -5,10 +5,18 @@ int dimY; rs_allocation gAllocOut; +void oldFoo(const int* in, int* out, uint32_t x, uint32_t y) { + out[0] = in[0] * 3; +} + int __attribute__((kernel)) foo(int a) { return a * 2; } +void oldGoo(const int* a, int* out) { + *out = *a + 47; +} + int __attribute__((kernel)) goo(int a, int b) { return a + b; } @@ -19,7 +27,7 @@ void __attribute__((kernel)) bar(int x, int y) { rsSetElementAt_int(gAllocOut, a, x, y); } -static void validate(rs_allocation out) { +void validate(rs_allocation out) { bool failed = false; int i, j; @@ -32,6 +40,8 @@ static void validate(rs_allocation out) { expected *= 2; } expected += (i + j * dimX) + 1; + expected *= 3; + expected += 47; if (actual != expected) { failed = true; rsDebug("row ", j); @@ -82,6 +92,4 @@ void entrypoint(rs_allocation in, rs_allocation out) { opts2.yStart = 0; opts2.yEnd = dimY; rsForEachWithOptions(bar, &opts2); - - validate(out); } |