diff options
| author | Stephen Hines <srhines@google.com> | 2013-09-04 15:53:03 -0700 |
|---|---|---|
| committer | Stephen Hines <srhines@google.com> | 2013-09-10 00:07:56 -0700 |
| commit | a1302e2a413fb32fb5eab320e9802a7893ff6f27 (patch) | |
| tree | 9956562a50aaaf6bc8d295aa3c5d718de924d3d5 /tests/cppbasic/compute.cpp | |
| parent | 17e3cdc24776d8fdbf1ce16287b9b4dcd516708f (diff) | |
Fix issues with compute unit tests.
Bug: 10427951
This fixes 2 small problems:
1) Typecheck was using the wrong pathname for reflection.
2) Cppbasic was doing an illegal 1D copy over a 2D data structure. This was
masked by using an input size that is a multiple of our required stride.
Change-Id: I1138d646ff6369cf25a2bd9bc52e20a67a124e95
Diffstat (limited to 'tests/cppbasic/compute.cpp')
| -rw-r--r-- | tests/cppbasic/compute.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/cppbasic/compute.cpp b/tests/cppbasic/compute.cpp index bc80c7ea..21ffe2b1 100644 --- a/tests/cppbasic/compute.cpp +++ b/tests/cppbasic/compute.cpp @@ -64,19 +64,21 @@ int main(int argc, char** argv) // Verify a simple kernel. { + static const uint32_t xDim = 7; + static const uint32_t yDim = 7; sp<const Element> e = Element::I32(rs); Type::Builder tb(rs, e); - tb.setX(8); - tb.setY(8); + tb.setX(xDim); + tb.setY(yDim); sp<const Type> t = tb.create(); sp<Allocation> kern1_in = Allocation::createTyped(rs, t); sp<Allocation> kern1_out = Allocation::createTyped(rs, t); int *buf = new int[t->getCount()]; for (uint32_t ct=0; ct < t->getCount(); ct++) { - buf[ct] = 0; + buf[ct] = 5; } - kern1_in->copy1DFrom(buf); + kern1_in->copy2DRangeFrom(0, 0, xDim, yDim, buf); delete [] buf; sc->forEach_kern1(kern1_in, kern1_out); |
