diff options
author | Michael Butler <butlermichael@google.com> | 2017-03-01 15:32:30 -0800 |
---|---|---|
committer | Michael Butler <butlermichael@google.com> | 2017-03-16 14:24:14 -0700 |
commit | 2d4d6d97c1504027aef567dca7337092e2a8a779 (patch) | |
tree | e9c974d1f4f85faf25d8a5e97de0b07627bc018d /renderscript | |
parent | e3a0c607cd05aedcda889877a9605a381d1af870 (diff) | |
download | android_hardware_interfaces-2d4d6d97c1504027aef567dca7337092e2a8a779.tar.gz android_hardware_interfaces-2d4d6d97c1504027aef567dca7337092e2a8a779.tar.bz2 android_hardware_interfaces-2d4d6d97c1504027aef567dca7337092e2a8a779.zip |
RenderScript VTS implementation
Contains the gtest for the vts-hidl-hal test. The goal is to have
1 test case for each HIDL HAL entry by 3/15/17. There are still a few
tests with bugs, so they have been commented out and will be fixed by
3/17/17.
Bug: 34396220
Bug: 35915961
Test: mm and run on angler
Change-Id: I20462432a42e3aa307b98e728f30f20f5aa1e921
Diffstat (limited to 'renderscript')
-rw-r--r-- | renderscript/1.0/vts/functional/Android.bp | 42 | ||||
-rw-r--r-- | renderscript/1.0/vts/functional/VtsCopyTests.cpp | 427 | ||||
-rw-r--r-- | renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp | 48 | ||||
-rw-r--r-- | renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h | 82 | ||||
-rw-r--r-- | renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp | 278 | ||||
-rw-r--r-- | renderscript/1.0/vts/functional/VtsScriptTests.cpp | 390 | ||||
-rw-r--r-- | renderscript/1.0/vts/functional/bitcode.cpp | 436 | ||||
-rw-r--r-- | renderscript/Android.bp | 1 |
8 files changed, 1704 insertions, 0 deletions
diff --git a/renderscript/1.0/vts/functional/Android.bp b/renderscript/1.0/vts/functional/Android.bp new file mode 100644 index 000000000..635e2e66c --- /dev/null +++ b/renderscript/1.0/vts/functional/Android.bp @@ -0,0 +1,42 @@ +// +// Copyright (C) 2017 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +cc_test { + name: "VtsHalRenderscriptV1_0TargetTest", + srcs: [ + "VtsHalRenderscriptV1_0TargetTest.cpp", + "VtsCopyTests.cpp", + "VtsMiscellaneousTests.cpp", + "VtsScriptTests.cpp", + "bitcode.cpp", + ], + defaults: ["hidl_defaults"], + shared_libs: [ + "libbase", + "liblog", + "libcutils", + "libhidlbase", + "libhidltransport", + "libnativehelper", + "libutils", + "android.hardware.renderscript@1.0", + ], + static_libs: ["VtsHalHidlTargetTestBase"], + cflags: [ + "-O0", + "-g", + ], +} diff --git a/renderscript/1.0/vts/functional/VtsCopyTests.cpp b/renderscript/1.0/vts/functional/VtsCopyTests.cpp new file mode 100644 index 000000000..77217cb9a --- /dev/null +++ b/renderscript/1.0/vts/functional/VtsCopyTests.cpp @@ -0,0 +1,427 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include "VtsHalRenderscriptV1_0TargetTest.h" + +/* + * This test creates a 1D Allocation with 128 Float Elements, and two float + * vector dataIn & dataOut. dataIn is pre-populated with data, and copied into + * the Allocation using allocation1DWrite. Then the Allocation is copied into + * dataOut with allocation1DRead. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation1DWrite, + * allocation1DRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, Simple1DCopyTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x float1 + Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE); + // 128 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + std::vector<float> dataIn(128), dataOut(128); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data); + context->allocation1DRead(allocation, 0, 0, (uint32_t)dataOut.size(), (Ptr)dataOut.data(), + (Size)dataOut.size()*sizeof(float)); + bool same = std::all_of(dataOut.begin(), dataOut.end(), + [](float x){ static int val = 0; return x == (float)val++; }); + EXPECT_EQ(true, same); +} + +/* + * This test creates a 2D Allocation with 128 * 128 Float Elements, and two + * float vector dataIn & dataOut. dataIn is pre-populated with data, and copied + * into the Allocation using allocation2DWrite. Then the Allocation is copied + * into dataOut with allocation2DRead. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite, + * allocation2DRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, Simple2DCopyTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x 128 x float1 + Type type = context->typeCreate(element, 128, 128, 0, false, false, YuvFormat::YUV_NONE); + // 128 x 128 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + std::vector<float> dataIn(128*128), dataOut(128*128); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + context->allocation2DWrite(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 128, 128, + _data, 0); + context->allocation2DRead(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 128, 128, + (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float), 0); + bool same = std::all_of(dataOut.begin(), dataOut.end(), + [](float x){ static int val = 0; return x == (float)val++; }); + EXPECT_EQ(true, same); +} + +/* + * This test creates a 3D Allocation with 32 * 32 * 32 Float Elements, and two + * float vector dataIn & dataOut. dataIn is pre-populated with data, and copied + * into the Allocation using allocation3DWrite. Then the Allocation is copied + * into dataOut with allocation3DRead. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation3DWrite, + * allocation3DRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, Simple3DCopyTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 32 x 32 x 32 x float1 + Type type = context->typeCreate(element, 32, 32, 32, false, false, YuvFormat::YUV_NONE); + // 32 x 32 x 32 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + std::vector<float> dataIn(32*32*32), dataOut(32*32*32); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + context->allocation3DWrite(allocation, 0, 0, 0, 0, 32, 32, 32, _data, 0); + context->allocation3DRead(allocation, 0, 0, 0, 0, 32, 32, 32, (Ptr)dataOut.data(), + (Size)dataOut.size()*sizeof(float), 0); + bool same = std::all_of(dataOut.begin(), dataOut.end(), + [](float x){ static int val = 0; return x == (float)val++; }); + EXPECT_EQ(true, same); +} + +/* + * This test creates a 2D Allocation with 512 * 512 Float Elements with + * allocationCreateFromBitmap, and two float vector dataIn & dataOut. dataIn is + * pre-populated with data, and copied into the Allocation using + * allocationCopyToBitmap. Then the Allocation is copied into dataOut with + * allocationRead. + * + * Calls: elementCreate, typeCreate, allocationCreateFromBitmap, + * allocationCopyToBitmap, allocationRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, SimpleBitmapTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 512 x 512 x float1 + Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE); + std::vector<float> dataIn(512*512), dataOut1(512*512), dataOut2(512*512); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + // 512 x 512 x float1 + Allocation allocation = context->allocationCreateFromBitmap(type, + AllocationMipmapControl::NONE, + _data, + (int)AllocationUsageType::SCRIPT); + EXPECT_NE(allocation, Allocation(0)); + + context->allocationCopyToBitmap(allocation, (Ptr)dataOut1.data(), + (Size)dataOut1.size()*sizeof(float)); + bool same1 = std::all_of(dataOut1.begin(), dataOut1.end(), + [](float x){ static int val = 0; return x == (float)val++; }); + EXPECT_EQ(true, same1); + + context->allocationRead(allocation, (Ptr)dataOut2.data(), (Size)dataOut2.size()*sizeof(float)); + bool same2 = std::all_of(dataOut2.begin(), dataOut2.end(), + [](float x){ static int val = 0; return x == (float)val++; }); + EXPECT_EQ(true, same2); +} + +/* + * This test creates two 2D Allocations, one with 512 * 512 Float Elements, the + * other with 256 * 256 Float Elements. The larger Allocation is pre-populated + * with dataIn, and copied into the smaller Allocation using + * allocationCopy2DRange. Then the Allocation is copied into dataOut with + * allocationRead. + * + * Calls: elementCreate, typeCreate, allocationCreateFromBitmap, + * allocationCreateTyped, allocationCopy2DRange, allocationRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, AllocationCopy2DRangeTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 512 x 512 x float1 + Type typeSrc = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE); + // 256 x 256 x float1 + Type typeDst = context->typeCreate(element, 256, 256, 0, false, false, YuvFormat::YUV_NONE); + std::vector<float> dataIn(512*512), dataOut(256*256), expected(256*256); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + // 512 x 512 x float1 + Allocation allocSrc = context->allocationCreateFromBitmap(typeSrc, + AllocationMipmapControl::NONE, _data, + (int)AllocationUsageType::SCRIPT); + // 256 x 256 x float1 + Allocation allocDst = context->allocationCreateTyped(typeDst, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocationCopy2DRange(allocDst, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256, + allocSrc, 128, 128, 0, AllocationCubemapFace::POSITIVE_X); + context->allocationRead(allocDst, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float)); + for (int i = 0; i < 256; ++i) { + for (int j = 0; j < 256; ++j) { + expected[i*256 + j] = dataIn[(i+128)*512 + (j+128)]; + } + } + EXPECT_EQ(expected, dataOut); +} + +/* + * This test creates two 3D Allocations, one with 128 * 128 * 128 Float + * Elements, the other with 64 * 64 * 64 Float Elements. The larger Allocation + * is pre-populated with dataIn, and copied into the smaller Allocation using + * allocationCopy3DRange. Then the Allocation is copied into dataOut with + * allocationRead. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation3DWrite, + * allocationCopy3DRange, allocationRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, AllocationCopy3DRangeTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x 128 x 128 x float1 + Type typeSrc = context->typeCreate(element, 128, 128, 128, false, false, YuvFormat::YUV_NONE); + // 64 x 64 x 64 x float1 + Type typeDst = context->typeCreate(element, 64, 64, 64, false, false, YuvFormat::YUV_NONE); + std::vector<float> dataIn(128*128*128), dataOut(64*64*64), expected(64*64*64); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + // 512 x 512 x float1 + Allocation allocSrc = context->allocationCreateTyped(typeSrc, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + // 256 x 256 x float1 + Allocation allocDst = context->allocationCreateTyped(typeDst, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocation3DWrite(allocSrc, 0, 0, 0, 0, 128, 128, 128, _data, 128*sizeof(float)); + context->allocationCopy3DRange(allocDst, 0, 0, 0, 0, 64, 64, 64, allocSrc, 32, 32, 32, 0); + context->allocationRead(allocDst, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float)); + for (int i = 0; i < 64; ++i) { + for (int j = 0; j < 64; ++j) { + for (int k = 0; k < 64; ++k) { + expected[i*64*64 + j*64 + k] = dataIn[(i+32)*128*128 + (j+32)*128 + (k+32)]; + } + } + } + EXPECT_EQ(expected, dataOut); +} + +/* + * This test creates one 2D Allocations, one with 512 * 512 Float Elements, and + * one 2D AllocationAdapter with a window of 256 * 256 based on the Allocation. + * The Allocation is pre-populated with dataIn. Then the Allocation is copied + * into dataOut with allocationRead on the AllocationAdapter. + * + * Calls: elementCreate, typeCreate, allocationCreateFromBitmap, + * allocationAdapterCreate, allocationAdapterOffset, allocation2DRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, SimpleAdapterTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 512 x 512 x float1 + Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE); + std::vector<float> dataIn(512*512), dataOut(256*256), expected; + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + // 512 x 512 x float1 + Allocation allocation = context->allocationCreateFromBitmap(type, + AllocationMipmapControl::NONE, + _data, + (int)AllocationUsageType::SCRIPT); + // 256 x 256 x float1 + Type subType = context->typeCreate(element, 256, 256, 0, false, false, YuvFormat::YUV_NONE); + // 256 x 256 x float1 + AllocationAdapter allocationAdapter = context->allocationAdapterCreate(subType, allocation); + EXPECT_NE(AllocationAdapter(0), allocationAdapter); + + std::vector<uint32_t> offsets(9, 0); + offsets[0] = 128; + offsets[1] = 128; + hidl_vec<uint32_t> _offsets; + _offsets.setToExternal(offsets.data(), offsets.size()); + // origin at (128,128) + context->allocationAdapterOffset(allocationAdapter, _offsets); + + context->allocation2DRead(allocationAdapter, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, + 256, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float), 0); + for (int i = 128; i < 128 + 256; ++i) { + for (int j = 128; j < 128 + 256; ++j) { + expected.push_back(i * 512 + j); + } + } + EXPECT_EQ(expected, dataOut); +} + +/* + * This test creates one 2D Allocations, one with 64 * 64 USIGNED_8 Elements, + * and with AllocationMipmapControl::FULL. The Allocation is pre-populated with + * dataIn and the mipmaps are filled with allocationGenerateMipmaps. Then + * dataOut is then overridden with allocation2DRead. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite, + * allocationGenerateMipmaps, allocationSyncAll, allocation2DRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, SimpleMipmapTest) { + // uint8_t + Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1); + // 64 x 64 x uint8_t + Type type = context->typeCreate(element, 64, 64, 0, true, false, YuvFormat::YUV_NONE); + std::vector<uint8_t> dataIn(64*64), dataOut(32*32), expected(32*32); + std::generate(dataIn.begin(), dataIn.end(), + [](){ static int val = 0; return (uint8_t)(0xFF & val++); }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(uint8_t)); + // 64 x 64 x uint8_t + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::FULL, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocation2DWrite(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 64, 64, + _data, 64*sizeof(uint8_t)); + context->allocationGenerateMipmaps(allocation); + context->allocationSyncAll(allocation, AllocationUsageType::SCRIPT); + context->allocation2DRead(allocation, 0, 0, 1, AllocationCubemapFace::POSITIVE_X, 32, 32, + (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(uint8_t), + 32*sizeof(uint8_t)); + for (int i = 0; i < 32; ++i) { + for (int j = 0; j < 32; ++j) { + expected[i*32 + j] = ((uint32_t)dataIn[i*2*64 + j*2] + dataIn[i*2*64 + j*2 + 1] + + dataIn[i*2*64 + j*2 + 64] + dataIn[i*2*64 + j*2 + 64+1]) / 4; + } + } + EXPECT_EQ(expected, dataOut); +} + +/* + * This test creates one 2D Allocations, one with 128 * 128 Float Elements with + * allocationCubeCreateFromBitmap. The Allocation is pre-populated with dataIn + * and the mipmaps are filled with allocationGenerateMipmaps. Then dataOut is + * then overridden with allocation2DRead. + * + * Calls: elementCreate, typeCreate, allocationCubeCreateFromBitmap, + * allocation2DRead + * + * Expect: dataIn & dataOut are the same. + */ +TEST_F(RenderscriptHidlTest, SimpleCubemapTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x 128 x float1 + Type type = context->typeCreate(element, 128, 128, 0, false, true, YuvFormat::YUV_NONE); + std::vector<float> dataIn(128*128*6), dataOut(128*128), expected(128*128); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + // 128 x 128 x float1 x 6 + Allocation allocation = context->allocationCubeCreateFromBitmap( + type, AllocationMipmapControl::NONE, _data, (int)AllocationUsageType::SCRIPT); + EXPECT_NE(Allocation(0), allocation); + + context->allocation2DRead(allocation, 0, 0, 0, AllocationCubemapFace::NEGATIVE_Z, 128, + 128, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float), + 128*sizeof(float)); + for (int i = 0; i < 128; ++i) { + for (int j = 0; j < 128; ++j) { + expected[i*128 + j] = i*128*6 + j + 128*5; + } + } + EXPECT_EQ(expected, dataOut); +} + +/* + * This test creates a complex element type (uint8_t, uint32_t) out of known + * elements. It then verifies the element structure was created correctly. + * Finally, the test creates a 128-wide, 1-dimension allocation of this type + * and transfers memory to and from this structure. + * + * Calls: elementCreate, elementComplexCreate, elementGetSubElements, + * typeCreate, allocationCreateTyped, allocationElementWrite, + * allocationElementRead + * + * This test currently has a bug, and should be fixed by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, ComplexElementTest) { + Element element1 = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1); + Element element2 = context->elementCreate(DataType::UNSIGNED_32, DataKind::USER, false, 1); + + hidl_vec<Element> eins = {element1, element2}; + hidl_vec<hidl_string> names = {hidl_string("first"), hidl_string("second")}; + hidl_vec<Size> arraySizesPtr = {sizeof(uint8_t), sizeof(uint32_t)}; + Element element3 = context->elementComplexCreate(eins, names, arraySizesPtr); + EXPECT_NE(Element(0), element3); + + std::vector<Element> ids; + std::vector<std::string> namesOut; + std::vector<Size> arraySizesOut; + context->elementGetSubElements(element3, 2, [&](const hidl_vec<Element>& _ids, + const hidl_vec<hidl_string>& _names, + const hidl_vec<Size>& _arraySizes){ + ids = _ids; + namesOut.push_back(_names[0]); + namesOut.push_back(_names[1]); + arraySizesOut = _arraySizes; + }); + EXPECT_NE(Element(0), ids[0]); + EXPECT_NE(Element(0), ids[1]); + EXPECT_EQ("first", namesOut[0]); + EXPECT_EQ("second", namesOut[1]); + EXPECT_EQ(sizeof(uint8_t), arraySizesOut[0]); + EXPECT_EQ(sizeof(uint32_t), arraySizesOut[1]); + + // 128 x (uint8_t, uint32_t) + Type type = context->typeCreate(element3, 128, 0, 0, false, false, YuvFormat::YUV_NONE); + // 128 x (uint8_t, uint32_t) + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + std::vector<uint32_t> dataIn(128), dataOut(128); + std::generate(dataIn.begin(), dataIn.end(), [](){ static uint32_t val = 0; return val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(uint32_t)); + context->allocationElementWrite(allocation, 0, 0, 0, 0, _data, 1); + context->allocationElementRead(allocation, 0, 0, 0, 0, (Ptr)dataOut.data(), + (Size)dataOut.size()*sizeof(uint32_t), 1); + bool same = std::all_of(dataOut.begin(), dataOut.end(), + [](uint32_t x){ static uint32_t val = 0; return x == val++; }); + EXPECT_EQ(true, same); +} +*/ diff --git a/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp new file mode 100644 index 000000000..f505d0162 --- /dev/null +++ b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VtsHalRenderscriptV1_0TargetTest.h" + +// The main test class for RENDERSCRIPT HIDL HAL. +void RenderscriptHidlTest::SetUp() { + device = ::testing::VtsHalHidlTargetTestBase::getService<IDevice>(); + ASSERT_NE(nullptr, device.get()); + + uint32_t version = 0; + uint32_t flags = 0; + context = device->contextCreate(version, ContextType::NORMAL, flags); + ASSERT_NE(nullptr, context.get()); +} + +void RenderscriptHidlTest::TearDown() { + context->contextDestroy(); +} + +// A class for test environment setup (kept since this file is a template). +class RenderscriptHidlEnvironment : public ::testing::Environment { +public: + virtual void SetUp() {} + virtual void TearDown() {} +}; + + +int main(int argc, char** argv) { + ::testing::AddGlobalTestEnvironment(new RenderscriptHidlEnvironment); + ::testing::InitGoogleTest(&argc, argv); + int status = RUN_ALL_TESTS(); + LOG(INFO) << "Test result = " << status; + return status; +} diff --git a/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h new file mode 100644 index 000000000..fc1b7e4b5 --- /dev/null +++ b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef VTS_HAL_RENDERSCRIPT_V1_0_TARGET_TESTS_H +#define VTS_HAL_RENDERSCRIPT_V1_0_TARGET_TESTS_H + +#define LOG_TAG "renderscript_hidl_hal_test" +#include <android-base/logging.h> + +#include <android/hardware/renderscript/1.0/IContext.h> +#include <android/hardware/renderscript/1.0/IDevice.h> +#include <android/hardware/renderscript/1.0/types.h> + +#include <VtsHalHidlTargetTestBase.h> +#include <gtest/gtest.h> + +using ::android::hardware::renderscript::V1_0::Allocation; +using ::android::hardware::renderscript::V1_0::AllocationAdapter; +using ::android::hardware::renderscript::V1_0::AllocationCubemapFace; +using ::android::hardware::renderscript::V1_0::AllocationMipmapControl; +using ::android::hardware::renderscript::V1_0::AllocationUsageType; +using ::android::hardware::renderscript::V1_0::IContext; +using ::android::hardware::renderscript::V1_0::IDevice; +using ::android::hardware::renderscript::V1_0::ContextType; +using ::android::hardware::renderscript::V1_0::DataType; +using ::android::hardware::renderscript::V1_0::DataKind; +using ::android::hardware::renderscript::V1_0::Element; +using ::android::hardware::renderscript::V1_0::MessageToClientType; +using ::android::hardware::renderscript::V1_0::NativeWindow; +using ::android::hardware::renderscript::V1_0::ObjectBase; +using ::android::hardware::renderscript::V1_0::OpaqueHandle; +using ::android::hardware::renderscript::V1_0::Ptr; +using ::android::hardware::renderscript::V1_0::Sampler; +using ::android::hardware::renderscript::V1_0::SamplerValue; +using ::android::hardware::renderscript::V1_0::Script; +using ::android::hardware::renderscript::V1_0::ScriptFieldID; +using ::android::hardware::renderscript::V1_0::ScriptGroup; +using ::android::hardware::renderscript::V1_0::ScriptGroup2; +using ::android::hardware::renderscript::V1_0::ScriptIntrinsicID; +using ::android::hardware::renderscript::V1_0::ScriptInvokeID; +using ::android::hardware::renderscript::V1_0::ScriptKernelID; +using ::android::hardware::renderscript::V1_0::Size; +using ::android::hardware::renderscript::V1_0::ThreadPriorities; +using ::android::hardware::renderscript::V1_0::Type; +using ::android::hardware::renderscript::V1_0::YuvFormat; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +// bitcode variables +typedef signed char int8_t; +extern const int8_t bitCode[]; +extern const int bitCodeLength; + +// The main test class for RENDERSCRIPT HIDL HAL. +class RenderscriptHidlTest : public ::testing::VtsHalHidlTargetTestBase { +public: + virtual void SetUp() override; + virtual void TearDown() override; + + sp<IContext> context; + +private: + sp<IDevice> device; +}; + +#endif // VTS_HAL_RENDERSCRIPT_V1_0_TARGET_TESTS_H diff --git a/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp b/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp new file mode 100644 index 000000000..c2b335434 --- /dev/null +++ b/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VtsHalRenderscriptV1_0TargetTest.h" + +/* + * ContextCreateAndDestroy: + * Creates a RenderScript context and immediately destroys the context. + * Since create and destroy calls are a part of SetUp() and TearDown(), + * the test definition is intentionally kept empty + * + * Calls: getService<IDevice>, contextCreate, contextDestroy + */ +TEST_F(RenderscriptHidlTest, ContextCreateAndDestroy) {} + +/* + * Create an Element and verify the return value is valid. + * + * Calls: elementCreate + */ +TEST_F(RenderscriptHidlTest, ElementCreate) { + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + EXPECT_NE(Element(0), element); +} + +/* + * Create an Element, a Type and an Allocation of that type, and verify the + * return values are valid. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocationGetType + */ +TEST_F(RenderscriptHidlTest, ElementTypeAllocationCreate) { + // Element create test + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + EXPECT_NE(Element(0), element); + + // Type create test + Type type = context->typeCreate(element, 1, 0, 0, false, false, YuvFormat::YUV_NONE); + EXPECT_NE(Type(0), type); + + // Allocation create test + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)((uint32_t)AllocationUsageType::ALL + & ~(uint32_t)AllocationUsageType::OEM), + (Ptr)nullptr); + EXPECT_NE(Allocation(0), allocation); + + // Allocation type test + Type type2 = context->allocationGetType(allocation); + EXPECT_EQ(type, type2); +} + +/* + * Create an Element, a Type of the Element, and verify the native metadata can + * be retrieved correctly. + * + * Calls: elementCreate, typeCreate, elementGetNativeMetadata, + * typeGetNativeMetadata + */ +TEST_F(RenderscriptHidlTest, MetadataTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x float1 + Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE); + + std::vector<uint32_t> elementMetadata(5); + context->elementGetNativeMetadata(element, [&](const hidl_vec<uint32_t>& _metadata){ + elementMetadata = _metadata; }); + EXPECT_EQ(DataType::FLOAT_32, (DataType)elementMetadata[0]); + EXPECT_EQ(DataKind::USER, (DataKind)elementMetadata[1]); + EXPECT_EQ(false, ((uint32_t)elementMetadata[2] == 1) ? true : false); + EXPECT_EQ(1u, (uint32_t)elementMetadata[3]); + EXPECT_EQ(0u, (uint32_t)elementMetadata[4]); + + std::vector<OpaqueHandle> typeMetadata(6); + context->typeGetNativeMetadata(type, [&typeMetadata](const hidl_vec<OpaqueHandle>& _metadata){ + typeMetadata = _metadata; }); + EXPECT_EQ(128u, (uint32_t)typeMetadata[0]); + EXPECT_EQ(0u, (uint32_t)typeMetadata[1]); + EXPECT_EQ(0u, (uint32_t)typeMetadata[2]); + EXPECT_NE(true, typeMetadata[3]); + EXPECT_NE(true, typeMetadata[4]); + EXPECT_EQ(element, (Element)typeMetadata[5]); +} + +/* + * Create a Allocation, and verified allocationGetPointer and allocationResize1D + * return valid values. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, + * allocationGetPointer, allocationResize1D + */ +TEST_F(RenderscriptHidlTest, ResizeTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x float1 + Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE); + // 128 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + Ptr dataPtr1, dataPtr2; + Size stride; + context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0, + [&](Ptr _dataPtr, Size _stride){ + dataPtr1 = _dataPtr; stride = _stride; }); + EXPECT_EQ(0ul, stride); + + context->allocationResize1D(allocation, 1024*1024); + context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0, + [&](Ptr _dataPtr, Size _stride){ + dataPtr2 = _dataPtr; stride = _stride; }); + EXPECT_EQ(0ul, stride); + EXPECT_NE(dataPtr1, dataPtr2); +} + +/* + * Test creates two allocations, one with IO_INPUT and one with IO_OUTPUT. The + * NativeWindow (Surface) is retrieved from one allocation and set to the other. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite, + * allocationGetNativeWindow, allocationSetNativeWindow, allocationIoSend, + * allocationIoReceive, allocation2DRead + * + * This test currently has a bug, and should be fixed by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, NativeWindowIoTest) { + // uint8x4 + Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 4); + // 512 x 512 x uint8x4 + Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE); + std::vector<uint32_t> dataIn(512*512), dataOut(512*512); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (uint32_t)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(uint32_t)); + // 512 x 512 x float1 + Allocation allocationRecv = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)(AllocationUsageType::SCRIPT + | AllocationUsageType::IO_INPUT), + (Ptr)nullptr); + Allocation allocationSend = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)(AllocationUsageType::SCRIPT + | AllocationUsageType::IO_OUTPUT), + (Ptr)nullptr); + context->allocation2DWrite(allocationSend, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 512, 512, + _data, 0); + NativeWindow nativeWindow = context->allocationGetNativeWindow(allocationRecv); + EXPECT_NE(NativeWindow(0), nativeWindow); + + context->allocationSetNativeWindow(allocationSend, nativeWindow); + context->allocationIoSend(allocationSend); + context->allocationIoReceive(allocationRecv); + context->allocation2DRead(allocationRecv, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 512, 512, + (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(uint32_t), 0); + bool same = std::all_of(dataOut.begin(), dataOut.end(), + [](uint32_t x){ static int val = 0; return x == (uint32_t)val++; }); + EXPECT_EQ(true, same); +} +*/ + +/* + * Three allocations are created, two with IO_INPUT and one with IO_OUTPUT. The + * two allocations with IO_INPUT are made to share the same BufferQueue. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, + * allocationCreateFromBitmap, allocationSetupBufferQueue, + * allocationShareBufferQueue + * + * This test currently has a bug, and should be fixed by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, BufferQueueTest) { + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 512 x 512 x float1 + Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE); + std::vector<float> dataIn(512*512), dataOut1(512*512), dataOut2(512*512); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float)); + // 512 x 512 x float1 + Allocation allocationRecv1 = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)(AllocationUsageType::SCRIPT + | AllocationUsageType::IO_INPUT), + (Ptr)nullptr); + Allocation allocationRecv2 = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)(AllocationUsageType::SCRIPT + | AllocationUsageType::IO_INPUT), + (Ptr)nullptr); + Allocation allocationSend = context->allocationCreateFromBitmap(type, + AllocationMipmapControl::NONE, + _data, + (int)(AllocationUsageType::SCRIPT + | AllocationUsageType::IO_OUTPUT)); + context->allocationSetupBufferQueue(allocationRecv1, 2); + context->allocationShareBufferQueue(allocationRecv1, allocationRecv2); + // TODO: test the buffer queue +} +*/ + +/* + * This test sets up the message queue, sends a message, peeks at the message, + * and reads it back. + * + * Calls: contextInitToClient, contextSendMessage, contextPeekMessage, + * contextGetMessage, contextDeinitToClient, contextLog + * + * This test currently has a bug, and should be fixed by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, ContextMessageTest) { + context->contextInitToClient(); + + std::string messageOut = "correct"; + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)const_cast<char*>(messageOut.c_str()), messageOut.length()); + context->contextSendMessage(0, _data); + MessageToClientType messageType; + size_t size; + uint32_t subID; + context->contextPeekMessage([&](MessageToClientType _type, Size _size, uint32_t _subID){ + messageType = _type; size = (uint32_t)_size; subID = _subID; }); + std::vector<char> messageIn(size, '\0'); + context->contextGetMessage(messageIn.data(), messageIn.size(), + [&](MessageToClientType _type, Size _size){ + messageType = _type; size = (uint32_t)_size; }); + EXPECT_EQ(messageOut, messageIn.data()); + + context->contextDeinitToClient(); + context->contextLog(); +} +*/ + +/* + * Call through a bunch of APIs and make sure they don’t crash. Assign the name + * of a object and check getName returns the name just set. + * + * Calls: contextSetPriority, contextSetCacheDir, elementCreate, assignName, + * contextFinish, getName, objDestroy, samplerCreate + */ +TEST_F(RenderscriptHidlTest, MiscellaneousTests) { + context->contextSetPriority(ThreadPriorities::NORMAL); + context->contextSetCacheDir("/data/local/tmp/temp/"); + + Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1); + std::string nameIn = "element_test_name"; + std::string nameOut = "not_name"; + hidl_string _nameIn; + _nameIn.setToExternal(nameIn.c_str(), nameIn.length()); + context->assignName(element, _nameIn); + context->contextFinish(); + context->getName(element, [&](const hidl_string& _name){ nameOut = _name.c_str(); }); + EXPECT_EQ("element_test_name", nameOut); + + context->objDestroy(element); + + Sampler sampler = context->samplerCreate(SamplerValue::LINEAR, SamplerValue::LINEAR, + SamplerValue::LINEAR, SamplerValue::LINEAR, + SamplerValue::LINEAR, 8.0f); + EXPECT_NE(Sampler(0), sampler); +} diff --git a/renderscript/1.0/vts/functional/VtsScriptTests.cpp b/renderscript/1.0/vts/functional/VtsScriptTests.cpp new file mode 100644 index 000000000..9531e1934 --- /dev/null +++ b/renderscript/1.0/vts/functional/VtsScriptTests.cpp @@ -0,0 +1,390 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VtsHalRenderscriptV1_0TargetTest.h" + +/* + * Create a Blur intrinsic with scriptIntrinsicCreate, and call + * scriptSetTimeZone to make sure it is not crashing. + * + * Calls: elementCreate, scriptIntrinsicCreate, scriptSetTimeZone + */ +TEST_F(RenderscriptHidlTest, IntrinsicTest) { + // uint8 + Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1); + Script script = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_BLUR, element); + EXPECT_NE(Script(0), script); + + context->scriptSetTimeZone(script, "UTF-8"); +} + +/* + * Create a user script “struct_test”, and verified the setters and getters work + * for the global variables. + * + * Calls: scriptCCreate, scriptGetVarV, scriptSetVarI, scriptSetVarJ, + * scriptSetVarF, scriptSetVarD, elementCreate, typeCreate, + * allocationCreateTyped, scriptSetVarObj, scriptSetVarV, scriptSetVarVE + */ +TEST_F(RenderscriptHidlTest, ScriptVarTest) { + hidl_vec<uint8_t> bitcode; + bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength); + Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode); + EXPECT_NE(Script(0), script); + + // arg tests + context->scriptSetVarI(script, 0, 100); + int resultI = 0; + context->scriptGetVarV(script, 0, sizeof(int), [&](const hidl_vec<uint8_t>& _data){ + resultI = *((int*)_data.data()); }); + EXPECT_EQ(100, resultI); + + context->scriptSetVarJ(script, 1, 101l); + int resultJ = 0; + context->scriptGetVarV(script, 1, sizeof(long), [&](const hidl_vec<uint8_t>& _data){ + resultJ = *((long*)_data.data()); }); + EXPECT_EQ(101, resultJ); + + context->scriptSetVarF(script, 2, 102.0f); + int resultF = 0.0f; + context->scriptGetVarV(script, 2, sizeof(float), [&](const hidl_vec<uint8_t>& _data){ + resultF = *((float*)_data.data()); }); + EXPECT_EQ(102.0f, resultF); + + context->scriptSetVarD(script, 3, 103.0); + int resultD = 0.0; + context->scriptGetVarV(script, 3, sizeof(double), [&](const hidl_vec<uint8_t>& _data){ + resultD = *((double*)_data.data()); }); + EXPECT_EQ(103.0, resultD); + + // float1 + Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1); + // 128 x float1 + Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE); + // 128 x float1 + Allocation allocationIn = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + Allocation allocationOut = Allocation(0); + context->scriptSetVarObj(script, 4, (ObjectBase)allocationIn); + context->scriptGetVarV(script, 4, sizeof(ObjectBase), [&](const hidl_vec<uint8_t>& _data){ + allocationOut = (Allocation) *((ObjectBase*)_data.data()); }); + EXPECT_EQ(allocationOut, allocationIn); + + std::vector<int> arrayIn = {500, 501, 502, 503}; + std::vector<int> arrayOut(4); + hidl_vec<uint8_t> arrayData; + arrayData.setToExternal((uint8_t*)arrayIn.data(), arrayIn.size()*sizeof(int)); + context->scriptSetVarV(script, 5, arrayData); + context->scriptGetVarV(script, 5, 4*sizeof(int), [&](const hidl_vec<uint8_t>& _data){ + arrayOut = std::vector<int>((int*)_data.data(), + (int*)_data.data() + 4); }); + EXPECT_EQ(500, arrayOut[0]); + EXPECT_EQ(501, arrayOut[1]); + EXPECT_EQ(502, arrayOut[2]); + EXPECT_EQ(503, arrayOut[3]); + + std::vector<int> dataVE = {1000, 1001}; + std::vector<uint32_t> dimsVE = {1}; + std::vector<int> outVE(2); + hidl_vec<uint8_t> _dataVE; + hidl_vec<uint32_t> _dimsVE; + _dataVE.setToExternal((uint8_t*)dataVE.data(), dataVE.size()*sizeof(int)); + _dimsVE.setToExternal((uint32_t*)dimsVE.data(), dimsVE.size()); + // intx2 + Element elementVE = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 2); + context->scriptSetVarVE(script, 6, _dataVE, elementVE, _dimsVE); + context->scriptGetVarV(script, 6, 2*sizeof(int), [&](const hidl_vec<uint8_t>& _data){ + outVE = std::vector<int>((int*)_data.data(), + (int*)_data.data() + 2); }); + EXPECT_EQ(1000, outVE[0]); + EXPECT_EQ(1001, outVE[1]); +} + +/* + * Create a user script “struct_test”, and input and output Allocations. + * Verified the foreach launch correctly for the invoke kernel. + * + * Calls: scriptCCreate, scriptInvoke, scriptGetVarV, scriptInvokeV + */ +TEST_F(RenderscriptHidlTest, ScriptInvokeTest) { + hidl_vec<uint8_t> bitcode; + bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength); + Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode); + EXPECT_NE(Script(0), script); + + // invoke test + int function_res = 0; + context->scriptInvoke(script, 0); + context->scriptGetVarV(script, 0, sizeof(int), [&](const hidl_vec<uint8_t>& _data){ + function_res = *((int*)_data.data()); }); + EXPECT_NE(100, function_res); + + // invokeV test + int functionV_arg = 5; + int functionV_res = 0; + hidl_vec<uint8_t> functionV_data; + functionV_data.setToExternal((uint8_t*)&functionV_arg, sizeof(int)); + context->scriptInvokeV(script, 1, functionV_data); + context->scriptGetVarV(script, 0, sizeof(int), [&](const hidl_vec<uint8_t>& _data){ + functionV_res = *((int*)_data.data()); }); + EXPECT_EQ(5, functionV_res); +} + +/* + * Create a user script “struct_test”, and input and output Allocations. + * Verified the foreach launch correctly for the foreach kernel. + * + * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped, + * allocation1DWrite, scriptForEach, allocationRead + */ +TEST_F(RenderscriptHidlTest, ScriptForEachTest) { + hidl_vec<uint8_t> bitcode; + bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength); + Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode); + EXPECT_NE(Script(0), script); + + // uint8_t + Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1); + // 64 x uint8_t + Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE); + std::vector<uint8_t> dataIn(64), dataOut(64); + std::generate(dataIn.begin(), dataIn.end(), [](){ static uint8_t val = 0; return val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()); + // 64 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + Allocation vout = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data); + hidl_vec<Allocation> vains; + vains.setToExternal(&allocation, 1); + hidl_vec<uint8_t> params; + context->scriptForEach(script, 1, vains, vout, params, nullptr); + context->allocationRead(vout, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(uint8_t)); + bool same = std::all_of(dataOut.begin(), dataOut.end(), + [](uint8_t x){ static uint8_t val = 1; return x == val++; }); + EXPECT_EQ(true, same); +} + +/* + * Create a user script “struct_test”, and input and output Allocations. + * Verified the foreach launch correctly for the reduction kernel. + * + * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped, + * allocation1DWrite, scriptReduce, contextFinish, allocationRead + */ +TEST_F(RenderscriptHidlTest, ScriptReduceTest) { + hidl_vec<uint8_t> bitcode; + bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength); + Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode); + EXPECT_NE(Script(0), script); + + // uint8_t + Element element = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 1); + // 64 x uint8_t + Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE); + Type type2 = context->typeCreate(element, 1, 0, 0, false, false, YuvFormat::YUV_NONE); + std::vector<int> dataIn(64), dataOut(1); + std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return val++; }); + hidl_vec<uint8_t> _data; + _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(int)); + // 64 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + Allocation vaout = context->allocationCreateTyped(type2, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data); + hidl_vec<Allocation> vains; + vains.setToExternal(&allocation, 1); + context->scriptReduce(script, 0, vains, vaout, nullptr); + context->contextFinish(); + context->allocationRead(vaout, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(int)); + // sum of 0, 1, 2, ..., 62, 63 + int sum = 63*64/2; + EXPECT_EQ(sum, dataOut[0]); +} + +/* + * This test creates an allocation and binds it to a data segment in the + * RenderScript script, represented in the bitcode. + * + * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped, + * allocationGetPointer, scriptBindAllocation + * + * This test currently has a bug, and should be fixed by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, ScriptBindTest) { + hidl_vec<uint8_t> bitcode; + bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength); + Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode); + EXPECT_NE(Script(0), script); + + // uint8_t + Element element = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 1); + // 64 x uint8_t + Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE); + // 64 x float1 + Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + Ptr dataPtr1, dataPtr2; + Size stride; + context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0, + [&](Ptr _dataPtr, Size _stride){ dataPtr1 = _dataPtr; + stride = _stride; }); + context->scriptBindAllocation(script, allocation, 7); + context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0, + [&](Ptr _dataPtr, Size _stride){ dataPtr2 = _dataPtr; + stride = _stride; }); + EXPECT_NE(dataPtr1, dataPtr2); +} +*/ + +/* + * This test groups together two RenderScript intrinsic kernels to run one after + * the other asynchronously with respect to the client. The test configures YuvToRGB(A) and Blur, + * and links them together such that Blur will execute after YuvToRGB(A) and use its result. The + * test checks the data returned to make sure it was changed after passing through the entire + * ScriptGroup. + * + * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite, + * scriptIntrinsicCreate, scriptKernelIDCreate, scriptGroupCreate, + * scriptGroupSetInput, scriptGroupSetOutput, scriptGroupExecute, + * allocation2DRead + * + * This test currently has a bug, and should be fixed by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, ScriptGroupTest) { + //std::vector<uint8_t> dataIn(256*256*1, 128), dataOut(256*256*3, 0); + std::vector<uint8_t> dataIn(256*256*1, 128), dataOut(256*256*4, 0); + hidl_vec<uint8_t> _dataIn, _dataOut; + _dataIn.setToExternal(dataIn.data(), dataIn.size()); + _dataOut.setToExternal(dataOut.data(), dataIn.size()); + + // 256 x 256 YUV pixels + Element element1 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_YUV, true, 1); + //Type type1 = context->typeCreate(element1, 256, 256, 0, false, false, YuvFormat::YUV_420_888); + Type type1 = context->typeCreate(element1, 256, 256, 0, false, false, YuvFormat::YUV_NV21); + Allocation allocation1 = context->allocationCreateTyped(type1, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocation2DWrite(allocation1, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256, + _dataIn, 0); + Script yuv2rgb = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_YUV_TO_RGB, element1); + EXPECT_NE(Script(0), yuv2rgb); + + ScriptKernelID yuv2rgbKID = context->scriptKernelIDCreate(yuv2rgb, 0, 2); + EXPECT_NE(ScriptKernelID(0), yuv2rgbKID); + + // 256 x 256 RGB pixels + //Element element2 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_RGB, true, 3); + Element element2 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_RGBA, true, 4); + Type type2 = context->typeCreate(element2, 256, 256, 0, false, false, YuvFormat::YUV_NONE); + Allocation allocation2 = context->allocationCreateTyped(type2, AllocationMipmapControl::NONE, + (int)AllocationUsageType::SCRIPT, + (Ptr)nullptr); + context->allocation2DWrite(allocation2, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256, + _dataOut, 0); + Script blur = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_BLUR, element2); + EXPECT_NE(Script(0), blur); + + ScriptKernelID blurKID = context->scriptKernelIDCreate(blur, 0, 2); + EXPECT_NE(ScriptKernelID(0), blurKID); + + // ScriptGroup + hidl_vec<ScriptKernelID> kernels = {yuv2rgbKID, blurKID}; + hidl_vec<ScriptKernelID> srcK = {yuv2rgbKID}; + hidl_vec<ScriptKernelID> dstK = {blurKID}; + hidl_vec<ScriptFieldID> dstF = {}; + hidl_vec<Type> types = {type2}; + ScriptGroup scriptGroup = context->scriptGroupCreate(kernels, srcK, dstK, dstF, types); + EXPECT_NE(ScriptGroup(0), scriptGroup); + + context->scriptGroupSetInput(scriptGroup, yuv2rgbKID, allocation1); + context->scriptGroupSetOutput(scriptGroup, blurKID, allocation2); + context->scriptGroupExecute(scriptGroup); + + // verify contents were changed + context->allocation2DRead(allocation2, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256, + (Ptr)dataOut.data(), (Size)dataOut.size(), 0); + bool same = std::all_of(dataOut.begin(), dataOut.end(), [](uint8_t x){ return x != 0; }); + EXPECT_EQ(true, same); +} +*/ + +/* + * Similar to the ScriptGroup test, this test verifies the execution flow of + * RenderScript kernels and invokables. + * + * Calls: scriptFieldIDCreate, closureCreate, scriptInvokeIDCreate, + * invokeClosureCreate, closureSetArg, closureSetGlobal, scriptGroup2Create, + * scriptGroupExecute + * + * This test currently still a work in progress, and should be finished by 3/17. + * TODO(butlermichael) + */ +/* +TEST_F(RenderscriptHidlTest, ScriptGroup2Test) { + + ScriptFieldID fieldID = context->scriptFieldIDCreate(script, slot); + EXPECT_NE(ScriptFieldID(0), fieldID); + + ScriptKernelID kernelID = context->scriptKernelIDCreate(script, slot, sig); + EXPECT_NE(ScriptKernelID(0), kernelID); + + Allocation returnValue = 0; + hidl_vec<ScriptFieldID> fieldIDS = {}; + hidl_vec<int64_t> values = {}; + hidl_vec<int32_t> sizes = {}; + hidl_veC<Closure> depClosures = {}; + hidl_vec<ScriptFieldID> depFieldIDS = {}; + Closure closure1 = context->closureCreate(kernelID, returnValue, fieldIDS, values, sizes, + depClosures, depFieldIDS); + EXPECT_NE(Closure(0), closure1); + + ScriptInvokeID invokeID = context->scriptInvokeIDCreate(script, slot); + EXPECT_NE(ScriptInvokeID(0), invokeID); + + hidl_vec<uint8_t> params = {}; + hidl_vec<ScriptFieldID> fieldsIDS2 = {}; + hidl_vec<int64_t> values2 = {}; + hidl_vec<int32_t> sizes2 = {}; + Closure closure2 = context->invokeClosureCreate(invokeID, params, fieldIDS2, values2, sizes2); + EXPECT_NE(Closure(0), closure2); + + context->closureSetArg(closure, index, value, size); + context->closureSetGlobal(closure, fieldID, value, size); + + hidl_string name = "script_group_2_test"; + hidl_string cacheDir = "data/local/tmp/"; + hidl_vec<Closures> closures; + ScriptGroup2 scriptGroup2 = context->scriptGroup2Create(name, cacheDir, closures); + EXPECT_NE(ScriptGroup2(0), scriptGroup2); + + context->scriptGroupExecute(scriptGroup2); + // verify script group launched... +} +*/ diff --git a/renderscript/1.0/vts/functional/bitcode.cpp b/renderscript/1.0/vts/functional/bitcode.cpp new file mode 100644 index 000000000..72143c922 --- /dev/null +++ b/renderscript/1.0/vts/functional/bitcode.cpp @@ -0,0 +1,436 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* +#include "shared.rsh" + +// types +typedef struct Point2 { + int x; + int y; +} Point_2; + +// variables +int var_int; +long var_long; +float var_float; +double var_double; +rs_allocation var_allocation; +int var_array[4]; +Point_2 var_point2; +Point_2 *var_point2_ptr; + +// invoke +void function() { + var_int = 1; + var_long = 2; + var_float = 3.0f; + var_double = 4.0; + + var_array[0] = 5; + var_array[1] = 6; + var_array[2] = 7; + var_array[3] = 8; + + var_point2.x = 9; + var_point2.y = 10; +} + +// invokeV +void functionV(int arg) { + var_int = arg; +} + +// forEach +uchar RS_KERNEL increment(uchar in) { + return in+1; +} + +// reduction +#pragma rs reduce(summation) accumulator(sumAccumulator) combiner(sumCombiner) + +static void sumAccumulator(int* accum, int val) { + *accum += val; +} + +static void sumCombiner(int* accum, const int *val) { + *accum += *val; +} +*/ + +#include "VtsHalRenderscriptV1_0TargetTest.h" + +#ifndef __LP64__ + +const int8_t bitCode[] = { + -34, -64, 23, 11, 0, 0, 0, 0, 44, 0, 0, 0, -84, 10, 0, 0, + 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 1, 64, 4, 0, + 96, 9, 0, 0, 2, 64, 4, 0, 3, 0, 0, 0, 66, 67, -64, -34, + 33, 12, 0, 0, -88, 2, 0, 0, 1, 16, 0, 0, 18, 0, 0, 0, + 7, -127, 35, -111, 65, -56, 4, 73, 6, 16, 50, 57, -110, 1, -124, 12, + 37, 5, 8, 25, 30, 4, -117, 98, -128, 24, 69, 2, 66, -110, 11, 66, + -60, 16, 50, 20, 56, 8, 24, 73, 10, 50, 68, 36, 72, 10, -112, 33, + 35, -60, 82, -128, 12, 25, 33, 114, 36, 7, -56, -120, 17, 98, -88, -96, + -88, 64, -58, -16, 1, 0, 0, 0, 73, 24, 0, 0, 25, 0, 0, 0, + 11, -124, -1, -1, -1, -1, 31, -64, 96, -127, 1, 4, 65, -16, -1, -1, + -1, -1, 3, 24, 45, 32, 2, 16, 4, 65, 16, 36, -2, -1, -1, -1, + 127, 0, -125, 5, 70, 0, -126, 32, 8, -126, -124, 0, -126, 32, 8, -126, + -60, -1, -1, -1, -1, 15, 96, -80, 64, -8, -1, -1, -1, -1, 1, 12, + 22, 8, -1, -1, -1, -1, 63, 0, 11, -120, 0, 4, 65, 16, 4, -119, + -1, -1, -1, -1, 31, -64, 80, 88, 64, 4, -64, -1, -1, -1, -1, 15, + 96, 0, 0, 0, -119, 32, 0, 0, 33, 0, 0, 0, 50, 34, -120, 9, + 32, 100, -123, 4, 19, 35, -92, -124, 4, 19, 35, -29, -124, -95, -112, 20, + 18, 76, -116, -116, 11, -124, -60, 76, 16, -112, -63, 28, 1, 24, 16, 48, + 71, 0, 10, 36, -52, 0, 16, 49, 4, 64, 70, 18, 0, -124, 92, 35, + 77, 17, 37, 76, 126, -22, 32, -51, 100, 35, 1, 0, 72, -71, 75, -102, + 34, 74, -104, -4, 72, -6, -127, 101, 113, 4, 96, 66, -100, -58, -65, 115, + 20, 4, -60, -48, 50, 71, -128, -48, 67, -48, 8, 64, 9, 36, -102, -118, + 32, 1, 84, 21, -31, 121, -24, 42, -125, 20, 0, -108, -107, 65, 10, 2, + -38, -118, 32, 53, -44, -103, 0, -96, -81, 8, 18, 72, -31, 64, 0, 0, + 19, -80, 112, -112, -121, 118, -80, -121, 59, 104, 3, 119, 120, 7, 119, 40, + -121, 54, 96, -121, 116, 112, -121, 122, -64, -121, 54, 56, 7, 119, -88, -121, + 114, 8, 7, 113, 72, -121, 13, 100, 80, 14, 109, 0, 15, 122, 48, 7, + 114, -96, 7, 115, 32, 7, 109, -112, 14, 118, 64, 7, 122, 96, 7, 116, + -48, 6, -10, 16, 7, 114, -128, 7, 122, 96, 7, 116, -96, 7, 113, 32, + 7, 120, -48, 6, -18, 48, 7, 114, -48, 6, -77, 96, 7, 116, -96, -13, + 64, -118, 4, 50, 66, 100, 4, -40, -95, 4, -64, -124, 12, 0, 0, 4, + -64, 14, 101, 0, 44, -124, 0, 0, 32, 0, 118, 40, 5, 112, 33, 3, + 0, 0, 1, -80, 67, 57, 0, 12, 33, 0, 0, 8, -128, 29, 74, 2, + 100, -56, 0, 0, 64, 0, -20, 80, 22, 64, 67, 6, 0, 0, 2, -128, + 13, -121, -37, -95, 56, -64, -122, 12, 0, 0, 4, -64, 14, 37, 2, 58, + 96, 0, 0, 32, 0, 118, 40, 17, -32, 1, 3, 0, 0, 1, 48, 68, + -95, 0, 0, 8, 0, 0, 0, -126, 33, -118, 5, 0, 64, 0, 0, 0, + 16, 12, 81, 48, 0, 0, 4, 0, 0, -128, 96, -120, -94, 1, -64, 48, + 0, 0, 0, 0, 67, 20, 14, 0, 6, 2, 0, 0, 0, 24, -94, 80, + 0, 0, 20, 0, 0, 0, -63, 16, -59, 3, 2, -64, 0, 0, 0, 8, + -122, 40, 98, 0, 0, -64, 1, 0, 0, 16, 100, -127, 0, 0, 0, 0, + 13, 0, 0, 0, 50, 30, -104, 20, 25, 17, 76, -112, -116, 9, 38, 71, + -58, 4, 67, 2, 70, 0, 74, -96, 16, 72, 24, 1, 32, 98, 4, -128, + -116, 17, 0, 66, 70, 0, 72, 25, 1, -96, 101, 4, -128, -104, 17, 0, + -126, 108, -75, 6, 91, -50, 1, 0, 121, 24, 0, 0, -30, 0, 0, 0, + 26, 3, 76, -112, 70, 2, 19, 52, 68, 0, 38, 42, 119, 99, 104, 97, + 114, 95, 115, 105, 122, 101, 67, 4, -128, 26, 98, 0, -45, 24, 4, 0, + -59, -90, 45, -51, -19, -85, -52, -83, -82, -19, 107, 46, 77, -81, 108, -120, + 1, 76, 99, 64, 0, 20, -7, 32, -56, -115, 76, -18, 45, -115, 12, 100, + -116, 45, -52, -19, 12, -60, -82, 76, 110, 46, -19, -51, 13, 100, -58, 5, + -57, 69, -26, -90, -122, 6, 7, 6, 4, 4, 69, 44, 108, -82, -116, 12, + -28, -51, 13, -124, -119, -55, -86, 9, 100, -58, 5, -57, 69, -26, -90, -122, + 6, 7, 38, 101, -120, 48, 6, 6, 15, -69, 50, -71, -71, -76, 55, 55, + 6, 49, 67, -120, 49, 64, -58, 32, 97, -92, 22, 102, 23, -10, 5, 23, + 54, -74, 22, 118, 86, -10, -27, 22, -42, 86, -58, 105, -20, -83, -51, 37, + -52, -115, 76, -18, 45, -115, -52, 69, 110, -50, -123, -82, 108, -114, 110, 8, + 49, 6, -53, 24, 48, 60, -20, -62, -28, -66, -46, -36, -24, 24, -44, 12, + 33, -58, -64, 25, -125, -121, -120, 93, -104, -36, 23, -37, -101, -37, 25, 3, + -101, 33, -60, 24, 68, 99, 32, 49, -79, 11, -109, -5, 50, 99, 123, 11, + -93, 27, 66, -116, 1, 53, 6, 9, 21, -69, 48, -71, 47, -78, -73, 58, + 49, -74, 50, 6, 50, 67, -120, 49, -80, -58, -32, -94, 99, 23, 38, -9, + 21, -58, -58, -10, 54, 22, 70, -105, -10, -26, 70, 65, 6, 102, 8, 49, + 6, -39, 24, 104, 76, -20, -62, -28, -66, -62, -28, -28, -62, -14, -8, -16, + 12, -67, -71, -51, -47, -123, -71, -47, 5, -55, -55, -123, -27, -7, 12, 33, + -58, -128, 27, -125, -114, -118, 93, -104, -36, 23, -36, 91, -102, 27, -99, 12, + 13, -88, -73, 52, 55, 58, -103, 33, -60, 24, 124, 99, 0, 6, 116, -20, + -62, -28, -66, -32, -34, -46, -36, -24, 100, -66, -32, -24, -28, 120, -88, 64, + -67, -91, -71, -47, -55, 12, 33, -58, 64, 12, -58, 96, 12, 24, -48, 12, + 17, -58, -96, 12, -120, -104, -43, -71, -115, -47, -91, -67, -71, 13, 17, -58, + -32, 12, 24, -71, -96, -107, -79, -63, -107, -55, 125, -103, -43, -71, -115, -47, + -91, -67, -71, 89, 13, 17, -58, 32, 13, 72, -56, -67, -67, -47, 13, 17, + -58, 96, 13, -104, -92, -71, -115, -55, -107, -75, -107, -71, -47, 13, 17, -58, + -96, 13, 24, -64, 12, 17, -58, -32, 13, 40, -52, -44, 12, 17, -58, 32, + 14, -104, -52, -43, -75, -75, -123, -47, -91, -67, -71, -47, -103, -85, 107, 11, + 26, 27, -85, 107, -85, 99, 11, -93, 123, -109, 27, 66, -116, 1, 29, -116, + 65, -62, 101, -82, -82, 109, -24, -83, 77, 44, -51, -83, 76, 110, -120, 50, + 6, 115, 48, 6, 101, 48, 6, 117, 32, 1, 99, 96, 7, 67, -124, 49, + 0, 3, 6, 120, 28, -46, -36, -24, -122, 16, 99, -112, 7, 99, -96, 7, + 12, -14, -122, 16, 99, -64, 7, 99, -96, 7, 124, -34, -38, -36, -46, -32, + -34, -24, -54, -36, -24, 64, -58, -48, -62, -28, 24, 77, -91, -75, -63, -79, + -107, -127, 12, -67, 12, -83, -84, -128, 80, 9, 5, 5, 13, 17, -58, -32, + 15, -122, 8, 66, 53, -60, 24, 3, 63, 24, 3, 80, 16, -86, 33, -58, + 24, -24, -63, 24, -120, -126, 80, 13, 49, -58, 96, 20, -58, 96, 20, -124, + -118, 4, -37, -101, -37, -39, 16, 99, 12, 74, 97, 12, 68, 65, -88, -122, + 24, 99, 96, 10, 99, 96, 10, 66, -59, -62, -116, -19, 45, -116, 110, -120, + 49, 6, -88, 48, 6, -94, 32, 84, 67, -116, 49, 72, -123, 49, 72, 5, + -95, -94, 65, -10, 86, 39, -58, 86, 54, -60, 24, -125, 85, 24, 3, 81, + 16, -86, 33, -58, 24, -80, -62, 24, -80, -126, 80, 53, 98, 99, -77, 107, + 115, 105, 123, 35, -85, 99, 43, 115, 49, 99, 11, 59, -101, -101, 34, 12, + 69, 21, 54, 54, -69, 54, -105, 52, -78, 50, 55, -70, 41, -63, -47, 99, + 4, 78, 46, -20, -84, 45, 108, -118, -96, 52, 117, 70, -28, -26, -66, -54, + -16, -32, -34, -28, -24, -66, -20, -62, -28, -90, 32, -48, 84, 97, -101, 23, + 6, 100, 80, 104, 68, 110, -18, -21, 77, 76, -83, 108, -116, -18, 107, -114, + -19, -115, 110, 110, 74, 96, 6, 125, 70, -28, -26, -66, -54, -16, -32, -34, + -28, -24, -66, -52, -22, -36, -58, -90, 8, 104, -96, 6, -67, 70, -28, -26, + -66, -54, -16, -32, -34, -28, -24, -66, -52, -34, -28, -54, -62, -58, -48, -66, + -36, -62, -38, -54, -90, 8, 108, -32, 6, -107, 70, -28, -26, -66, -54, -16, + -32, -34, -28, -24, -66, -52, -34, -28, -54, -62, -58, -48, -90, 8, 112, 32, + 7, -115, 70, -28, -26, -66, -54, -16, -32, -34, -28, -24, -66, -28, -54, -56, + -22, -58, -54, -90, 4, 119, -48, 103, 68, 110, -18, -85, 12, 15, -18, 77, + -114, -18, -117, 46, 15, -82, 108, 74, -128, 7, 61, 74, -96, -34, -46, -36, + -24, 100, -90, 8, 123, -48, 7, 0, 121, 24, 0, 0, 92, 0, 0, 0, + 51, 8, -128, 28, -60, -31, 28, 102, 20, 1, 61, -120, 67, 56, -124, -61, + -116, 66, -128, 7, 121, 120, 7, 115, -104, 113, 12, -26, 0, 15, -19, 16, + 14, -12, -128, 14, 51, 12, 66, 30, -62, -63, 29, -50, -95, 28, 102, 48, + 5, 61, -120, 67, 56, -124, -125, 27, -52, 3, 61, -56, 67, 61, -116, 3, + 61, -52, 120, -116, 116, 112, 7, 123, 8, 7, 121, 72, -121, 112, 112, 7, + 122, 112, 3, 118, 120, -121, 112, 32, -121, 25, -52, 17, 14, -20, -112, 14, + -31, 48, 15, 110, 48, 15, -29, -16, 14, -16, 80, 14, 51, 16, -60, 29, + -34, 33, 28, -40, 33, 29, -62, 97, 30, 102, 48, -119, 59, -68, -125, 59, + -48, 67, 57, -76, 3, 60, -68, -125, 60, -124, 3, 59, -52, -16, 20, 118, + 96, 7, 123, 104, 7, 55, 104, -121, 114, 104, 7, 55, -128, -121, 112, -112, + -121, 112, 96, 7, 118, 40, 7, 118, -8, 5, 118, 120, -121, 119, -128, -121, + 95, 8, -121, 113, 24, -121, 114, -104, -121, 121, -104, -127, 44, -18, -16, 14, + -18, -32, 14, -11, -64, 14, -20, 48, 3, 98, -56, -95, 28, -28, -95, 28, + -52, -95, 28, -28, -95, 28, -36, 97, 28, -54, 33, 28, -60, -127, 29, -54, + 97, 6, -42, -112, 67, 57, -56, 67, 57, -104, 67, 57, -56, 67, 57, -72, + -61, 56, -108, 67, 56, -120, 3, 59, -108, -61, 47, -68, -125, 60, -4, -126, + 59, -44, 3, 59, -80, -61, 12, -57, 105, -121, 112, 88, -121, 114, 112, -125, + 116, 104, 7, 120, 96, -121, 116, 24, -121, 116, -96, -121, 25, -50, 83, 15, + -18, 0, 15, -14, 80, 14, -28, -112, 14, -29, 64, 15, -31, 32, 14, -20, + 80, 14, 51, 32, 40, 29, -36, -63, 30, -62, 65, 30, -46, 33, 28, -36, + -127, 30, -36, -32, 28, -28, -31, 29, -22, 1, 30, 102, 24, 81, 56, -80, + 67, 58, -100, -125, 59, -52, 80, 36, 118, 96, 7, 123, 104, 7, 55, 96, + -121, 119, 120, 7, 120, -104, 81, 76, -12, -112, 15, -16, 80, 14, 0, 0, + 113, 32, 0, 0, 56, 0, 0, 0, 6, 17, 6, -1, 92, -33, -111, -60, + 45, 4, 16, -95, 65, 66, 8, 83, 90, -33, -111, -12, 3, -53, -30, 8, + -64, -124, 56, -115, 13, 40, 21, 16, -3, -125, 67, 5, 11, 97, 5, 74, + 5, 68, -1, -29, 32, -51, 100, 27, 67, -126, 52, 66, 68, 48, 68, 51, + -103, 2, 82, 80, -115, 48, 33, 78, 99, 4, 73, 5, 68, 63, 16, 69, + 0, 102, 17, -111, 127, 16, -53, 67, 68, 127, 65, 53, -62, -124, 56, -51, + 107, 14, -117, 68, 49, -100, -61, 4, 72, 67, 68, 102, -32, 84, 64, -12, + 3, -53, -30, 8, -64, -124, 56, -115, 33, 112, 126, 36, -7, 17, 49, 80, + 2, -15, 23, -115, 47, 81, -116, 38, 8, 20, 67, 45, -64, -28, 68, 6, + 112, 84, 64, -12, 35, -51, 100, 13, -114, 68, 49, -102, 32, 80, 12, -75, + 0, -109, 19, 89, 0, 82, 1, -47, -65, 56, -115, 97, 7, 78, 5, 68, + -1, -29, 32, -51, 100, -1, -49, 20, -39, 3, -30, 71, -110, 63, 76, 78, + 100, 11, 73, 65, 53, -62, -124, 56, -51, 107, 2, 73, 5, 68, 127, -79, + 56, -64, 100, 9, -103, 31, 73, 126, 68, 12, -108, 64, -4, 69, -29, 75, + 20, -61, 57, 76, -128, 52, 68, 4, 97, 32, 0, 0, 54, 0, 0, 0, + 19, 4, 65, 44, 16, 0, 0, 0, 20, 0, 0, 0, 4, -108, 66, 49, + -108, 67, 17, 20, 68, 25, -108, 68, 81, -112, 80, 4, 20, 12, 101, 36, + 4, 32, 1, -45, 80, 70, 66, 0, 18, 16, 6, 67, 25, 9, 1, 72, + -64, 24, 12, 101, 44, 5, 32, 1, -46, 80, -58, 82, 0, 18, 48, 13, + 101, 36, 4, 32, 1, 18, 17, 99, 4, 32, 8, -126, 36, 24, -112, 49, + 70, 0, -126, 32, 8, -126, 32, 8, -126, 36, 72, 0, -125, 17, -64, 52, + 0, -125, 17, -127, 25, 16, -64, 96, -124, -48, 6, 3, 48, 24, 49, -72, + 1, 1, 12, 70, -80, -127, 55, 0, -125, 17, 103, -16, 13, -64, 96, 4, + 26, -128, -63, 0, 12, 70, -92, -127, 24, 12, -64, 96, -124, 26, -112, -63, + 0, 12, 70, -84, 65, 25, 12, 0, 6, -60, 0, 0, 13, 0, 0, 0, + 91, 6, 32, 32, -123, 45, 67, 16, -100, -62, -106, 65, 8, 84, 97, -53, + 48, 4, -83, -80, 101, 32, 2, 82, -40, 50, 20, 1, 41, 108, 25, -116, + -128, 20, -74, 12, 71, 64, 10, 91, 6, 36, 32, -123, 45, 67, 18, -112, + 2, 0, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, 11, 0, 0, 0, + 19, 4, -63, 96, 4, -32, 13, 0, -122, 3, 1, 0, 2, 0, 0, 0, + -26, 49, 0, -111, 1, 0, 0, 0, 1, 49, 0, 0, 2, 0, 0, 0, + 91, 6, 32, 32, 5, 0, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, + 11, 0, 0, 0, 19, 4, -63, 121, 64, -40, 55, -63, -32, -64, -32, -127, + 12, -125, 112, 32, 5, 0, 0, 0, -10, 65, 8, 78, 83, -103, -121, -128, + 52, 22, 82, 8, 78, 83, -43, 6, 50, 0, -61, 0, 0, 0, 0, 0, + 97, 32, 0, 0, 16, 0, 0, 0, 19, 4, 1, 121, -61, -64, -32, 3, + -63, 96, -124, 23, 6, 3, -128, -31, 64, 0, 0, 0, 4, 0, 0, 0, + -10, 49, 84, -64, 98, 30, 5, 32, 8, 20, 99, 33, 3, 48, 12, 0, + 1, 49, 0, 0, 3, 0, 0, 0, 91, 6, 32, 32, -123, 45, -125, 16, + -112, 2, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, 17, 0, 0, 0, + 19, 4, 1, 125, -125, -68, 97, 97, 0, 6, 32, 24, -116, -16, -60, 96, + 0, 48, 28, 8, 4, 0, 0, 0, -10, 49, 84, -64, 98, 30, 5, 32, + 8, 20, 99, 34, 3, 48, 12, 0, 1, 49, 0, 0, 4, 0, 0, 0, + 91, 6, 32, 32, -123, 45, 67, 16, -112, -62, -106, 97, 8, 72, 1, 0, + 0, 0, 0, 0, 97, 32, 0, 0, 3, 0, 0, 0, 19, 4, -63, -120, + 1, -127, 4, -112, -127, 0, 0, 0, 97, 32, 0, 0, 9, 0, 0, 0, + 19, 4, -63, 120, -125, 39, 73, -12, -115, 17, 3, 2, 8, 22, 48, -64, + 112, 32, 0, 0, 2, 0, 0, 0, 7, 80, 16, -51, 20, 97, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +const int bitCodeLength = 2776; + +#else + +const int8_t bitCode[] = { + -34, -64, 23, 11, 0, 0, 0, 0, 44, 0, 0, 0, -116, 10, 0, 0, + 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 1, 64, 4, 0, + 96, 9, 0, 0, 2, 64, 4, 0, 3, 0, 0, 0, 66, 67, -64, -34, + 33, 12, 0, 0, -96, 2, 0, 0, 1, 16, 0, 0, 18, 0, 0, 0, + 7, -127, 35, -111, 65, -56, 4, 73, 6, 16, 50, 57, -110, 1, -124, 12, + 37, 5, 8, 25, 30, 4, -117, 98, -128, 24, 69, 2, 66, -110, 11, 66, + -60, 16, 50, 20, 56, 8, 24, 73, 10, 50, 68, 36, 72, 10, -112, 33, + 35, -60, 82, -128, 12, 25, 33, 114, 36, 7, -56, -120, 17, 98, -88, -96, + -88, 64, -58, -16, 1, 0, 0, 0, 73, 24, 0, 0, 24, 0, 0, 0, + 11, -124, -1, -1, -1, -1, 31, -64, 96, -127, -16, -1, -1, -1, -1, 3, + 24, 45, 32, 2, 16, 4, 65, 16, 36, -2, -1, -1, -1, 127, 0, -125, + 5, 70, 0, -126, 32, 8, -126, -124, 0, -126, 32, 8, -126, -60, -1, -1, + -1, -1, 15, 96, -80, 64, -8, -1, -1, -1, -1, 1, 12, 22, 8, -1, + -1, -1, -1, 63, 0, 11, -120, 0, 4, 65, 16, 4, -119, -1, -1, -1, + -1, 31, -64, 80, 88, 64, 4, -64, -1, -1, -1, -1, 15, 96, 0, 0, + -119, 32, 0, 0, 34, 0, 0, 0, 50, 34, -120, 9, 32, 100, -123, 4, + 19, 35, -92, -124, 4, 19, 35, -29, -124, -95, -112, 20, 18, 76, -116, -116, + 11, -124, -60, 76, 16, -112, -63, 28, 1, 24, 16, 48, 71, 0, 10, 36, + -52, 0, 16, 49, 4, 64, 70, 18, 0, -124, 28, 36, 77, 17, 37, 76, + 126, -22, 32, -51, 100, -5, 61, -114, 4, 0, 32, -27, 46, 105, -118, 40, + 97, -14, 35, -23, 7, -106, -59, 17, -128, 9, 113, 26, -65, -49, 17, 49, + 12, -61, 64, 12, 45, 115, 4, 8, 61, 4, -115, 0, -108, 64, -94, -87, + 8, 18, 64, 85, 17, -98, -121, -82, 50, 72, 1, 64, 89, 25, -92, 32, + -96, -83, 8, 82, 67, -99, 9, 0, -6, -118, 32, -127, 20, 14, 4, 0, + 19, -76, 112, 8, 7, 121, 24, 7, 116, -80, 3, 58, 104, 3, 119, 120, + 7, 119, 40, -121, 54, 96, -121, 116, 112, -121, 122, -64, -121, 54, 56, 7, + 119, -88, -121, 114, 8, 7, 113, 72, -121, 13, 115, 80, 14, 109, -48, 14, + 122, 80, 14, 109, -112, 14, 120, -96, 7, 120, -96, 7, 115, 32, 7, 109, + -112, 14, 113, 96, 7, 122, 16, 7, 118, -96, 7, 115, 32, 7, 109, -112, + 14, 118, 64, 7, 122, 96, 7, 116, -48, 6, -23, 16, 7, 114, -128, 7, + 122, 16, 7, 114, -128, 7, 109, -32, 14, 115, 32, 7, 122, 96, 7, 116, + -48, 6, -77, 16, 7, 114, -128, 7, 58, 15, -92, 72, 32, 35, 68, 70, + -128, 29, 74, 0, 76, -56, 0, 0, 64, 0, -20, 80, 6, -128, 66, 8, + 0, 0, 2, 96, -121, 82, 0, 21, 50, 0, 0, 16, 0, 59, -108, 3, + -80, 16, 2, 0, -128, 0, -40, -95, 36, -64, -123, 12, 0, 0, 4, -64, + 14, 101, 1, 48, 100, 0, 0, 32, 0, -40, 104, -56, 29, -118, 3, 100, + 8, 1, 0, 64, 0, -20, 80, 34, 96, 3, 8, 0, 0, 2, 96, -121, + 18, 1, 28, 64, 0, 0, 16, 0, 67, 20, 10, 0, -128, 0, 0, 0, + 32, 24, -94, 88, 0, 0, 4, 0, 0, 0, -63, 16, 5, 3, 0, 64, + 0, 0, 0, 8, -122, 40, 26, 0, 12, 3, 0, 0, 0, 48, 68, -31, + 0, 96, 32, 0, 0, 0, -128, 33, 10, 5, 0, 64, 1, 0, 0, 16, + 12, 81, 60, 32, 0, 12, 0, 0, -128, 96, -120, 34, 6, 0, 0, 28, + 0, 0, 0, 65, 22, 8, 0, 0, 13, 0, 0, 0, 50, 30, -104, 20, + 25, 17, 76, -112, -116, 9, 38, 71, -58, 4, 67, 2, 70, 0, 72, 24, + 1, 32, 98, 4, -128, -116, 17, 0, 66, 70, 0, 72, 25, 1, -96, 101, + 4, -128, -104, 17, 0, -126, 108, -75, 6, 91, -50, 1, 0, 0, 0, 0, + 121, 24, 0, 0, -48, 0, 0, 0, 26, 3, 76, -112, 70, 2, 19, 68, + 62, 8, 114, 35, -109, 123, 75, 35, 3, 25, 99, 11, 115, 59, 3, -79, + 43, -109, -101, 75, 123, 115, 3, -103, 113, -63, 113, -111, -71, -87, -95, -63, + -127, 1, 1, 65, 17, 11, -101, 43, 35, 3, 121, 115, 3, 97, 98, -78, + 106, 2, -103, 113, -63, 113, -111, -71, -87, -95, -63, -127, 73, 25, 34, -116, + 1, -64, -61, -82, 76, 110, 46, -19, -51, -115, 65, -52, 16, 98, 12, -124, + 49, 24, 24, -87, -123, -39, -123, 125, -63, -123, -115, -83, -123, -99, -107, 125, + -71, -123, -75, -107, 113, 26, 123, 107, 115, 9, 115, 35, -109, 123, 75, 35, + 115, -111, -101, 115, -95, 43, -101, -93, 27, 66, -116, 65, 49, 6, 6, 15, + -69, 48, -71, -81, 52, 55, 58, 6, 53, 67, -120, 49, 64, -58, 32, 33, + 98, 23, 38, -9, -59, -10, -26, 118, -58, -64, 102, 8, 49, 6, -53, 24, + 48, 76, -20, -62, -28, -66, -52, -40, -34, -62, -24, -122, 16, 99, -32, -116, + -63, 64, -59, 46, 76, -18, -117, -20, -83, 78, -116, -83, -116, -127, -52, 16, + 98, 12, -96, 49, -120, -24, -40, -123, -55, 125, -123, -79, -79, -67, -115, -123, + -47, -91, -67, -71, 81, -112, -127, 25, 66, -116, -63, 52, 6, 20, 19, -69, + 48, -71, -81, 48, 57, -71, -80, 60, 62, 60, 67, 111, 110, 115, 116, 97, + 110, 116, 65, 114, 114, 97, 121, 62, 67, -120, 49, -80, -58, -32, -94, 98, + 23, 38, -9, 5, -9, -106, -26, 70, 39, 67, 3, -22, 45, -51, -115, 78, + 102, 8, 49, 6, -39, 24, 104, 116, -20, -62, -28, -66, -32, -34, -46, -36, + -24, 100, -66, -32, -24, -28, 120, -88, 64, -67, -91, -71, -47, -55, 12, 33, + -58, -128, 27, -125, -114, 1, -51, 16, 97, 12, 62, 34, 102, 117, 110, 99, + 116, 105, 111, 110, 67, -124, 49, 8, 3, 70, 46, 104, 101, 108, 112, 101, + 114, 95, 102, 117, 110, 99, 116, 105, 111, 110, 86, 67, -124, 49, 24, 3, + 18, 114, 111, 111, 116, 67, -124, 49, 40, 3, 38, 105, 110, 99, 114, 101, + 109, 101, 110, 116, 67, -124, 49, 56, 3, 6, 48, 67, -124, 49, 72, 3, + 10, 51, 53, 67, -124, 49, 88, 3, 38, 115, 117, 109, 109, 97, 116, 105, + 111, 110, 116, -26, -22, -38, -126, -58, -58, -22, -38, -22, -40, -62, -24, -34, + -28, -122, 16, 99, -32, 6, 99, 48, 112, -103, -85, 107, 27, 122, 107, 19, + 75, 115, 43, -109, 27, -94, -116, 65, 27, -116, -63, 55, 6, 111, 32, 1, + 99, 0, 7, 67, -124, 49, -48, 24, -32, 113, 72, 115, -93, 27, 66, -116, + -63, 28, -116, 1, 29, 48, -56, 27, 66, -116, -127, 29, -116, 1, 29, -16, + 121, 107, 115, 75, -125, 123, -93, 43, 115, -93, 3, 25, 67, 11, -109, 99, + 52, -107, -42, 6, -57, 86, 6, 50, -12, 50, -76, -78, 2, 66, 37, 20, + 20, 52, 68, 24, -125, 60, 24, 34, 8, -45, 16, 99, 12, -16, 96, 12, + -12, 64, -104, -122, 24, 99, 64, 7, 99, -64, 7, -62, 52, -60, 24, -125, + 62, 24, -125, 62, 16, 38, 18, 108, 111, 110, 103, 67, -116, 49, -8, -125, + 49, -32, 3, 97, 26, 98, -116, 1, 40, -116, 1, 40, 8, 19, 11, 51, + -74, -73, 48, -70, 33, -58, 24, -120, -62, 24, -16, -127, 48, 13, 49, -58, + 96, 20, -58, 96, 20, -124, -119, 6, -39, 91, -99, 24, 91, -39, 16, 99, + 12, 74, 97, 12, -8, 64, -104, -122, 24, 99, 96, 10, 99, 96, 10, -62, + 84, -123, -115, -51, -82, -51, 37, -115, -84, -52, -115, 110, 74, 16, -12, 24, + -127, -109, 11, 59, 107, 11, -101, 34, 16, 71, -99, 17, -71, -71, -81, 50, + 60, -72, 55, 57, -70, 47, -69, 48, -71, 41, -120, -46, 60, 82, -123, 109, + 94, -95, 17, -71, -71, -81, 55, 49, -75, -78, 49, -70, -81, 57, -74, 55, + -70, -71, 41, 1, 24, -12, 25, -111, -101, -5, 42, -61, -125, 123, -109, -93, + -5, 50, -85, 115, 27, -101, 34, -120, 1, 25, -12, 26, -111, -101, -5, 42, + -61, -125, 123, -109, -93, -5, 50, 123, -109, 43, 11, 27, 67, -5, 114, 11, + 107, 43, -101, 34, -104, 1, 26, 84, 26, -111, -101, -5, 42, -61, -125, 123, + -109, -93, -5, 50, 123, -109, 43, 11, 27, 67, -101, 34, -88, 1, 27, 52, + 26, -111, -101, -5, 42, -61, -125, 123, -109, -93, -5, -110, 43, 35, -85, 27, + 43, -101, 18, -60, 65, -97, 17, -71, -71, -81, 50, 60, -72, 55, 57, -70, + 47, -70, 60, -72, -78, 41, -127, 28, -12, 40, -127, 122, 75, 115, -93, -109, + -103, 34, -44, -63, 29, 0, 0, 0, 121, 24, 0, 0, 92, 0, 0, 0, + 51, 8, -128, 28, -60, -31, 28, 102, 20, 1, 61, -120, 67, 56, -124, -61, + -116, 66, -128, 7, 121, 120, 7, 115, -104, 113, 12, -26, 0, 15, -19, 16, + 14, -12, -128, 14, 51, 12, 66, 30, -62, -63, 29, -50, -95, 28, 102, 48, + 5, 61, -120, 67, 56, -124, -125, 27, -52, 3, 61, -56, 67, 61, -116, 3, + 61, -52, 120, -116, 116, 112, 7, 123, 8, 7, 121, 72, -121, 112, 112, 7, + 122, 112, 3, 118, 120, -121, 112, 32, -121, 25, -52, 17, 14, -20, -112, 14, + -31, 48, 15, 110, 48, 15, -29, -16, 14, -16, 80, 14, 51, 16, -60, 29, + -34, 33, 28, -40, 33, 29, -62, 97, 30, 102, 48, -119, 59, -68, -125, 59, + -48, 67, 57, -76, 3, 60, -68, -125, 60, -124, 3, 59, -52, -16, 20, 118, + 96, 7, 123, 104, 7, 55, 104, -121, 114, 104, 7, 55, -128, -121, 112, -112, + -121, 112, 96, 7, 118, 40, 7, 118, -8, 5, 118, 120, -121, 119, -128, -121, + 95, 8, -121, 113, 24, -121, 114, -104, -121, 121, -104, -127, 44, -18, -16, 14, + -18, -32, 14, -11, -64, 14, -20, 48, 3, 98, -56, -95, 28, -28, -95, 28, + -52, -95, 28, -28, -95, 28, -36, 97, 28, -54, 33, 28, -60, -127, 29, -54, + 97, 6, -42, -112, 67, 57, -56, 67, 57, -104, 67, 57, -56, 67, 57, -72, + -61, 56, -108, 67, 56, -120, 3, 59, -108, -61, 47, -68, -125, 60, -4, -126, + 59, -44, 3, 59, -80, -61, 12, -57, 105, -121, 112, 88, -121, 114, 112, -125, + 116, 104, 7, 120, 96, -121, 116, 24, -121, 116, -96, -121, 25, -50, 83, 15, + -18, 0, 15, -14, 80, 14, -28, -112, 14, -29, 64, 15, -31, 32, 14, -20, + 80, 14, 51, 32, 40, 29, -36, -63, 30, -62, 65, 30, -46, 33, 28, -36, + -127, 30, -36, -32, 28, -28, -31, 29, -22, 1, 30, 102, 24, 81, 56, -80, + 67, 58, -100, -125, 59, -52, 80, 36, 118, 96, 7, 123, 104, 7, 55, 96, + -121, 119, 120, 7, 120, -104, 81, 76, -12, -112, 15, -16, 80, 14, 0, 0, + 113, 32, 0, 0, 56, 0, 0, 0, 6, 17, 6, -1, 92, -33, -111, -60, + 45, 4, 16, -95, 65, 66, 8, 83, 90, -33, -111, -12, 3, -53, -30, 8, + -64, -124, 56, -115, 13, 40, 21, 16, -3, -125, 67, 5, 11, 97, 5, 74, + 5, 68, -1, -29, 32, -51, 100, 27, 67, -126, 52, 66, 68, 48, 68, 51, + -103, 2, 82, 80, -115, 48, 33, 78, 99, 4, 73, 5, 68, 63, 16, 69, + 0, 102, 17, -111, 127, 16, -53, 67, 68, 127, 65, 53, -62, -124, 56, -51, + 107, 14, -117, 68, 49, -100, -61, 4, 72, 67, 68, 102, -32, 84, 64, -12, + 3, -53, -30, 8, -64, -124, 56, -115, 33, 112, 126, 36, -7, 17, 49, 80, + 2, -15, 23, -115, 47, 81, -116, 38, 8, 20, 67, 45, -64, -28, 68, 6, + 112, 84, 64, -12, 35, -51, 100, 13, -114, 68, 49, -102, 32, 80, 12, -75, + 0, -109, 19, 89, 0, 82, 1, -47, -65, 56, -115, 97, 7, 78, 5, 68, + -1, -29, 32, -51, 100, -1, -49, 20, -39, 3, -30, 71, -110, 63, 76, 78, + 100, 11, 73, 65, 53, -62, -124, 56, -51, 107, 2, 73, 5, 68, 127, -79, + 56, -64, 100, 9, -103, 31, 73, 126, 68, 12, -108, 64, -4, 69, -29, 75, + 20, -61, 57, 76, -128, 52, 68, 4, 97, 32, 0, 0, 55, 0, 0, 0, + 19, 4, 65, 44, 16, 0, 0, 0, 21, 0, 0, 0, 4, -108, 64, 41, + 20, 67, 57, 20, 68, 73, 20, 5, 9, 101, 80, 2, 69, 64, -63, 80, + 70, 66, 8, -109, 48, 6, 67, 25, 75, 33, 76, -128, 52, -108, -79, 20, + -62, 4, 112, 67, 25, 9, 33, 76, 66, 25, 12, 101, 36, -124, 48, 9, + 100, 48, -108, -111, 16, -62, 36, 76, 68, -116, 17, -128, 32, 8, -110, 96, + 64, -58, 24, 1, 8, -126, 32, 8, -126, 32, 8, -110, 32, 1, 0, 0, + -125, 17, 0, 55, 0, -125, 17, 65, 25, 16, -64, 96, -124, -64, 6, 3, + 48, 24, 49, -76, 1, 1, 12, 70, -84, 65, 55, 0, -125, 17, 106, -32, + 13, -64, 96, 68, 26, 124, 3, 48, 24, 97, 6, 96, 48, 0, -125, 17, + 103, 16, 6, 3, 48, 24, -127, 6, 98, 48, 0, 24, 16, 3, 0, 0, + 13, 0, 0, 0, 91, 6, 32, -16, -125, 45, 67, 16, -124, -62, -106, 65, + 8, 72, 97, -53, 48, 4, -89, -80, 101, 32, 2, 63, -40, 50, 20, -127, + 31, 108, 25, -116, -64, 15, -74, 12, 71, -32, 7, 91, 6, 36, -16, -125, + 45, 67, 18, -8, 1, 0, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, + 11, 0, 0, 0, 19, 4, -63, 96, 4, -64, 13, 0, -122, 3, 1, 0, + 2, 0, 0, 0, -58, 49, 0, -111, 1, 0, 0, 0, 1, 49, 0, 0, + 2, 0, 0, 0, 91, 6, 32, -16, 3, 0, 0, 0, 0, 0, 0, 0, + 97, 32, 0, 0, 15, 0, 0, 0, 19, 4, 65, 44, 16, 0, 0, 0, + 1, 0, 0, 0, 4, -108, 0, 0, -57, 1, 97, 94, 7, -125, -5, 30, + 72, 48, 8, 7, 2, 0, 0, 0, 5, 0, 0, 0, -26, 65, 8, 78, + 83, 25, -121, -128, 52, 6, 82, 8, 78, 83, -43, -10, 49, 0, -61, 0, + 0, 0, 0, 0, 97, 32, 0, 0, 15, 0, 0, 0, 19, 4, 1, 113, + -61, -68, 14, 4, -125, 17, -36, 55, 0, 24, 14, 4, 4, 0, 0, 0, + -42, 49, 84, -64, 98, 28, 5, 32, 8, 20, 99, 31, 3, 48, 12, 0, + 1, 49, 0, 0, 3, 0, 0, 0, 91, 6, 32, -16, -125, 45, -125, 16, + -8, 1, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, 17, 0, 0, 0, + 19, 4, 1, 117, -125, -72, 97, -97, 7, -126, -63, 8, 14, 12, 6, 0, + -61, -127, 0, 0, 4, 0, 0, 0, -42, 49, 84, -64, 98, 28, 5, 32, + 8, 20, 99, 32, 3, 48, 12, 0, 1, 49, 0, 0, 4, 0, 0, 0, + 91, 6, 32, -16, -125, 45, 67, 16, -8, -63, -106, 97, 8, -4, 0, 0, + 0, 0, 0, 0, 97, 32, 0, 0, 3, 0, 0, 0, 19, 4, -63, -120, + 1, -127, 4, -112, -127, 0, 0, 0, 97, 32, 0, 0, 9, 0, 0, 0, + 19, 4, -63, 120, 3, 55, 73, -44, -115, 17, 3, 2, 8, 22, 15, -61, + -127, 0, 0, 0, 2, 0, 0, 0, 7, 80, 16, -51, 20, 97, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +const int bitCodeLength = 2744; + +#endif diff --git a/renderscript/Android.bp b/renderscript/Android.bp index ba90f2c9d..ed19a3703 100644 --- a/renderscript/Android.bp +++ b/renderscript/Android.bp @@ -2,4 +2,5 @@ subdirs = [ "1.0", "1.0/default", + "1.0/vts/functional", ] |