From 91f4ba45449f700a047a4aeea00b1a7c84e94c75 Mon Sep 17 00:00:00 2001 From: Chunseok Lee Date: Tue, 18 Sep 2018 16:53:40 +0900 Subject: Imported Upstream version 0.2 --- .ctags | 6 + .gitignore | 34 +- .gitmodules | 8 +- CMakeLists.txt | 195 +- LICENSE | 416 +- Makefile | 59 +- README.md | 33 +- benchmark/CMakeLists.txt | 3 + benchmark/acl/Benchmark.cpp | 74 + benchmark/acl/Benchmark.h | 82 + benchmark/acl/CMakeLists.txt | 20 + benchmark/acl/benchmark_googlenet.cpp | 242 + benchmark/acl/benchmark_inception_v3.cpp | 891 + benchmark/acl/benchmark_mobilenet.cpp | 265 + cmake/ApplyCompileFlags.cmake | 15 + cmake/CfgOptionFlags.cmake | 23 + cmake/config/config_aarch64-linux.cmake | 7 +- cmake/config/config_aarch64-tizen.cmake | 1 - cmake/config/config_armv7l-linux.cmake | 3 +- cmake/config/config_armv7l-tizen.cmake | 1 - cmake/modules/ExternalProjectTools.cmake | 5 + cmake/modules/ExternalSourceTools.cmake | 49 + cmake/modules/OptionTools.cmake | 11 + cmake/option/identify_platform.cmake | 48 + cmake/option/option_arm64-android.cmake | 5 + cmake/option/option_armv7l-linux.cmake | 10 + cmake/option/option_linux.cmake | 24 + cmake/packages/ARMCompute/CMakeLists.txt | 153 + cmake/packages/ARMComputeConfig.cmake | 88 + cmake/packages/EigenConfig.cmake | 17 + cmake/packages/EigenSourceConfig.cmake | 19 + cmake/packages/FarmhashSourceConfig.cmake | 19 + cmake/packages/FlatBuffersConfig.cmake | 73 + cmake/packages/FlatBuffersSourceConfig.cmake | 19 + cmake/packages/GEMMLowpSourceConfig.cmake | 19 + cmake/packages/GTestConfig.cmake | 49 + cmake/packages/NEON2SSESourceConfig.cmake | 19 + cmake/packages/TensorFlowSourceConfig.cmake | 18 + cmake/packages/TensorflowConfig.cmake | 44 + contrib/CMakeLists.txt | 6 + contrib/README.md | 10 + contrib/TFLiteSharp/README.md | 92 + contrib/TFLiteSharp/TFLiteNative/CMakeLists.txt | 67 + .../TFLiteSharp/TFLiteNative/include/tflite_log.h | 65 + .../TFLiteNative/include/tflite_nativewrapper.h | 56 + .../TFLiteNative/src/tflite_nativewrapper.cpp | 142 + .../TFLiteSharp/TFLiteNative/tflite-native.pc.in | 13 + contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp.sln | 25 + .../TFLiteSharp/Interop/Interop.Libraries.cs | 23 + .../TFLiteSharp/Interop/Interop.TFLite.cs | 37 + .../TFLiteSharp/TFLiteSharp/TFLiteSharp.csproj | 52 + .../TFLiteSharp/TFLiteSharp/src/Datatype.cs | 31 + .../TFLiteSharp/TFLiteSharp/src/Interpreter.cs | 263 + .../TFLiteSharpTest/TFLiteSharpTest.sln | 31 + .../TFLiteSharpTest/TFLiteSharpTest/Program.cs | 38 + .../TFLiteSharpTest/TFLiteSharpTest.csproj | 12 + .../TFLiteSharp/TFLiteTestApp/TFLiteTestApp.csproj | 54 + .../TFLiteSharp/TFLiteTestApp/TFLiteTestApp_App.cs | 65 + .../TFLiteTestApp/TFLiteTestApp_Main.cs | 20 + .../TFLiteTestApp/res/mobilenet_v1_1.0_224.tflite | Bin 0 -> 16900960 bytes contrib/TFLiteSharp/TFLiteTestApp/res/mouse1.bmp | Bin 0 -> 2764854 bytes .../TFLiteSharp/TFLiteTestApp/res/mouse_224.bmp | Bin 0 -> 150582 bytes .../TFLiteTestApp/shared/res/TFLiteTestApp.png | Bin 0 -> 10097 bytes .../TFLiteSharp/TFLiteTestApp/tizen-manifest.xml | 14 + contrib/TFLiteSharp/packaging/TFLiteSharp.manifest | 5 + contrib/TFLiteSharp/packaging/TFLiteSharp.spec | 103 + .../TFLiteSharp/packaging/tflite-native.manifest | 5 + contrib/bindacl/CMakeLists.txt | 20 + contrib/bindacl/README.md | 13 + contrib/bindacl/src/nnapi_acl.cc | 264 + contrib/convacl/CMakeLists.txt | 20 + contrib/convacl/src/io_accessor.cc | 110 + contrib/convacl/src/io_accessor.h | 93 + contrib/convacl/src/nnapi_acl_conv.cc | 239 + contrib/detection/CMakeLists.txt | 11 + contrib/detection/detection.cpp | 57 + contrib/example/CMakeLists.txt | 1 + contrib/example/example.cpp | 23 + contrib/jniacl/CMakeLists.txt | 22 + contrib/jniacl/src/io_accessor.cc | 100 + contrib/jniacl/src/io_accessor.h | 93 + contrib/jniacl/src/jniacl_main.cc | 39 + contrib/kerneltesting/CMakeLists.txt | 23 + contrib/kerneltesting/conv2d/CMakeLists.txt | 15 + contrib/kerneltesting/conv2d/OperationUtils.h | 90 + contrib/kerneltesting/conv2d/common.h | 89 + contrib/kerneltesting/conv2d/compatibility.h | 78 + contrib/kerneltesting/conv2d/io_accessor.cpp | 124 + contrib/kerneltesting/conv2d/io_accessor.h | 104 + contrib/kerneltesting/conv2d/nnfw_conv2d_test.cpp | 607 + contrib/kerneltesting/conv2d/optimized_ops.h | 339 + contrib/kerneltesting/conv2d/types.h | 146 + contrib/opencl_test/CMakeLists.txt | 11 + contrib/opencl_test/README.md | 8 + contrib/opencl_test/src/opencl_test.cc | 252 + contrib/tf_test/CMakeLists.txt | 12 + contrib/tf_test/tf_test.cpp | 236 + docs/HowToContribute.md | 72 + docs/HowToImplementOperatorKernel.md | 1 + docs/doxygen/Doxyfile | 2500 +++ docs/fig/nnfw_architecture.png | Bin 0 -> 28876 bytes docs/fig/nnfw_architecture.pptx | Bin 0 -> 72036 bytes docs/fig/nnfw_behavior.png | Bin 0 -> 14254 bytes docs/fig/nnfw_behavior.pptx | Bin 0 -> 59844 bytes docs/howto.md | 36 + docs/howto/BuildTFfromSource.md | 66 + docs/howto/CrossBuildForAarch64.md | 81 + docs/howto/CrossBuildForArm.md | 107 + docs/howto/HowToAddUnittest.md | 10 +- docs/howto/HowToUseDockerImage.md | 135 + docs/howto/device/xu3-dip.png | Bin 0 -> 262925 bytes docs/howto/device/xu3_ubuntu.md | 114 + docs/howto/device/xu4_tizen.md | 247 + docs/howto/device/xu4_ubuntu.md | 99 + docs/project/2018_high_level_design.md | 79 + docs/project/2018_requirement_specification.md | 113 + docs/roadmap.md | 123 + docs/tests/Convolution_manual_3x3.xlsx | Bin 0 -> 19844 bytes docs/tests/Softmax_manual.xlsx | Bin 0 -> 15940 bytes docs/workgroups.md | 19 + externals/CMakeLists.txt | 104 +- externals/acl.cmake | 150 - externals/eigen3.cmake | 12 - externals/nnapi_test_generator/README.md | 11 + .../nnapi_test_generator/include/TestHarness.h | 209 + externals/nnapi_test_generator/slicing.py | 167 + externals/nnapi_test_generator/test_generator.py | 775 + .../tests/P_conv/conv_1_h3_w2_SAME.mod.py | 11 + .../tests/P_conv/stderr.txt.expect | 2 + .../tests/P_conv/stdout.txt.expect | 41 + .../P_depthwise_conv/depthwise_conv.bin.mod.py | 11 + .../tests/P_depthwise_conv/stderr.txt.expect | 2 + .../tests/P_depthwise_conv/stdout.txt.expect | 43 + .../tests/P_explicit/explicit_add.mod.py | 7 + .../tests/P_explicit/stderr.txt.expect | 2 + .../tests/P_explicit/stdout.txt.expect | 21 + .../tests/P_float/addfloat.mod.py | 8 + .../tests/P_float/stderr.txt.expect | 2 + .../tests/P_float/stdout.txt.expect | 23 + .../tests/P_full/addfloat.mod.py | 22 + .../tests/P_full/stderr.txt.expect | 2 + .../tests/P_full/stdout.txt.expect | 46 + .../nnapi_test_generator/tests/P_lstm/lstm.mod.py | 161 + .../tests/P_lstm/stderr.txt.expect | 2 + .../tests/P_lstm/stdout.txt.expect | 75 + .../tests/P_quantized_avgpool/averpoolfloat.mod.py | 20 + .../tests/P_quantized_avgpool/stderr.txt.expect | 2 + .../tests/P_quantized_avgpool/stdout.txt.expect | 48 + .../tests/P_quantized_conv/quantized.mod.py | 11 + .../tests/P_quantized_conv/stderr.txt.expect | 2 + .../tests/P_quantized_conv/stdout.txt.expect | 40 + .../tests/P_vts_full/stderr.txt.expect | 2 + .../tests/P_vts_full/stdout.txt.expect | 93 + .../tests/P_vts_full/vts_full.mod.py | 19 + .../tests/P_vts_operands/addfloat.mod.py | 12 + .../tests/P_vts_operands/stderr.txt.expect | 2 + .../tests/P_vts_operands/stdout.txt.expect | 103 + .../tests/P_weird/stderr.txt.expect | 2 + .../tests/P_weird/stdout.txt.expect | 51 + .../tests/P_weird/weird_add.mod.py | 29 + externals/nnapi_test_generator/tests/test.py | 328 + externals/nnapi_test_generator/vts_generator.py | 247 + include/NeuralNetworks.h | 1675 +- include/NeuralNetworksEx.h | 65 + include/NeuralNetworksExShim.h | 60 + include/NeuralNetworksLoadHelpers.h | 76 + include/NeuralNetworksShim.h | 675 + include/kernel/acl/Add.h | 44 + include/kernel/acl/Mul.h | 43 + include/kernel/acl/ReLU.h | 40 + include/kernel/acl/ReLU6.h | 45 + include/nnfw/std/memory.h | 17 + include/support/nnapi/Utils.h | 35 + include/support/nnapi/feature/Reader.h | 10 +- include/support/tflite/Assert.h | 38 + include/support/tflite/Diff.h | 92 +- include/support/tflite/InterpreterSession.h | 73 + include/support/tflite/NNAPISession.h | 77 + include/support/tflite/Quantization.h | 31 + include/support/tflite/Session.h | 44 + include/support/tflite/TensorLogger.h | 166 + include/support/tflite/TensorShapeUtils.h | 51 + include/support/tflite/TensorView.h | 42 +- include/support/tflite/kernels/CustomOps.h | 52 + include/support/tflite/kernels/RSQRT.h | 44 + include/support/tflite/kernels/SquaredDifference.h | 44 + include/support/tflite/kernels/TensorFlowMax.h | 44 + include/support/tflite/kernels/register.h | 40 + include/support/tflite/nnapi_delegate.h | 84 + include/util/EnvVar.h | 77 + include/util/benchmark.h | 63 + include/util/environment.h | 74 + include/util/feature/Index.h | 67 + include/util/feature/IndexIterator.h | 72 + include/util/feature/Object.h | 79 + include/util/feature/Reader.h | 41 + include/util/feature/Shape.h | 51 + include/util/feature/TextFormatter.h | 82 + include/util/fp32.h | 71 + include/util/kernel/IndexIterator.h | 72 + include/util/kernel/RandomObject.h | 71 + include/util/kernel/Reader.h | 40 + include/util/kernel/Shape.h | 48 + include/util/matrix/IndexIterator.h | 66 + include/util/matrix/Reader.h | 40 + include/util/matrix/Shape.h | 46 + include/util/profiling/profile_buffer.h | 162 + include/util/profiling/profiler.h | 195 + include/util/profiling/profiling.h | 79 + include/util/profiling/time.h | 43 + include/util/tensor/Comparator.h | 65 + include/util/tensor/Diff.h | 51 + include/util/tensor/Index.h | 69 + include/util/tensor/IndexEnumerator.h | 101 + include/util/tensor/IndexFormatter.h | 52 + include/util/tensor/IndexIterator.h | 70 + include/util/tensor/NonIncreasingStride.h | 61 + include/util/tensor/Object.h | 72 + include/util/tensor/Reader.h | 40 + include/util/tensor/Shape.h | 84 + include/util/tensor/Zipper.h | 69 + include/util/vector.h | 40 + include/util/vector/Object.h | 63 + include/util/vector/Reader.h | 40 + libs/.FORMATCHECKED | 0 libs/ARMComputeEx/CMakeLists.txt | 21 + .../arm_compute/core/CL/CLKernelLibraryEx.h | 189 + .../arm_compute/core/CL/kernels/CLCastKernel.h | 57 + .../arm_compute/core/CL/kernels/CLGatherKernel.h | 71 + .../core/CL/kernels/CLPixelWiseDivisionKernel.h | 87 + .../core/CL/kernels/CLReduceMaxKernel.h | 73 + .../core/CL/kernels/CLReductionMeanKernel.h | 78 + .../core/CL/kernels/CLStridedSliceKernel.h | 106 + .../arm_compute/core/CL/kernels/CLTopKV2Kernel.h | 301 + .../arm_compute/runtime/CL/functions/CLCast.h | 45 + .../arm_compute/runtime/CL/functions/CLGather.h | 49 + .../runtime/CL/functions/CLPixelWiseDivision.h | 72 + .../arm_compute/runtime/CL/functions/CLReduceMax.h | 81 + .../runtime/CL/functions/CLReductionMean.h | 73 + .../runtime/CL/functions/CLStridedSlice.h | 69 + .../arm_compute/runtime/CL/functions/CLTopKV2.h | 109 + libs/ARMComputeEx/resolve_includes.py | 102 + libs/ARMComputeEx/src/core/CL/CLKernelLibrary.cpp | 547 + .../core/CL/cl_kernels/arithmetic_op_quantized.cl | 138 + libs/ARMComputeEx/src/core/CL/cl_kernels/cast.cl | 148 + .../src/core/CL/cl_kernels/fixed_point.h | 565 + libs/ARMComputeEx/src/core/CL/cl_kernels/gather.cl | 106 + libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h | 344 + .../src/core/CL/cl_kernels/helpers_asymm.h | 406 + .../src/core/CL/cl_kernels/pixelwise_div_float.cl | 96 + .../src/core/CL/cl_kernels/pixelwise_div_int.cl | 103 + .../core/CL/cl_kernels/pixelwise_mul_quantized.cl | 119 + .../src/core/CL/cl_kernels/reduce_max.cl | 60 + .../src/core/CL/cl_kernels/reduction_mean.cl | 69 + .../src/core/CL/cl_kernels/strided_slice.cl | 104 + libs/ARMComputeEx/src/core/CL/cl_kernels/topkv2.cl | 111 + .../src/core/CL/cl_kernels/topkv2_quicksort.cl | 138 + .../src/core/CL/cl_kernels/topkv2_radixsort.cl | 279 + .../src/core/CL/kernels/CLCastKernel.cpp | 109 + .../src/core/CL/kernels/CLGatherKernel.cpp | 142 + .../core/CL/kernels/CLPixelWiseDivisionKernel.cpp | 322 + .../src/core/CL/kernels/CLReduceMaxKernel.cpp | 129 + .../src/core/CL/kernels/CLReductionMeanKernel.cpp | 198 + .../src/core/CL/kernels/CLStridedSliceKernel.cpp | 304 + .../src/core/CL/kernels/CLTopKV2Kernel.cpp | 475 + .../src/runtime/CL/functions/CLCast.cpp | 29 + .../src/runtime/CL/functions/CLGather.cpp | 38 + .../runtime/CL/functions/CLPixelWiseDivision.cpp | 52 + .../src/runtime/CL/functions/CLReduceMax.cpp | 121 + .../src/runtime/CL/functions/CLReductionMean.cpp | 51 + .../src/runtime/CL/functions/CLStridedSlice.cpp | 307 + .../src/runtime/CL/functions/CLTopKV2.cpp | 305 + libs/ARMComputeEx/src/runtime/topk_v2.h | 143 + libs/CMakeLists.txt | 4 +- libs/kernel/CMakeLists.txt | 3 - libs/kernel/acl/CMakeLists.txt | 94 - libs/kernel/acl/src/CLUniqueTensor.h | 63 - libs/kernel/acl/src/DepthwiseConv2D.h | 98 - libs/kernel/acl/src/DepthwiseConv2D.test.h | 245 - libs/kernel/acl/src/FullyConnected.h | 149 - libs/kernel/acl/src/FullyConnected.test.h | 266 - libs/kernel/acl/src/IO_accessor.cpp | 310 - libs/kernel/acl/src/IO_accessor.h | 196 - libs/kernel/acl/src/Init_acl.cpp | 32 - libs/kernel/acl/src/NEUniqueTensor.h | 64 - libs/kernel/acl/src/Reshape.h | 70 - libs/kernel/acl/src/Reshape.test.h | 51 - libs/kernel/acl/src/cl/Concatenation.cpp | 104 - libs/kernel/acl/src/cl/Concatenation.test.cpp | 62 - libs/kernel/acl/src/cl/Conv2D.cpp | 113 - libs/kernel/acl/src/cl/Conv2D.test.cpp | 202 - libs/kernel/acl/src/cl/DepthwiseConv2D.cpp | 60 - libs/kernel/acl/src/cl/DepthwiseConv2D.test.cpp | 20 - libs/kernel/acl/src/cl/FullyConnected.cpp | 53 - libs/kernel/acl/src/cl/FullyConnected.test.cpp | 20 - libs/kernel/acl/src/cl/Pooling.cpp | 130 - libs/kernel/acl/src/cl/Pooling.test.cpp | 482 - libs/kernel/acl/src/cl/Reshape.cpp | 43 - libs/kernel/acl/src/cl/Reshape.test.cpp | 20 - libs/kernel/acl/src/cl/Softmax.cpp | 78 - libs/kernel/acl/src/cl/Softmax.test.cpp | 105 - libs/kernel/acl/src/gtest_env.cpp | 37 - libs/kernel/acl/src/neon/Concatenation.cpp | 105 - libs/kernel/acl/src/neon/Concatenation.test.cpp | 62 - libs/kernel/acl/src/neon/Conv2D.cpp | 111 - libs/kernel/acl/src/neon/Conv2D.test.cpp | 202 - libs/kernel/acl/src/neon/DepthwiseConv2D.cpp | 61 - libs/kernel/acl/src/neon/DepthwiseConv2D.test.cpp | 20 - libs/kernel/acl/src/neon/FullyConnected.cpp | 58 - libs/kernel/acl/src/neon/FullyConnected.test.cpp | 21 - libs/kernel/acl/src/neon/Pooling.cpp | 128 - libs/kernel/acl/src/neon/Pooling.test.cpp | 436 - libs/kernel/acl/src/neon/Reshape.cpp | 48 - libs/kernel/acl/src/neon/Reshape.test.cpp | 20 - libs/kernel/acl/src/neon/Softmax.cpp | 77 - libs/kernel/acl/src/neon/Softmax.test.cpp | 105 - libs/kernel/acl/src/shape.cpp | 89 - libs/kernel/acl/src/shape.h | 93 - libs/kernel/acl/src/support.cpp | 51 - libs/kernel/acl/src/support.h | 93 - libs/kernel/acl/src/util.cpp | 108 - libs/kernel/acl/src/util.h | 193 - libs/support/nnapi/CMakeLists.txt | 2 +- libs/support/nnapi/src/Utils.cpp | 29 + libs/support/tflite/CMakeLists.txt | 6 +- libs/support/tflite/src/Diff.cpp | 478 +- libs/support/tflite/src/FeatureView.cpp | 7 +- libs/support/tflite/src/Quantization.cpp | 22 + libs/support/tflite/src/TensorShapeUtils.cpp | 51 + libs/support/tflite/src/TensorView.cpp | 69 - libs/support/tflite/src/TensorView.test.cpp | 19 +- .../tflite/src/interp/FlatBufferBuilder.cpp | 2 +- libs/support/tflite/src/kernels/RSQRT.cpp | 83 + .../tflite/src/kernels/SquaredDifference.cpp | 115 + libs/support/tflite/src/kernels/TensorFlowMax.cpp | 390 + libs/support/tflite/src/kernels/register.cpp | 169 + libs/support/tflite/src/nnapi_delegate.cpp | 720 + .../nnapi_delegate_ex_AddOpsAndParams_lambda.inc | 41 + libs/util/CMakeLists.txt | 10 +- libs/util/examples/tensor_index_iterator.cpp | 40 +- libs/util/include/util/benchmark.h | 66 - libs/util/include/util/environment.h | 63 - libs/util/include/util/feature/Index.h | 60 - libs/util/include/util/feature/IndexIterator.h | 69 - libs/util/include/util/feature/Object.h | 79 - libs/util/include/util/feature/Reader.h | 40 - libs/util/include/util/feature/Shape.h | 47 - libs/util/include/util/feature/TextFormatter.h | 84 - libs/util/include/util/fp32.h | 71 - libs/util/include/util/kernel/IndexIterator.h | 72 - libs/util/include/util/kernel/RandomObject.h | 71 - libs/util/include/util/kernel/Reader.h | 40 - libs/util/include/util/kernel/Shape.h | 48 - libs/util/include/util/tensor/Index.h | 62 - libs/util/include/util/tensor/IndexFormatter.h | 52 - libs/util/include/util/tensor/IndexIterator.h | 104 - .../util/include/util/tensor/NonIncreasingStride.h | 61 - libs/util/include/util/tensor/Object.h | 77 - libs/util/include/util/tensor/Reader.h | 40 - libs/util/include/util/tensor/Shape.h | 63 - libs/util/include/util/tensor/Zipper.h | 72 - libs/util/include/util/vector.h | 41 - libs/util/include/util/vector/Object.h | 63 - libs/util/include/util/vector/Reader.h | 40 - libs/util/src/environment.cpp | 32 +- libs/util/src/profiling/time.cc | 49 + libs/util/src/tensor/Comparator.cpp | 40 + libs/util/src/tensor/Shape.cpp | 55 +- packaging/nnfw.spec | 25 +- runtimes/CMakeLists.txt | 22 +- runtimes/logging/CMakeLists.txt | 5 + runtimes/logging/include/operand.def | 12 + runtimes/logging/include/operation.def | 15 + runtimes/logging/src/nnapi_logging.cc | 404 + runtimes/neurun/.FORMATCHECKED | 0 runtimes/neurun/CMakeLists.txt | 63 + runtimes/neurun/src/backend/BackendManager.cc | 88 + runtimes/neurun/src/backend/BackendManager.h | 73 + runtimes/neurun/src/backend/CMakeLists.txt | 2 + runtimes/neurun/src/backend/IBackendConfig.h | 39 + .../neurun/src/backend/IInitializerGenerator.h | 46 + runtimes/neurun/src/backend/IObject.h | 42 + runtimes/neurun/src/backend/IStageGenerator.h | 68 + runtimes/neurun/src/backend/ITensorBuilder.h | 57 + .../neurun/src/backend/acl_cl/BackendConfig.cc | 32 + runtimes/neurun/src/backend/acl_cl/BackendConfig.h | 45 + runtimes/neurun/src/backend/acl_cl/CMakeLists.txt | 17 + .../src/backend/acl_cl/InitializerGenerator.cc | 144 + .../src/backend/acl_cl/InitializerGenerator.h | 50 + .../neurun/src/backend/acl_cl/StageGenerator.cc | 538 + .../neurun/src/backend/acl_cl/StageGenerator.h | 58 + .../neurun/src/backend/acl_cl/TensorBuilder.cc | 79 + runtimes/neurun/src/backend/acl_cl/TensorBuilder.h | 57 + runtimes/neurun/src/backend/acl_cl/feature/View.h | 110 + runtimes/neurun/src/backend/acl_cl/kernel/View.h | 87 + .../neurun/src/backend/acl_cl/operand/Object.cc | 42 + .../neurun/src/backend/acl_cl/operand/Object.h | 60 + runtimes/neurun/src/backend/cpu/BackendConfig.cc | 33 + runtimes/neurun/src/backend/cpu/BackendConfig.h | 45 + runtimes/neurun/src/backend/cpu/CMakeLists.txt | 19 + .../neurun/src/backend/cpu/InitializerGenerator.cc | 208 + .../neurun/src/backend/cpu/InitializerGenerator.h | 50 + runtimes/neurun/src/backend/cpu/MemoryAllocator.cc | 17 + runtimes/neurun/src/backend/cpu/MemoryAllocator.h | 123 + runtimes/neurun/src/backend/cpu/StageGenerator.cc | 536 + runtimes/neurun/src/backend/cpu/StageGenerator.h | 59 + runtimes/neurun/src/backend/cpu/TensorBuilder.cc | 73 + runtimes/neurun/src/backend/cpu/TensorBuilder.h | 57 + runtimes/neurun/src/backend/cpu/operand/Object.cc | 36 + runtimes/neurun/src/backend/cpu/operand/Object.h | 60 + runtimes/neurun/src/backend/cpu/operand/Tensor.cc | 33 + runtimes/neurun/src/backend/cpu/operand/Tensor.h | 72 + runtimes/neurun/src/codegen/BackendResolver.cc | 27 + runtimes/neurun/src/codegen/BackendResolver.h | 82 + runtimes/neurun/src/codegen/IPlanBuilder.h | 43 + runtimes/neurun/src/codegen/Plan.cc | 27 + runtimes/neurun/src/codegen/Plan.h | 58 + runtimes/neurun/src/codegen/PlanBuilder.cc | 75 + runtimes/neurun/src/codegen/PlanBuilder.h | 86 + runtimes/neurun/src/codegen/Planner.cc | 253 + runtimes/neurun/src/codegen/Planner.h | 67 + runtimes/neurun/src/codegen/operand/Context.cc | 35 + runtimes/neurun/src/codegen/operand/Context.h | 64 + runtimes/neurun/src/codegen/operation/Sequence.cc | 30 + runtimes/neurun/src/codegen/operation/Sequence.h | 55 + runtimes/neurun/src/exec/Sink.h | 123 + runtimes/neurun/src/exec/Source.h | 126 + runtimes/neurun/src/frontend/compilation.cc | 73 + runtimes/neurun/src/frontend/event.cc | 31 + runtimes/neurun/src/frontend/execution.cc | 235 + runtimes/neurun/src/frontend/memory.cc | 45 + runtimes/neurun/src/frontend/model.cc | 434 + .../neurun/src/frontend/wrapper/compilation.cc | 66 + runtimes/neurun/src/frontend/wrapper/compilation.h | 43 + runtimes/neurun/src/frontend/wrapper/event.h | 24 + runtimes/neurun/src/frontend/wrapper/execution.h | 69 + runtimes/neurun/src/frontend/wrapper/memory.cc | 31 + runtimes/neurun/src/frontend/wrapper/memory.h | 38 + runtimes/neurun/src/frontend/wrapper/model.cc | 40 + runtimes/neurun/src/frontend/wrapper/model.h | 41 + runtimes/neurun/src/graph/Graph.cc | 315 + runtimes/neurun/src/graph/Graph.h | 129 + runtimes/neurun/src/graph/Index.h | 75 + runtimes/neurun/src/graph/dumper/Dumper.cc | 118 + runtimes/neurun/src/graph/dumper/Dumper.h | 50 + runtimes/neurun/src/graph/operand/Data.h | 78 + runtimes/neurun/src/graph/operand/DataType.h | 43 + runtimes/neurun/src/graph/operand/Index.h | 51 + runtimes/neurun/src/graph/operand/IndexSet.cc | 56 + runtimes/neurun/src/graph/operand/IndexSet.h | 61 + runtimes/neurun/src/graph/operand/Layout.h | 54 + runtimes/neurun/src/graph/operand/LayoutSet.cc | 69 + runtimes/neurun/src/graph/operand/LayoutSet.h | 61 + runtimes/neurun/src/graph/operand/LowerInfo.cc | 30 + runtimes/neurun/src/graph/operand/LowerInfo.h | 80 + runtimes/neurun/src/graph/operand/Object.cc | 117 + runtimes/neurun/src/graph/operand/Object.h | 116 + runtimes/neurun/src/graph/operand/Set.cc | 68 + runtimes/neurun/src/graph/operand/Set.h | 60 + runtimes/neurun/src/graph/operand/Shape.cc | 73 + runtimes/neurun/src/graph/operand/Shape.h | 59 + runtimes/neurun/src/graph/operand/Shape4DConvert.h | 57 + runtimes/neurun/src/graph/operand/TypeInfo.cc | 35 + runtimes/neurun/src/graph/operand/TypeInfo.h | 62 + runtimes/neurun/src/graph/operation/AvgPool2D.cc | 82 + runtimes/neurun/src/graph/operation/AvgPool2D.h | 72 + runtimes/neurun/src/graph/operation/Concat.cc | 69 + runtimes/neurun/src/graph/operation/Concat.h | 61 + runtimes/neurun/src/graph/operation/Conv2D.cc | 79 + runtimes/neurun/src/graph/operation/Conv2D.h | 69 + .../neurun/src/graph/operation/FullyConnected.cc | 69 + .../neurun/src/graph/operation/FullyConnected.h | 62 + runtimes/neurun/src/graph/operation/Index.h | 35 + runtimes/neurun/src/graph/operation/IndexList.cc | 40 + runtimes/neurun/src/graph/operation/IndexList.h | 55 + runtimes/neurun/src/graph/operation/LowerInfo.cc | 33 + runtimes/neurun/src/graph/operation/LowerInfo.h | 45 + runtimes/neurun/src/graph/operation/MaxPool2D.cc | 82 + runtimes/neurun/src/graph/operation/MaxPool2D.h | 72 + runtimes/neurun/src/graph/operation/NOP.cc | 36 + runtimes/neurun/src/graph/operation/NOP.h | 47 + runtimes/neurun/src/graph/operation/Node.cc | 41 + runtimes/neurun/src/graph/operation/Node.h | 73 + runtimes/neurun/src/graph/operation/NodeVisitor.h | 56 + runtimes/neurun/src/graph/operation/Op.lst | 30 + runtimes/neurun/src/graph/operation/Permute.cc | 41 + runtimes/neurun/src/graph/operation/Permute.h | 33 + runtimes/neurun/src/graph/operation/Reshape.cc | 67 + runtimes/neurun/src/graph/operation/Reshape.h | 51 + runtimes/neurun/src/graph/operation/Set.cc | 67 + runtimes/neurun/src/graph/operation/Set.h | 62 + runtimes/neurun/src/graph/operation/Softmax.cc | 67 + runtimes/neurun/src/graph/operation/Softmax.h | 62 + runtimes/neurun/src/graph/verifier/IVerifier.cc | 72 + runtimes/neurun/src/graph/verifier/IVerifier.h | 62 + runtimes/neurun/src/internal/Convert.cc | 59 + runtimes/neurun/src/internal/Convert.h | 40 + runtimes/neurun/src/internal/Padding.cc | 72 + runtimes/neurun/src/internal/Padding.h | 48 + .../neurun/src/internal/nnapi/feature/Reader.h | 75 + runtimes/neurun/src/internal/nnapi/feature/Utils.h | 60 + runtimes/neurun/src/internal/nnapi/feature/View.h | 92 + runtimes/neurun/src/internal/nnapi/kernel/Reader.h | 70 + runtimes/neurun/src/internal/nnapi/kernel/View.h | 88 + runtimes/neurun/src/kernel/CMakeLists.txt | 2 + runtimes/neurun/src/kernel/acl_cl/CMakeLists.txt | 15 + runtimes/neurun/src/kernel/acl_cl/ConcatLayer.cc | 158 + runtimes/neurun/src/kernel/acl_cl/ConcatLayer.h | 67 + .../kernel/acl_cl/TensorConvertFromCommonLayer.cc | 94 + .../kernel/acl_cl/TensorConvertFromCommonLayer.h | 67 + .../kernel/acl_cl/TensorConvertToCommonLayer.cc | 94 + .../src/kernel/acl_cl/TensorConvertToCommonLayer.h | 67 + runtimes/neurun/src/kernel/cpu/AvgPoolLayer.cc | 118 + runtimes/neurun/src/kernel/cpu/AvgPoolLayer.h | 78 + runtimes/neurun/src/kernel/cpu/CMakeLists.txt | 14 + runtimes/neurun/src/kernel/cpu/ConcatLayer.cc | 109 + runtimes/neurun/src/kernel/cpu/ConcatLayer.h | 66 + runtimes/neurun/src/kernel/cpu/ConvolutionLayer.cc | 202 + runtimes/neurun/src/kernel/cpu/ConvolutionLayer.h | 79 + .../neurun/src/kernel/cpu/FullyConnectedLayer.cc | 139 + .../neurun/src/kernel/cpu/FullyConnectedLayer.h | 69 + runtimes/neurun/src/kernel/cpu/MaxPoolLayer.cc | 118 + runtimes/neurun/src/kernel/cpu/MaxPoolLayer.h | 78 + runtimes/neurun/src/kernel/cpu/OperationUtils.cc | 230 + runtimes/neurun/src/kernel/cpu/OperationUtils.h | 103 + runtimes/neurun/src/kernel/cpu/ReshapeLayer.cc | 57 + runtimes/neurun/src/kernel/cpu/ReshapeLayer.h | 58 + runtimes/neurun/src/kernel/cpu/SoftMaxLayer.cc | 128 + runtimes/neurun/src/kernel/cpu/SoftMaxLayer.h | 64 + .../src/kernel/cpu/TensorConvertFromCommonLayer.cc | 90 + .../src/kernel/cpu/TensorConvertFromCommonLayer.h | 67 + .../src/kernel/cpu/TensorConvertToCommonLayer.cc | 90 + .../src/kernel/cpu/TensorConvertToCommonLayer.h | 67 + runtimes/neurun/src/library_info.cc | 17 + runtimes/neurun/src/linear/Linear.cc | 73 + runtimes/neurun/src/linear/Linear.h | 71 + runtimes/neurun/src/logging.h | 53 + runtimes/neurun/test/graph/Graph.cc | 52 + runtimes/neurun/test/graph/Index.cc | 34 + runtimes/neurun/test/graph/operand/IndexSet.cc | 43 + runtimes/neurun/test/graph/operand/LayoutSet.cc | 27 + runtimes/neurun/test/graph/operand/Set.cc | 48 + runtimes/neurun/test/graph/operand/UseDef.cc | 173 + runtimes/neurun/test/graph/operation/Insert.cc | 166 + runtimes/neurun/test/graph/operation/MockNode.h | 48 + runtimes/neurun/test/graph/operation/Set.cc | 34 + runtimes/neurun/test/graph/operation/SetIO.cc | 86 + runtimes/neurun/test/graph/verifier/Verifier.cc | 64 + runtimes/neurun/test/model.cc | 25 + runtimes/nn/CMakeLists.txt | 27 - runtimes/nn/README.md | 54 - runtimes/nn/common/CMakeLists.txt | 31 - runtimes/nn/common/CpuExecutor.cpp | 1324 -- runtimes/nn/common/Logging.cpp | 51 - runtimes/nn/common/NNFWKernels.cpp | 72 - runtimes/nn/common/NNFWKernels.h | 41 - runtimes/nn/common/NNFWKernels.lst | 80 - runtimes/nn/common/OperationsUtils.cpp | 565 - runtimes/nn/common/Utils.cpp | 397 - runtimes/nn/common/include/ActivationFunctor.h | 70 - runtimes/nn/common/include/CpuExecutor.h | 165 - runtimes/nn/common/include/HalInterfaces.h | 82 - runtimes/nn/common/include/Logging.h | 61 - runtimes/nn/common/include/Operations.h | 203 - runtimes/nn/common/include/OperationsUtils.h | 247 - runtimes/nn/common/include/Utils.h | 128 - runtimes/nn/common/operations/Activation.cpp | 211 - runtimes/nn/common/operations/Concatenation.cpp | 64 - runtimes/nn/common/operations/Conv2D.cpp | 154 - runtimes/nn/common/operations/DepthwiseConv2D.cpp | 119 - runtimes/nn/common/operations/FullyConnected.cpp | 87 - runtimes/nn/common/operations/Pooling.cpp | 163 - runtimes/nn/common/operations/Reshape.cpp | 103 - runtimes/nn/common/operations/SimpleMath.cpp | 217 - runtimes/nn/common/operations/internal/common.h | 80 - .../nn/common/operations/internal/compatibility.h | 57 - .../operations/internal/optimized/cpu_check.h | 28 - .../internal/optimized/depthwiseconv_float.h | 792 - .../internal/optimized/depthwiseconv_uint8.h | 1606 -- .../internal/optimized/neon_tensor_utils.cc | 217 - .../internal/optimized/neon_tensor_utils.h | 119 - .../operations/internal/optimized/optimized_ops.h | 2717 ---- .../internal/optimized/tensor_utils_impl.h | 133 - .../nn/common/operations/internal/tensor_utils.cc | 29 - .../nn/common/operations/internal/tensor_utils.h | 123 - .../operations/internal/tensor_utils_test.cc | 198 - runtimes/nn/common/operations/internal/types.h | 112 - runtimes/nn/depend/CMakeLists.txt | 21 - runtimes/nn/depend/external/CMakeLists.txt | 13 - runtimes/nn/depend/external/eigen/CMakeLists.txt | 10 - .../nn/depend/external/eigen/Eigen/CMakeLists.txt | 19 - runtimes/nn/depend/external/eigen/Eigen/Cholesky | 41 - .../nn/depend/external/eigen/Eigen/CholmodSupport | 48 - runtimes/nn/depend/external/eigen/Eigen/Core | 516 - runtimes/nn/depend/external/eigen/Eigen/Dense | 7 - runtimes/nn/depend/external/eigen/Eigen/Eigen | 2 - .../nn/depend/external/eigen/Eigen/Eigenvalues | 57 - runtimes/nn/depend/external/eigen/Eigen/Geometry | 62 - .../nn/depend/external/eigen/Eigen/Householder | 30 - .../external/eigen/Eigen/IterativeLinearSolvers | 48 - runtimes/nn/depend/external/eigen/Eigen/Jacobi | 33 - runtimes/nn/depend/external/eigen/Eigen/LU | 46 - .../nn/depend/external/eigen/Eigen/MetisSupport | 35 - .../nn/depend/external/eigen/Eigen/OrderingMethods | 73 - .../nn/depend/external/eigen/Eigen/PaStiXSupport | 48 - .../nn/depend/external/eigen/Eigen/PardisoSupport | 35 - runtimes/nn/depend/external/eigen/Eigen/QR | 47 - .../nn/depend/external/eigen/Eigen/QtAlignedMalloc | 40 - .../nn/depend/external/eigen/Eigen/SPQRSupport | 34 - runtimes/nn/depend/external/eigen/Eigen/SVD | 47 - runtimes/nn/depend/external/eigen/Eigen/Sparse | 36 - .../nn/depend/external/eigen/Eigen/SparseCholesky | 45 - runtimes/nn/depend/external/eigen/Eigen/SparseCore | 69 - runtimes/nn/depend/external/eigen/Eigen/SparseLU | 46 - runtimes/nn/depend/external/eigen/Eigen/SparseQR | 37 - runtimes/nn/depend/external/eigen/Eigen/StdDeque | 27 - runtimes/nn/depend/external/eigen/Eigen/StdList | 26 - runtimes/nn/depend/external/eigen/Eigen/StdVector | 27 - .../nn/depend/external/eigen/Eigen/SuperLUSupport | 64 - .../nn/depend/external/eigen/Eigen/UmfPackSupport | 40 - .../external/eigen/Eigen/src/Cholesky/LDLT.h | 669 - .../depend/external/eigen/Eigen/src/Cholesky/LLT.h | 534 - .../eigen/Eigen/src/Cholesky/LLT_LAPACKE.h | 99 - .../Eigen/src/CholmodSupport/CholmodSupport.h | 639 - .../depend/external/eigen/Eigen/src/Core/Array.h | 331 - .../external/eigen/Eigen/src/Core/ArrayBase.h | 226 - .../external/eigen/Eigen/src/Core/ArrayWrapper.h | 209 - .../depend/external/eigen/Eigen/src/Core/Assign.h | 90 - .../eigen/Eigen/src/Core/AssignEvaluator.h | 935 -- .../external/eigen/Eigen/src/Core/Assign_MKL.h | 176 - .../external/eigen/Eigen/src/Core/BandMatrix.h | 353 - .../depend/external/eigen/Eigen/src/Core/Block.h | 452 - .../external/eigen/Eigen/src/Core/BooleanRedux.h | 164 - .../eigen/Eigen/src/Core/CommaInitializer.h | 160 - .../eigen/Eigen/src/Core/ConditionEstimator.h | 175 - .../external/eigen/Eigen/src/Core/CoreEvaluators.h | 1671 -- .../external/eigen/Eigen/src/Core/CoreIterators.h | 127 - .../external/eigen/Eigen/src/Core/CwiseBinaryOp.h | 184 - .../external/eigen/Eigen/src/Core/CwiseNullaryOp.h | 866 - .../external/eigen/Eigen/src/Core/CwiseTernaryOp.h | 197 - .../external/eigen/Eigen/src/Core/CwiseUnaryOp.h | 103 - .../external/eigen/Eigen/src/Core/CwiseUnaryView.h | 128 - .../external/eigen/Eigen/src/Core/DenseBase.h | 611 - .../eigen/Eigen/src/Core/DenseCoeffsBase.h | 681 - .../external/eigen/Eigen/src/Core/DenseStorage.h | 570 - .../external/eigen/Eigen/src/Core/Diagonal.h | 257 - .../external/eigen/Eigen/src/Core/DiagonalMatrix.h | 343 - .../eigen/Eigen/src/Core/DiagonalProduct.h | 28 - .../nn/depend/external/eigen/Eigen/src/Core/Dot.h | 315 - .../external/eigen/Eigen/src/Core/EigenBase.h | 159 - .../eigen/Eigen/src/Core/ForceAlignedAccess.h | 146 - .../depend/external/eigen/Eigen/src/Core/Fuzzy.h | 155 - .../external/eigen/Eigen/src/Core/GeneralProduct.h | 454 - .../eigen/Eigen/src/Core/GenericPacketMath.h | 593 - .../eigen/Eigen/src/Core/GlobalFunctions.h | 187 - .../nn/depend/external/eigen/Eigen/src/Core/IO.h | 225 - .../depend/external/eigen/Eigen/src/Core/Inverse.h | 118 - .../nn/depend/external/eigen/Eigen/src/Core/Map.h | 164 - .../depend/external/eigen/Eigen/src/Core/MapBase.h | 299 - .../external/eigen/Eigen/src/Core/MathFunctions.h | 1431 -- .../eigen/Eigen/src/Core/MathFunctionsImpl.h | 78 - .../depend/external/eigen/Eigen/src/Core/Matrix.h | 461 - .../external/eigen/Eigen/src/Core/MatrixBase.h | 530 - .../external/eigen/Eigen/src/Core/NestByValue.h | 110 - .../depend/external/eigen/Eigen/src/Core/NoAlias.h | 108 - .../external/eigen/Eigen/src/Core/NumTraits.h | 248 - .../eigen/Eigen/src/Core/PermutationMatrix.h | 633 - .../eigen/Eigen/src/Core/PlainObjectBase.h | 1031 -- .../depend/external/eigen/Eigen/src/Core/Product.h | 186 - .../eigen/Eigen/src/Core/ProductEvaluators.h | 1105 -- .../depend/external/eigen/Eigen/src/Core/Random.h | 182 - .../depend/external/eigen/Eigen/src/Core/Redux.h | 505 - .../nn/depend/external/eigen/Eigen/src/Core/Ref.h | 281 - .../external/eigen/Eigen/src/Core/Replicate.h | 142 - .../external/eigen/Eigen/src/Core/ReturnByValue.h | 117 - .../depend/external/eigen/Eigen/src/Core/Reverse.h | 211 - .../depend/external/eigen/Eigen/src/Core/Select.h | 162 - .../eigen/Eigen/src/Core/SelfAdjointView.h | 350 - .../eigen/Eigen/src/Core/SelfCwiseBinaryOp.h | 51 - .../depend/external/eigen/Eigen/src/Core/Solve.h | 188 - .../eigen/Eigen/src/Core/SolveTriangular.h | 232 - .../external/eigen/Eigen/src/Core/SolverBase.h | 130 - .../external/eigen/Eigen/src/Core/StableNorm.h | 221 - .../depend/external/eigen/Eigen/src/Core/Stride.h | 111 - .../nn/depend/external/eigen/Eigen/src/Core/Swap.h | 67 - .../external/eigen/Eigen/src/Core/Transpose.h | 403 - .../external/eigen/Eigen/src/Core/Transpositions.h | 407 - .../eigen/Eigen/src/Core/TriangularMatrix.h | 983 -- .../external/eigen/Eigen/src/Core/VectorBlock.h | 96 - .../external/eigen/Eigen/src/Core/VectorwiseOp.h | 695 - .../depend/external/eigen/Eigen/src/Core/Visitor.h | 273 - .../eigen/Eigen/src/Core/arch/AVX/Complex.h | 483 - .../eigen/Eigen/src/Core/arch/AVX/MathFunctions.h | 439 - .../eigen/Eigen/src/Core/arch/AVX/PacketMath.h | 633 - .../eigen/Eigen/src/Core/arch/AVX/TypeCasting.h | 51 - .../Eigen/src/Core/arch/AVX512/MathFunctions.h | 396 - .../eigen/Eigen/src/Core/arch/AVX512/PacketMath.h | 1316 -- .../eigen/Eigen/src/Core/arch/AltiVec/Complex.h | 461 - .../Eigen/src/Core/arch/AltiVec/MathFunctions.h | 322 - .../eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h | 1033 -- .../eigen/Eigen/src/Core/arch/CUDA/Complex.h | 103 - .../external/eigen/Eigen/src/Core/arch/CUDA/Half.h | 635 - .../eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h | 91 - .../eigen/Eigen/src/Core/arch/CUDA/PacketMath.h | 333 - .../Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 1123 -- .../eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h | 212 - .../eigen/Eigen/src/Core/arch/Default/Settings.h | 49 - .../eigen/Eigen/src/Core/arch/NEON/Complex.h | 486 - .../eigen/Eigen/src/Core/arch/NEON/MathFunctions.h | 91 - .../eigen/Eigen/src/Core/arch/NEON/PacketMath.h | 729 - .../eigen/Eigen/src/Core/arch/SSE/Complex.h | 503 - .../eigen/Eigen/src/Core/arch/SSE/MathFunctions.h | 562 - .../eigen/Eigen/src/Core/arch/SSE/PacketMath.h | 879 - .../eigen/Eigen/src/Core/arch/SSE/TypeCasting.h | 77 - .../eigen/Eigen/src/Core/arch/ZVector/Complex.h | 394 - .../Eigen/src/Core/arch/ZVector/MathFunctions.h | 137 - .../eigen/Eigen/src/Core/arch/ZVector/PacketMath.h | 945 -- .../Eigen/src/Core/functors/AssignmentFunctors.h | 168 - .../eigen/Eigen/src/Core/functors/BinaryFunctors.h | 482 - .../Eigen/src/Core/functors/NullaryFunctors.h | 188 - .../eigen/Eigen/src/Core/functors/StlFunctors.h | 132 - .../Eigen/src/Core/functors/TernaryFunctors.h | 25 - .../eigen/Eigen/src/Core/functors/UnaryFunctors.h | 823 - .../src/Core/products/GeneralBlockPanelKernel.h | 2149 --- .../Eigen/src/Core/products/GeneralMatrixMatrix.h | 492 - .../Core/products/GeneralMatrixMatrixTriangular.h | 311 - .../products/GeneralMatrixMatrixTriangular_BLAS.h | 141 - .../src/Core/products/GeneralMatrixMatrix_BLAS.h | 115 - .../Eigen/src/Core/products/GeneralMatrixVector.h | 619 - .../src/Core/products/GeneralMatrixVector_BLAS.h | 129 - .../eigen/Eigen/src/Core/products/Parallelizer.h | 163 - .../src/Core/products/SelfadjointMatrixMatrix.h | 521 - .../Core/products/SelfadjointMatrixMatrix_BLAS.h | 275 - .../src/Core/products/SelfadjointMatrixVector.h | 260 - .../Core/products/SelfadjointMatrixVector_BLAS.h | 111 - .../Eigen/src/Core/products/SelfadjointProduct.h | 133 - .../src/Core/products/SelfadjointRank2Update.h | 93 - .../src/Core/products/TriangularMatrixMatrix.h | 441 - .../Core/products/TriangularMatrixMatrix_BLAS.h | 302 - .../src/Core/products/TriangularMatrixVector.h | 336 - .../Core/products/TriangularMatrixVector_BLAS.h | 241 - .../src/Core/products/TriangularSolverMatrix.h | 335 - .../Core/products/TriangularSolverMatrix_BLAS.h | 151 - .../src/Core/products/TriangularSolverVector.h | 145 - .../external/eigen/Eigen/src/Core/util/BlasUtil.h | 398 - .../external/eigen/Eigen/src/Core/util/Constants.h | 547 - .../Eigen/src/Core/util/DisableStupidWarnings.h | 75 - .../Eigen/src/Core/util/ForwardDeclarations.h | 302 - .../eigen/Eigen/src/Core/util/MKL_support.h | 128 - .../external/eigen/Eigen/src/Core/util/Macros.h | 992 -- .../external/eigen/Eigen/src/Core/util/Memory.h | 977 -- .../external/eigen/Eigen/src/Core/util/Meta.h | 492 - .../external/eigen/Eigen/src/Core/util/NonMPL2.h | 3 - .../Eigen/src/Core/util/ReenableStupidWarnings.h | 27 - .../eigen/Eigen/src/Core/util/StaticAssert.h | 216 - .../external/eigen/Eigen/src/Core/util/XprHelper.h | 821 - .../Eigen/src/Eigenvalues/ComplexEigenSolver.h | 346 - .../eigen/Eigen/src/Eigenvalues/ComplexSchur.h | 459 - .../Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h | 91 - .../eigen/Eigen/src/Eigenvalues/EigenSolver.h | 622 - .../Eigen/src/Eigenvalues/GeneralizedEigenSolver.h | 419 - .../GeneralizedSelfAdjointEigenSolver.h | 226 - .../src/Eigenvalues/HessenbergDecomposition.h | 374 - .../Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h | 160 - .../external/eigen/Eigen/src/Eigenvalues/RealQZ.h | 654 - .../eigen/Eigen/src/Eigenvalues/RealSchur.h | 546 - .../Eigen/src/Eigenvalues/RealSchur_LAPACKE.h | 77 - .../Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h | 870 - .../Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h | 90 - .../Eigen/src/Eigenvalues/Tridiagonalization.h | 556 - .../external/eigen/Eigen/src/Geometry/AlignedBox.h | 392 - .../external/eigen/Eigen/src/Geometry/AngleAxis.h | 247 - .../eigen/Eigen/src/Geometry/EulerAngles.h | 114 - .../eigen/Eigen/src/Geometry/Homogeneous.h | 497 - .../external/eigen/Eigen/src/Geometry/Hyperplane.h | 282 - .../eigen/Eigen/src/Geometry/OrthoMethods.h | 234 - .../eigen/Eigen/src/Geometry/ParametrizedLine.h | 195 - .../external/eigen/Eigen/src/Geometry/Quaternion.h | 809 - .../external/eigen/Eigen/src/Geometry/Rotation2D.h | 199 - .../eigen/Eigen/src/Geometry/RotationBase.h | 206 - .../external/eigen/Eigen/src/Geometry/Scaling.h | 170 - .../external/eigen/Eigen/src/Geometry/Transform.h | 1542 -- .../eigen/Eigen/src/Geometry/Translation.h | 208 - .../external/eigen/Eigen/src/Geometry/Umeyama.h | 166 - .../eigen/Eigen/src/Geometry/arch/Geometry_SSE.h | 161 - .../eigen/Eigen/src/Householder/BlockHouseholder.h | 103 - .../eigen/Eigen/src/Householder/Householder.h | 172 - .../Eigen/src/Householder/HouseholderSequence.h | 470 - .../IterativeLinearSolvers/BasicPreconditioners.h | 226 - .../Eigen/src/IterativeLinearSolvers/BiCGSTAB.h | 228 - .../src/IterativeLinearSolvers/ConjugateGradient.h | 245 - .../IterativeLinearSolvers/IncompleteCholesky.h | 400 - .../src/IterativeLinearSolvers/IncompleteLUT.h | 462 - .../IterativeLinearSolvers/IterativeSolverBase.h | 394 - .../LeastSquareConjugateGradient.h | 216 - .../src/IterativeLinearSolvers/SolveWithGuess.h | 115 - .../external/eigen/Eigen/src/Jacobi/Jacobi.h | 441 - .../external/eigen/Eigen/src/LU/Determinant.h | 101 - .../depend/external/eigen/Eigen/src/LU/FullPivLU.h | 891 - .../external/eigen/Eigen/src/LU/InverseImpl.h | 415 - .../external/eigen/Eigen/src/LU/PartialPivLU.h | 611 - .../eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h | 83 - .../external/eigen/Eigen/src/LU/arch/Inverse_SSE.h | 338 - .../eigen/Eigen/src/MetisSupport/MetisSupport.h | 137 - .../eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h | 1843 --- .../eigen/Eigen/src/OrderingMethods/Ordering.h | 157 - .../eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h | 678 - .../Eigen/src/PardisoSupport/PardisoSupport.h | 543 - .../eigen/Eigen/src/QR/ColPivHouseholderQR.h | 653 - .../Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h | 97 - .../Eigen/src/QR/CompleteOrthogonalDecomposition.h | 562 - .../eigen/Eigen/src/QR/FullPivHouseholderQR.h | 676 - .../external/eigen/Eigen/src/QR/HouseholderQR.h | 409 - .../eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h | 68 - .../Eigen/src/SPQRSupport/SuiteSparseQRSupport.h | 313 - .../depend/external/eigen/Eigen/src/SVD/BDCSVD.h | 1231 -- .../external/eigen/Eigen/src/SVD/JacobiSVD.h | 804 - .../eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h | 90 - .../depend/external/eigen/Eigen/src/SVD/SVDBase.h | 313 - .../eigen/Eigen/src/SVD/UpperBidiagonalization.h | 414 - .../Eigen/src/SparseCholesky/SimplicialCholesky.h | 689 - .../eigen/Eigen/src/SparseCore/AmbiVector.h | 377 - .../eigen/Eigen/src/SparseCore/CompressedStorage.h | 258 - .../SparseCore/ConservativeSparseSparseProduct.h | 345 - .../Eigen/src/SparseCore/MappedSparseMatrix.h | 67 - .../eigen/Eigen/src/SparseCore/SparseAssign.h | 216 - .../eigen/Eigen/src/SparseCore/SparseBlock.h | 603 - .../eigen/Eigen/src/SparseCore/SparseColEtree.h | 206 - .../Eigen/src/SparseCore/SparseCompressedBase.h | 341 - .../Eigen/src/SparseCore/SparseCwiseBinaryOp.h | 726 - .../Eigen/src/SparseCore/SparseCwiseUnaryOp.h | 148 - .../Eigen/src/SparseCore/SparseDenseProduct.h | 320 - .../Eigen/src/SparseCore/SparseDiagonalProduct.h | 138 - .../eigen/Eigen/src/SparseCore/SparseDot.h | 98 - .../eigen/Eigen/src/SparseCore/SparseFuzzy.h | 29 - .../eigen/Eigen/src/SparseCore/SparseMap.h | 305 - .../eigen/Eigen/src/SparseCore/SparseMatrix.h | 1403 -- .../eigen/Eigen/src/SparseCore/SparseMatrixBase.h | 405 - .../eigen/Eigen/src/SparseCore/SparsePermutation.h | 178 - .../eigen/Eigen/src/SparseCore/SparseProduct.h | 169 - .../eigen/Eigen/src/SparseCore/SparseRedux.h | 49 - .../eigen/Eigen/src/SparseCore/SparseRef.h | 397 - .../Eigen/src/SparseCore/SparseSelfAdjointView.h | 656 - .../eigen/Eigen/src/SparseCore/SparseSolverBase.h | 124 - .../SparseCore/SparseSparseProductWithPruning.h | 198 - .../eigen/Eigen/src/SparseCore/SparseTranspose.h | 92 - .../Eigen/src/SparseCore/SparseTriangularView.h | 189 - .../eigen/Eigen/src/SparseCore/SparseUtil.h | 178 - .../eigen/Eigen/src/SparseCore/SparseVector.h | 478 - .../eigen/Eigen/src/SparseCore/SparseView.h | 253 - .../eigen/Eigen/src/SparseCore/TriangularSolver.h | 315 - .../external/eigen/Eigen/src/SparseLU/SparseLU.h | 775 - .../eigen/Eigen/src/SparseLU/SparseLUImpl.h | 66 - .../eigen/Eigen/src/SparseLU/SparseLU_Memory.h | 226 - .../eigen/Eigen/src/SparseLU/SparseLU_Structs.h | 110 - .../Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h | 301 - .../eigen/Eigen/src/SparseLU/SparseLU_Utils.h | 80 - .../Eigen/src/SparseLU/SparseLU_column_bmod.h | 181 - .../eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h | 179 - .../Eigen/src/SparseLU/SparseLU_copy_to_ucol.h | 107 - .../Eigen/src/SparseLU/SparseLU_gemm_kernel.h | 280 - .../Eigen/src/SparseLU/SparseLU_heap_relax_snode.h | 126 - .../Eigen/src/SparseLU/SparseLU_kernel_bmod.h | 130 - .../eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h | 223 - .../eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h | 258 - .../eigen/Eigen/src/SparseLU/SparseLU_pivotL.h | 137 - .../eigen/Eigen/src/SparseLU/SparseLU_pruneL.h | 136 - .../Eigen/src/SparseLU/SparseLU_relax_snode.h | 83 - .../external/eigen/Eigen/src/SparseQR/SparseQR.h | 739 - .../external/eigen/Eigen/src/StlSupport/StdDeque.h | 126 - .../external/eigen/Eigen/src/StlSupport/StdList.h | 106 - .../eigen/Eigen/src/StlSupport/StdVector.h | 131 - .../external/eigen/Eigen/src/StlSupport/details.h | 84 - .../Eigen/src/SuperLUSupport/SuperLUSupport.h | 1027 -- .../Eigen/src/UmfPackSupport/UmfPackSupport.h | 506 - .../depend/external/eigen/Eigen/src/misc/Image.h | 82 - .../depend/external/eigen/Eigen/src/misc/Kernel.h | 79 - .../external/eigen/Eigen/src/misc/RealSvd2x2.h | 55 - .../nn/depend/external/eigen/Eigen/src/misc/blas.h | 440 - .../depend/external/eigen/Eigen/src/misc/lapack.h | 152 - .../depend/external/eigen/Eigen/src/misc/lapacke.h | 16291 ------------------- .../eigen/Eigen/src/misc/lapacke_mangling.h | 17 - .../eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h | 332 - .../eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h | 552 - .../eigen/Eigen/src/plugins/BlockMethods.h | 1058 -- .../eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h | 115 - .../eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h | 163 - .../eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h | 152 - .../eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h | 85 - .../nn/depend/external/gemmlowp/CMakeLists.txt | 11 - .../external/gemmlowp/fixedpoint/fixedpoint.h | 779 - .../external/gemmlowp/fixedpoint/fixedpoint_neon.h | 175 - .../external/gemmlowp/fixedpoint/fixedpoint_sse.h | 218 - .../depend/external/gemmlowp/internal/allocator.h | 220 - .../external/gemmlowp/internal/block_params.h | 174 - .../nn/depend/external/gemmlowp/internal/common.h | 256 - .../nn/depend/external/gemmlowp/internal/compute.h | 104 - .../gemmlowp/internal/dispatch_gemm_shape.h | 189 - .../nn/depend/external/gemmlowp/internal/kernel.h | 234 - .../external/gemmlowp/internal/kernel_default.h | 109 - .../external/gemmlowp/internal/kernel_neon.h | 1619 -- .../external/gemmlowp/internal/kernel_reference.h | 118 - .../depend/external/gemmlowp/internal/kernel_sse.h | 517 - .../external/gemmlowp/internal/multi_thread_gemm.h | 701 - .../nn/depend/external/gemmlowp/internal/output.h | 435 - .../external/gemmlowp/internal/output_neon.h | 432 - .../depend/external/gemmlowp/internal/output_sse.h | 354 - .../nn/depend/external/gemmlowp/internal/pack.h | 435 - .../depend/external/gemmlowp/internal/pack_neon.h | 320 - .../depend/external/gemmlowp/internal/pack_sse.h | 128 - .../external/gemmlowp/internal/simd_wrappers.h | 508 - .../internal/simd_wrappers_common_neon_sse.h | 646 - .../gemmlowp/internal/simd_wrappers_neon.h | 150 - .../external/gemmlowp/internal/simd_wrappers_sse.h | 123 - .../gemmlowp/internal/single_thread_gemm.h | 158 - .../nn/depend/external/gemmlowp/internal/unpack.h | 278 - .../external/gemmlowp/profiling/instrumentation.h | 244 - .../depend/external/gemmlowp/profiling/profiler.h | 373 - .../nn/depend/external/gemmlowp/public/bit_depth.h | 62 - .../nn/depend/external/gemmlowp/public/gemmlowp.h | 87 - runtimes/nn/depend/external/gemmlowp/public/map.h | 140 - .../external/gemmlowp/public/output_stages.h | 185 - runtimes/nn/depend/hal/CMakeLists.txt | 10 - .../android/hardware/neuralnetworks/1.0/types.h | 493 - runtimes/nn/depend/libcutils/CMakeLists.txt | 22 - runtimes/nn/depend/libcutils/ashmem-host.c | 97 - .../nn/depend/libcutils/include/cutils/ashmem.h | 34 - .../libcutils/include/cutils/native_handle.h | 102 - runtimes/nn/depend/libcutils/native_handle.c | 95 - runtimes/nn/depend/libhidl/CMakeLists.txt | 11 - runtimes/nn/depend/libhidl/base/CMakeLists.txt | 22 - runtimes/nn/depend/libhidl/base/HidlSupport.cpp | 283 - runtimes/nn/depend/libhidl/base/Status.cpp | 166 - .../libhidl/base/include/hidl/HidlInternal.h | 193 - .../depend/libhidl/base/include/hidl/HidlSupport.h | 989 -- .../nn/depend/libhidl/base/include/hidl/Status.h | 273 - runtimes/nn/depend/libutils/CMakeLists.txt | 22 - runtimes/nn/depend/libutils/RefBase.cpp | 809 - runtimes/nn/depend/libutils/StrongPointer.cpp | 29 - runtimes/nn/depend/libutils/include/utils/Compat.h | 87 - runtimes/nn/depend/libutils/include/utils/Errors.h | 88 - .../depend/libutils/include/utils/LightRefBase.h | 72 - .../nn/depend/libutils/include/utils/RefBase.h | 690 - .../depend/libutils/include/utils/StrongPointer.h | 245 - .../nn/depend/libutils/include/utils/TypeHelpers.h | 336 - runtimes/nn/runtime/CMakeLists.txt | 29 - runtimes/nn/runtime/Callbacks.cpp | 115 - runtimes/nn/runtime/Callbacks.h | 249 - runtimes/nn/runtime/CompilationBuilder.cpp | 68 - runtimes/nn/runtime/CompilationBuilder.h | 55 - runtimes/nn/runtime/ExecutionBuilder.cpp | 293 - runtimes/nn/runtime/ExecutionBuilder.h | 147 - runtimes/nn/runtime/Memory.cpp | 199 - runtimes/nn/runtime/Memory.h | 122 - runtimes/nn/runtime/ModelBuilder.cpp | 386 - runtimes/nn/runtime/ModelBuilder.h | 129 - runtimes/nn/runtime/NeuralNetworks.cpp | 489 - runtimes/pure_arm_compute/.FORMATCHECKED | 0 runtimes/pure_arm_compute/CMakeLists.txt | 31 + runtimes/pure_arm_compute/src/compilation.cc | 4442 +++++ runtimes/pure_arm_compute/src/compilation.h | 45 + runtimes/pure_arm_compute/src/event.cc | 31 + runtimes/pure_arm_compute/src/event.h | 24 + runtimes/pure_arm_compute/src/execution.cc | 581 + runtimes/pure_arm_compute/src/execution.h | 67 + .../pure_arm_compute/src/internal/FeatureSink.h | 60 + .../pure_arm_compute/src/internal/FeatureSource.h | 54 + .../src/internal/IExecutionBuilder.h | 32 + .../pure_arm_compute/src/internal/MatrixSink.h | 71 + .../pure_arm_compute/src/internal/MatrixSource.h | 63 + runtimes/pure_arm_compute/src/internal/Model.cc | 125 + runtimes/pure_arm_compute/src/internal/Model.h | 319 + runtimes/pure_arm_compute/src/internal/Sink.h | 29 + runtimes/pure_arm_compute/src/internal/Sinks.h | 74 + runtimes/pure_arm_compute/src/internal/Source.h | 29 + runtimes/pure_arm_compute/src/internal/Swizzle.h | 84 + .../pure_arm_compute/src/internal/Tensor3DSink.h | 70 + .../pure_arm_compute/src/internal/Tensor3DSource.h | 70 + .../pure_arm_compute/src/internal/TensorSource.h | 63 + .../pure_arm_compute/src/internal/VectorSink.h | 54 + .../pure_arm_compute/src/internal/VectorSource.h | 47 + .../pure_arm_compute/src/internal/arm_compute.cc | 87 + .../pure_arm_compute/src/internal/arm_compute.h | 216 + .../src/internal/arm_compute/Cast.h | 150 + .../src/internal/arm_compute/feature/View.h | 99 + .../src/internal/arm_compute/kernel/View.h | 74 + .../src/internal/arm_compute/matrix/View.h | 74 + .../src/internal/arm_compute/tensor/View.h | 85 + .../src/internal/layers/FeatureLoggingLayer.h | 88 + .../internal/layers/GenericFullyConnectedLayer.cc | 90 + .../internal/layers/GenericFullyConnectedLayer.h | 53 + .../src/internal/layers/GenericReshapeLayer.cc | 66 + .../src/internal/layers/GenericReshapeLayer.h | 50 + .../src/internal/layers/PadLayer.cc | 78 + .../src/internal/layers/PadLayer.h | 41 + .../src/internal/layers/SimpleArithmeticAddition.h | 108 + .../src/internal/layers/SimpleCastLayer.h | 95 + .../src/internal/layers/SimpleEmbeddingLookup.cc | 115 + .../src/internal/layers/SimpleEmbeddingLookup.h | 22 + .../src/internal/layers/SimpleSpaceToDepth.cc | 155 + .../src/internal/layers/SimpleSpaceToDepth.h | 45 + .../internal/layers/SquaredDifferenceOperation.cc | 40 + .../internal/layers/SquaredDifferenceOperation.h | 35 + .../src/internal/nnapi/feature/Reader.h | 72 + .../src/internal/nnapi/feature/Utils.h | 60 + .../src/internal/nnapi/feature/View.h | 81 + .../src/internal/nnapi/kernel/Reader.h | 68 + .../src/internal/nnapi/matrix/Reader.h | 66 + .../src/internal/nnapi/tensor/ConstView.h | 85 + .../src/internal/nnapi/tensor/Reader.h | 90 + .../src/internal/nnapi/tensor/View.h | 88 + runtimes/pure_arm_compute/src/internal/op/Add.cc | 67 + runtimes/pure_arm_compute/src/internal/op/Add.h | 71 + .../pure_arm_compute/src/internal/op/AvgPool2D.cc | 124 + .../pure_arm_compute/src/internal/op/AvgPool2D.h | 130 + runtimes/pure_arm_compute/src/internal/op/Cast.cc | 62 + runtimes/pure_arm_compute/src/internal/op/Cast.h | 69 + .../pure_arm_compute/src/internal/op/Concat.cc | 69 + runtimes/pure_arm_compute/src/internal/op/Concat.h | 71 + .../pure_arm_compute/src/internal/op/Conv2D.cc | 126 + runtimes/pure_arm_compute/src/internal/op/Conv2D.h | 128 + .../src/internal/op/DepthwiseConv2D.cc | 128 + .../src/internal/op/DepthwiseConv2D.h | 130 + .../pure_arm_compute/src/internal/op/Dequantize.cc | 62 + .../pure_arm_compute/src/internal/op/Dequantize.h | 69 + runtimes/pure_arm_compute/src/internal/op/Div.cc | 67 + runtimes/pure_arm_compute/src/internal/op/Div.h | 71 + .../src/internal/op/EmbeddingLookup.cc | 65 + .../src/internal/op/EmbeddingLookup.h | 70 + runtimes/pure_arm_compute/src/internal/op/Floor.cc | 62 + runtimes/pure_arm_compute/src/internal/op/Floor.h | 69 + .../src/internal/op/FullyConnected.cc | 69 + .../src/internal/op/FullyConnected.h | 72 + .../pure_arm_compute/src/internal/op/Gather.cc | 67 + runtimes/pure_arm_compute/src/internal/op/Gather.h | 71 + .../src/internal/op/HashtableLookup.cc | 52 + .../src/internal/op/HashtableLookup.h | 56 + .../src/internal/op/L2Normalization.cc | 44 + .../src/internal/op/L2Normalization.h | 53 + .../pure_arm_compute/src/internal/op/L2Pool2D.cc | 124 + .../pure_arm_compute/src/internal/op/L2Pool2D.h | 130 + .../pure_arm_compute/src/internal/op/Logistic.cc | 63 + .../pure_arm_compute/src/internal/op/Logistic.h | 69 + runtimes/pure_arm_compute/src/internal/op/Lstm.cc | 85 + runtimes/pure_arm_compute/src/internal/op/Lstm.h | 94 + .../pure_arm_compute/src/internal/op/MaxPool2D.cc | 124 + .../pure_arm_compute/src/internal/op/MaxPool2D.h | 130 + runtimes/pure_arm_compute/src/internal/op/Mean.cc | 67 + runtimes/pure_arm_compute/src/internal/op/Mean.h | 71 + runtimes/pure_arm_compute/src/internal/op/Mul.cc | 67 + runtimes/pure_arm_compute/src/internal/op/Mul.h | 71 + runtimes/pure_arm_compute/src/internal/op/Node.h | 40 + .../pure_arm_compute/src/internal/op/NodeVisitor.h | 121 + runtimes/pure_arm_compute/src/internal/op/Pad.cc | 63 + runtimes/pure_arm_compute/src/internal/op/Pad.h | 69 + runtimes/pure_arm_compute/src/internal/op/RSQRT.cc | 62 + runtimes/pure_arm_compute/src/internal/op/RSQRT.h | 69 + runtimes/pure_arm_compute/src/internal/op/ReLU.cc | 63 + runtimes/pure_arm_compute/src/internal/op/ReLU.h | 69 + runtimes/pure_arm_compute/src/internal/op/ReLU1.cc | 63 + runtimes/pure_arm_compute/src/internal/op/ReLU1.h | 69 + runtimes/pure_arm_compute/src/internal/op/ReLU6.cc | 63 + runtimes/pure_arm_compute/src/internal/op/ReLU6.h | 69 + .../pure_arm_compute/src/internal/op/ReduceMax.cc | 65 + .../pure_arm_compute/src/internal/op/ReduceMax.h | 70 + .../pure_arm_compute/src/internal/op/Reshape.cc | 66 + .../pure_arm_compute/src/internal/op/Reshape.h | 70 + .../src/internal/op/ResizeBilinear.cc | 67 + .../src/internal/op/ResizeBilinear.h | 71 + runtimes/pure_arm_compute/src/internal/op/Rnn.cc | 66 + runtimes/pure_arm_compute/src/internal/op/Rnn.h | 75 + .../pure_arm_compute/src/internal/op/Softmax.cc | 65 + .../pure_arm_compute/src/internal/op/Softmax.h | 70 + .../src/internal/op/SpaceToDepth.cc | 65 + .../src/internal/op/SpaceToDepth.h | 70 + runtimes/pure_arm_compute/src/internal/op/Split.cc | 69 + runtimes/pure_arm_compute/src/internal/op/Split.h | 71 + .../src/internal/op/SquaredDifference.cc | 50 + .../src/internal/op/SquaredDifference.h | 55 + .../pure_arm_compute/src/internal/op/Squeeze.cc | 66 + .../pure_arm_compute/src/internal/op/Squeeze.h | 70 + .../src/internal/op/StridedSlice.cc | 88 + .../src/internal/op/StridedSlice.h | 75 + runtimes/pure_arm_compute/src/internal/op/Sub.cc | 67 + runtimes/pure_arm_compute/src/internal/op/Sub.h | 71 + runtimes/pure_arm_compute/src/internal/op/Tanh.cc | 63 + runtimes/pure_arm_compute/src/internal/op/Tanh.h | 69 + .../pure_arm_compute/src/internal/op/TopKV2.cc | 70 + runtimes/pure_arm_compute/src/internal/op/TopKV2.h | 71 + .../pure_arm_compute/src/internal/op/Transpose.cc | 65 + .../pure_arm_compute/src/internal/op/Transpose.h | 70 + runtimes/pure_arm_compute/src/library_info.cc | 17 + runtimes/pure_arm_compute/src/logging.h | 53 + runtimes/pure_arm_compute/src/memory.cc | 55 + runtimes/pure_arm_compute/src/memory.h | 38 + runtimes/pure_arm_compute/src/model.cc | 847 + runtimes/pure_arm_compute/src/model.h | 40 + runtimes/pure_arm_compute/symbolcheck.cpp | 64 + runtimes/template/CMakeLists.txt | 5 + runtimes/template/src/compilation.cc | 14 + runtimes/template/src/compilation.h | 8 + runtimes/template/src/event.cc | 13 + runtimes/template/src/event.h | 8 + runtimes/template/src/execution.cc | 33 + runtimes/template/src/execution.h | 8 + runtimes/template/src/memory.cc | 16 + runtimes/template/src/memory.h | 8 + runtimes/template/src/model.cc | 63 + runtimes/template/src/model.h | 8 + runtimes/tests/CMakeLists.txt | 1 - runtimes/tests/bring_up_test/CMakeLists.txt | 22 - runtimes/tests/bring_up_test/add_main.cpp | 117 - runtimes/tests/bring_up_test/cplusplus_main.cpp | 16 - runtimes/tests/bring_up_test/simple_model.cpp | 469 - runtimes/tests/bring_up_test/simple_model.h | 63 - runtimes/tests/bring_up_test/simple_model_main.cpp | 35 - runtimes/tests/include/NeuralNetworksWrapper.h | 11 + runtimes/tests/neural_networks_test/CMakeLists.txt | 26 +- .../tests/neural_networks_test/TestValidation.cpp | 141 +- .../generated/all_generated_tests.cpp | 2473 ++- .../generated/examples/batch_to_space.example.cpp | 22 + .../examples/batch_to_space_float_1.example.cpp | 22 + .../examples/batch_to_space_quant8_1.example.cpp | 22 + .../examples/cast_ex_float32_to_int32.example.cpp | 22 + .../examples/cast_ex_int32_to_float32.example.cpp | 22 + .../concat_float_4D_axis3_1_nnfw.example.cpp | 22 + ...v2d_float_large_2_weights_as_inputs.example.cpp | 2 +- .../generated/examples/div.example.cpp | 22 + .../generated/examples/div_.example.cpp | 22 + .../examples/div_broadcast_float.example.cpp | 22 + .../examples/embedding_lookup_2d_nnfw.example.cpp | 22 + .../examples/embedding_lookup_4d_nnfw.example.cpp | 22 + .../generated/examples/floor_.example.cpp | 22 + .../fully_connected_float_1_nnfw.example.cpp | 22 + .../examples/fully_connected_float_3.example.cpp | 22 + .../fully_connected_float_4d_simple.example.cpp | 22 + .../generated/examples/gather_1D_float.example.cpp | 22 + .../generated/examples/gather_1D_int32.example.cpp | 22 + .../examples/gather_1D_quant8.example.cpp | 22 + .../generated/examples/gather_2D_float.example.cpp | 22 + .../generated/examples/gather_2D_int32.example.cpp | 22 + .../examples/gather_2D_quant8.example.cpp | 22 + .../generated/examples/mean.example.cpp | 22 + .../examples/mean_axis01_1_nnfw.example.cpp | 22 + .../examples/mean_axis01_2_nnfw.example.cpp | 22 + .../generated/examples/mean_float_1.example.cpp | 22 + .../generated/examples/mean_float_2.example.cpp | 22 + .../generated/examples/mean_quant8_1.example.cpp | 22 + .../generated/examples/mean_quant8_2.example.cpp | 22 + .../mul_broadcast_3D_1D_1_nnfw.example.cpp | 22 + .../mul_broadcast_3D_1D_2_nnfw.example.cpp | 22 + .../generated/examples/pad.example.cpp | 22 + .../generated/examples/pad_float_1.example.cpp | 22 + .../generated/examples/space_to_batch.example.cpp | 22 + .../examples/space_to_batch_float_1.example.cpp | 22 + .../examples/space_to_batch_float_2.example.cpp | 22 + .../examples/space_to_batch_float_3.example.cpp | 22 + .../examples/space_to_batch_quant8_1.example.cpp | 22 + .../examples/space_to_batch_quant8_2.example.cpp | 22 + .../examples/space_to_batch_quant8_3.example.cpp | 22 + .../generated/examples/squeeze.example.cpp | 22 + .../examples/squeeze_2D_float_1_nnfw.example.cpp | 22 + .../generated/examples/squeeze_float_1.example.cpp | 22 + .../examples/squeeze_quant8_1.example.cpp | 22 + .../generated/examples/strided_slice.example.cpp | 22 + .../examples/strided_slice_ex_float_1.example.cpp | 22 + .../examples/strided_slice_ex_float_10.example.cpp | 22 + .../examples/strided_slice_ex_float_2.example.cpp | 22 + .../examples/strided_slice_ex_float_3.example.cpp | 22 + .../examples/strided_slice_ex_float_4.example.cpp | 22 + .../examples/strided_slice_ex_float_5.example.cpp | 22 + .../examples/strided_slice_ex_float_6.example.cpp | 22 + .../examples/strided_slice_ex_float_7.example.cpp | 22 + .../examples/strided_slice_ex_float_8.example.cpp | 22 + .../examples/strided_slice_ex_float_9.example.cpp | 22 + .../examples/strided_slice_float_1.example.cpp | 22 + .../examples/strided_slice_float_10.example.cpp | 22 + .../examples/strided_slice_float_11.example.cpp | 22 + .../examples/strided_slice_float_2.example.cpp | 22 + .../examples/strided_slice_float_3.example.cpp | 22 + .../examples/strided_slice_float_4.example.cpp | 22 + .../examples/strided_slice_float_5.example.cpp | 22 + .../examples/strided_slice_float_6.example.cpp | 22 + .../examples/strided_slice_float_7.example.cpp | 22 + .../examples/strided_slice_float_8.example.cpp | 22 + .../examples/strided_slice_float_9.example.cpp | 22 + .../examples/strided_slice_qaunt8_10.example.cpp | 22 + .../examples/strided_slice_qaunt8_11.example.cpp | 22 + .../examples/strided_slice_quant8_1.example.cpp | 22 + .../examples/strided_slice_quant8_2.example.cpp | 22 + .../examples/strided_slice_quant8_3.example.cpp | 22 + .../examples/strided_slice_quant8_4.example.cpp | 22 + .../examples/strided_slice_quant8_5.example.cpp | 22 + .../examples/strided_slice_quant8_6.example.cpp | 22 + .../examples/strided_slice_quant8_7.example.cpp | 22 + .../examples/strided_slice_quant8_8.example.cpp | 22 + .../examples/strided_slice_quant8_9.example.cpp | 22 + .../generated/examples/sub.example.cpp | 22 + .../examples/sub_broadcast_float.example.cpp | 22 + .../generated/examples/tanh_.example.cpp | 22 + .../examples/tensorflowmax_ex_2D_float.example.cpp | 22 + .../examples/tensorflowmax_ex_2D_int32.example.cpp | 22 + .../examples/topk_v2_1D_float.example.cpp | 22 + .../examples/topk_v2_1D_int32.example.cpp | 22 + .../examples/topk_v2_1D_quant8.example.cpp | 22 + .../examples/topk_v2_2D_float.example.cpp | 22 + .../examples/topk_v2_2D_int32.example.cpp | 22 + .../examples/topk_v2_2D_quant8.example.cpp | 22 + .../generated/examples/transpose.example.cpp | 22 + .../examples/transpose_float_1.example.cpp | 22 + .../examples/transpose_quant8_1.example.cpp | 22 + .../generated/models/batch_to_space.model.cpp | 24 + .../models/batch_to_space_float_1.model.cpp | 24 + .../models/batch_to_space_quant8_1.model.cpp | 24 + .../models/cast_ex_float32_to_int32.model.cpp | 20 + .../models/cast_ex_int32_to_float32.model.cpp | 20 + .../models/concat_float_4D_axis3_1_nnfw.model.cpp | 26 + ...onv2d_float_large_2_weights_as_inputs.model.cpp | 23 +- .../generated/models/div.model.cpp | 24 + .../generated/models/div_.model.cpp | 24 + .../generated/models/div_broadcast_float.model.cpp | 25 + .../models/embedding_lookup_2d_nnfw.model.cpp | 21 + .../models/embedding_lookup_4d_nnfw.model.cpp | 22 + .../generated/models/floor_.model.cpp | 19 + .../models/fully_connected_float_1_nnfw.model.cpp | 32 + .../models/fully_connected_float_3.model.cpp | 32 + .../fully_connected_float_4d_simple.model.cpp | 32 + .../generated/models/gather_1D_float.model.cpp | 26 + .../generated/models/gather_1D_int32.model.cpp | 25 + .../generated/models/gather_1D_quant8.model.cpp | 26 + .../generated/models/gather_2D_float.model.cpp | 26 + .../generated/models/gather_2D_int32.model.cpp | 26 + .../generated/models/gather_2D_quant8.model.cpp | 26 + .../generated/models/mean.model.cpp | 28 + .../generated/models/mean_axis01_1_nnfw.model.cpp | 28 + .../generated/models/mean_axis01_2_nnfw.model.cpp | 28 + .../generated/models/mean_float_1.model.cpp | 28 + .../generated/models/mean_float_2.model.cpp | 28 + .../generated/models/mean_quant8_1.model.cpp | 28 + .../generated/models/mean_quant8_2.model.cpp | 28 + .../models/mul_broadcast_3D_1D_1_nnfw.model.cpp | 25 + .../models/mul_broadcast_3D_1D_2_nnfw.model.cpp | 25 + .../generated/models/pad.model.cpp | 24 + .../generated/models/pad_float_1.model.cpp | 24 + .../generated/models/space_to_batch.model.cpp | 28 + .../models/space_to_batch_float_1.model.cpp | 28 + .../models/space_to_batch_float_2.model.cpp | 28 + .../models/space_to_batch_float_3.model.cpp | 28 + .../models/space_to_batch_quant8_1.model.cpp | 28 + .../models/space_to_batch_quant8_2.model.cpp | 28 + .../models/space_to_batch_quant8_3.model.cpp | 28 + .../generated/models/squeeze.model.cpp | 24 + .../models/squeeze_2D_float_1_nnfw.model.cpp | 24 + .../generated/models/squeeze_float_1.model.cpp | 24 + .../generated/models/squeeze_quant8_1.model.cpp | 24 + .../generated/models/strided_slice.model.cpp | 40 + .../models/strided_slice_ex_float_1.model.cpp | 40 + .../models/strided_slice_ex_float_10.model.cpp | 40 + .../models/strided_slice_ex_float_2.model.cpp | 40 + .../models/strided_slice_ex_float_3.model.cpp | 40 + .../models/strided_slice_ex_float_4.model.cpp | 40 + .../models/strided_slice_ex_float_5.model.cpp | 40 + .../models/strided_slice_ex_float_6.model.cpp | 40 + .../models/strided_slice_ex_float_7.model.cpp | 39 + .../models/strided_slice_ex_float_8.model.cpp | 40 + .../models/strided_slice_ex_float_9.model.cpp | 40 + .../models/strided_slice_float_1.model.cpp | 40 + .../models/strided_slice_float_10.model.cpp | 40 + .../models/strided_slice_float_11.model.cpp | 40 + .../models/strided_slice_float_2.model.cpp | 40 + .../models/strided_slice_float_3.model.cpp | 40 + .../models/strided_slice_float_4.model.cpp | 40 + .../models/strided_slice_float_5.model.cpp | 40 + .../models/strided_slice_float_6.model.cpp | 40 + .../models/strided_slice_float_7.model.cpp | 39 + .../models/strided_slice_float_8.model.cpp | 40 + .../models/strided_slice_float_9.model.cpp | 40 + .../models/strided_slice_qaunt8_10.model.cpp | 40 + .../models/strided_slice_qaunt8_11.model.cpp | 40 + .../models/strided_slice_quant8_1.model.cpp | 40 + .../models/strided_slice_quant8_2.model.cpp | 40 + .../models/strided_slice_quant8_3.model.cpp | 40 + .../models/strided_slice_quant8_4.model.cpp | 40 + .../models/strided_slice_quant8_5.model.cpp | 40 + .../models/strided_slice_quant8_6.model.cpp | 40 + .../models/strided_slice_quant8_7.model.cpp | 39 + .../models/strided_slice_quant8_8.model.cpp | 40 + .../models/strided_slice_quant8_9.model.cpp | 40 + .../generated/models/sub.model.cpp | 24 + .../generated/models/sub_broadcast_float.model.cpp | 25 + .../generated/models/tanh_.model.cpp | 19 + .../models/tensorflowmax_ex_2D_float.model.cpp | 24 + .../models/tensorflowmax_ex_2D_int32.model.cpp | 24 + .../generated/models/topk_v2_1D_float.model.cpp | 26 + .../generated/models/topk_v2_1D_int32.model.cpp | 25 + .../generated/models/topk_v2_1D_quant8.model.cpp | 26 + .../generated/models/topk_v2_2D_float.model.cpp | 26 + .../generated/models/topk_v2_2D_int32.model.cpp | 25 + .../generated/models/topk_v2_2D_quant8.model.cpp | 26 + .../generated/models/transpose.model.cpp | 23 + .../generated/models/transpose_float_1.model.cpp | 24 + .../generated/models/transpose_quant8_1.model.cpp | 24 + .../runtime_run_android_nn_test.skip.armv7l-linux | 85 + ...me_run_android_nn_test.skip.armv7l-linux.neurun | 105 + .../runtime_run_android_nn_test.skip.armv7l-tizen | 95 + .../runtime_run_android_nn_test.skip.x86_64-linux | 72 + .../specs/Ex/cast_ex_float32_to_int32.mod.py | 15 + .../specs/Ex/cast_ex_int32_to_float32.mod.py | 15 + .../specs/Ex/gather_1D_float.mod.py | 19 + .../specs/Ex/gather_1D_int32.mod.py | 19 + .../specs/Ex/gather_1D_quant8.mod.py | 19 + .../specs/Ex/gather_2D_float.mod.py | 22 + .../specs/Ex/gather_2D_int32.mod.py | 22 + .../specs/Ex/gather_2D_quant8.mod.py | 22 + .../specs/Ex/tensorflowmax_ex_2D_float.mod.py | 18 + .../specs/Ex/tensorflowmax_ex_2D_int32.mod.py | 18 + .../specs/Ex/topk_v2_1D_float.mod.py | 19 + .../specs/Ex/topk_v2_1D_int32.mod.py | 19 + .../specs/Ex/topk_v2_1D_quant8.mod.py | 19 + .../specs/Ex/topk_v2_2D_float.mod.py | 25 + .../specs/Ex/topk_v2_2D_int32.mod.py | 25 + .../specs/Ex/topk_v2_2D_quant8.mod.py | 25 + .../neural_networks_test/specs/V1_0/add.mod.py | 19 + .../specs/V1_0/add_broadcast_quant8.mod.py | 19 + .../specs/V1_0/add_quant8.mod.py | 19 + .../specs/V1_0/avg_pool_float_1.mod.py | 31 + .../specs/V1_0/avg_pool_float_2.mod.py | 51 + .../specs/V1_0/avg_pool_float_3.mod.py | 51 + .../specs/V1_0/avg_pool_float_4.mod.py | 51 + .../specs/V1_0/avg_pool_float_5.mod.py | 31 + .../specs/V1_0/avg_pool_quant8_1.mod.py | 34 + .../specs/V1_0/avg_pool_quant8_2.mod.py | 51 + .../specs/V1_0/avg_pool_quant8_3.mod.py | 51 + .../specs/V1_0/avg_pool_quant8_4.mod.py | 34 + .../specs/V1_0/avg_pool_quant8_5.mod.py | 31 + .../specs/V1_0/concat_float_1.mod.py | 31 + .../specs/V1_0/concat_float_2.mod.py | 41 + .../specs/V1_0/concat_float_3.mod.py | 47 + .../specs/V1_0/concat_float_4D_axis3_1_nnfw.mod.py | 64 + .../specs/V1_0/concat_quant8_1.mod.py | 31 + .../specs/V1_0/concat_quant8_2.mod.py | 41 + .../specs/V1_0/concat_quant8_3.mod.py | 47 + .../specs/V1_0/conv_1_h3_w2_SAME.mod.py | 21 + .../specs/V1_0/conv_1_h3_w2_VALID.mod.py | 21 + .../specs/V1_0/conv_3_h3_w2_SAME.mod.py | 21 + .../specs/V1_0/conv_3_h3_w2_VALID.mod.py | 21 + .../specs/V1_0/conv_float.mod.py | 38 + .../specs/V1_0/conv_float_2.mod.py | 36 + .../specs/V1_0/conv_float_channels.mod.py | 38 + .../conv_float_channels_weights_as_inputs.mod.py | 44 + .../specs/V1_0/conv_float_large.mod.py | 45 + .../V1_0/conv_float_large_weights_as_inputs.mod.py | 51 + .../specs/V1_0/conv_float_weights_as_inputs.mod.py | 42 + .../specs/V1_0/conv_quant8.mod.py | 45 + .../specs/V1_0/conv_quant8_2.mod.py | 45 + .../specs/V1_0/conv_quant8_channels.mod.py | 36 + .../conv_quant8_channels_weights_as_inputs.mod.py | 42 + .../specs/V1_0/conv_quant8_large.mod.py | 43 + .../conv_quant8_large_weights_as_inputs.mod.py | 49 + .../specs/V1_0/conv_quant8_overflow.mod.py | 43 + .../conv_quant8_overflow_weights_as_inputs.mod.py | 49 + .../V1_0/conv_quant8_weights_as_inputs.mod.py | 42 + .../specs/V1_0/depth_to_space_float_1.mod.py | 16 + .../specs/V1_0/depth_to_space_float_2.mod.py | 16 + .../specs/V1_0/depth_to_space_float_3.mod.py | 22 + .../specs/V1_0/depth_to_space_quant8_1.mod.py | 16 + .../specs/V1_0/depth_to_space_quant8_2.mod.py | 16 + .../specs/V1_0/depthwise_conv.mod.py | 22 + .../specs/V1_0/depthwise_conv2d_float.mod.py | 51 + .../specs/V1_0/depthwise_conv2d_float_2.mod.py | 44 + .../specs/V1_0/depthwise_conv2d_float_large.mod.py | 44 + .../V1_0/depthwise_conv2d_float_large_2.mod.py | 46 + ...e_conv2d_float_large_2_weights_as_inputs.mod.py | 53 + ...ise_conv2d_float_large_weights_as_inputs.mod.py | 49 + ...depthwise_conv2d_float_weights_as_inputs.mod.py | 58 + .../specs/V1_0/depthwise_conv2d_quant8.mod.py | 41 + .../specs/V1_0/depthwise_conv2d_quant8_2.mod.py | 44 + .../V1_0/depthwise_conv2d_quant8_large.mod.py | 41 + ...se_conv2d_quant8_large_weights_as_inputs.mod.py | 45 + ...epthwise_conv2d_quant8_weights_as_inputs.mod.py | 45 + .../specs/V1_0/dequantize.mod.py | 15 + .../specs/V1_0/embedding_lookup.mod.py | 45 + .../specs/V1_0/embedding_lookup_2d_nnfw.mod.py | 43 + .../specs/V1_0/embedding_lookup_4d_nnfw.mod.py | 42 + .../neural_networks_test/specs/V1_0/floor_.mod.py | 17 + .../specs/V1_0/fully_connected_float.mod.py | 32 + .../specs/V1_0/fully_connected_float_1_nnfw.mod.py | 34 + .../specs/V1_0/fully_connected_float_2.mod.py | 61 + .../specs/V1_0/fully_connected_float_3.mod.py | 32 + .../specs/V1_0/fully_connected_float_large.mod.py | 32 + ..._connected_float_large_weights_as_inputs.mod.py | 36 + .../fully_connected_float_weights_as_inputs.mod.py | 34 + .../specs/V1_0/fully_connected_quant8.mod.py | 32 + .../specs/V1_0/fully_connected_quant8_2.mod.py | 36 + .../specs/V1_0/fully_connected_quant8_large.mod.py | 32 + ...connected_quant8_large_weights_as_inputs.mod.py | 36 + ...fully_connected_quant8_weights_as_inputs.mod.py | 34 + .../specs/V1_0/hashtable_lookup_float.mod.py | 54 + .../specs/V1_0/hashtable_lookup_quant8.mod.py | 54 + .../specs/V1_0/l2_normalization.mod.py | 32 + .../specs/V1_0/l2_normalization_2.mod.py | 32 + .../specs/V1_0/l2_normalization_large.mod.py | 38 + .../specs/V1_0/l2_pool_float.mod.py | 30 + .../specs/V1_0/l2_pool_float_2.mod.py | 31 + .../specs/V1_0/l2_pool_float_large.mod.py | 41 + .../specs/V1_0/local_response_norm_float_1.mod.py | 19 + .../specs/V1_0/local_response_norm_float_2.mod.py | 19 + .../specs/V1_0/local_response_norm_float_3.mod.py | 19 + .../specs/V1_0/local_response_norm_float_4.mod.py | 19 + .../specs/V1_0/logistic_float_1.mod.py | 35 + .../specs/V1_0/logistic_float_2.mod.py | 39 + .../specs/V1_0/logistic_quant8_1.mod.py | 32 + .../specs/V1_0/logistic_quant8_2.mod.py | 42 + .../specs/V1_0/lsh_projection.mod.py | 40 + .../specs/V1_0/lsh_projection_2.mod.py | 41 + .../V1_0/lsh_projection_weights_as_inputs.mod.py | 38 + .../neural_networks_test/specs/V1_0/lstm.mod.py | 148 + .../neural_networks_test/specs/V1_0/lstm2.mod.py | 142 + .../specs/V1_0/lstm2_state.mod.py | 141 + .../specs/V1_0/lstm2_state2.mod.py | 142 + .../neural_networks_test/specs/V1_0/lstm3.mod.py | 662 + .../specs/V1_0/lstm3_state.mod.py | 683 + .../specs/V1_0/lstm3_state2.mod.py | 683 + .../specs/V1_0/lstm3_state3.mod.py | 663 + .../specs/V1_0/lstm_state.mod.py | 148 + .../specs/V1_0/lstm_state2.mod.py | 148 + .../specs/V1_0/max_pool_float_1.mod.py | 31 + .../specs/V1_0/max_pool_float_2.mod.py | 53 + .../specs/V1_0/max_pool_float_3.mod.py | 53 + .../specs/V1_0/max_pool_float_4.mod.py | 31 + .../specs/V1_0/max_pool_quant8_1.mod.py | 31 + .../specs/V1_0/max_pool_quant8_2.mod.py | 53 + .../specs/V1_0/max_pool_quant8_3.mod.py | 53 + .../specs/V1_0/max_pool_quant8_4.mod.py | 31 + .../V1_0/mobilenet_224_gender_basic_fixed.mod.py | 259 + .../specs/V1_0/mobilenet_quantized.mod.py | 261 + .../neural_networks_test/specs/V1_0/mul.mod.py | 19 + .../specs/V1_0/mul_broadcast_3D_1D_1_nnfw.mod.py | 42 + .../specs/V1_0/mul_broadcast_3D_1D_2_nnfw.mod.py | 43 + .../specs/V1_0/mul_broadcast_quant8.mod.py | 19 + .../specs/V1_0/mul_quant8.mod.py | 19 + .../specs/V1_0/mul_relu.mod.py | 19 + .../specs/V1_0/relu1_float_1.mod.py | 28 + .../specs/V1_0/relu1_float_2.mod.py | 39 + .../specs/V1_0/relu1_quant8_1.mod.py | 39 + .../specs/V1_0/relu1_quant8_2.mod.py | 39 + .../specs/V1_0/relu6_float_1.mod.py | 28 + .../specs/V1_0/relu6_float_2.mod.py | 39 + .../specs/V1_0/relu6_quant8_1.mod.py | 37 + .../specs/V1_0/relu6_quant8_2.mod.py | 39 + .../specs/V1_0/relu_float_1.mod.py | 28 + .../specs/V1_0/relu_float_2.mod.py | 39 + .../specs/V1_0/relu_quant8_1.mod.py | 41 + .../specs/V1_0/relu_quant8_2.mod.py | 39 + .../neural_networks_test/specs/V1_0/reshape.mod.py | 18 + .../specs/V1_0/reshape_quant8.mod.py | 19 + .../V1_0/reshape_quant8_weights_as_inputs.mod.py | 21 + .../specs/V1_0/reshape_weights_as_inputs.mod.py | 20 + .../specs/V1_0/resize_bilinear.mod.py | 18 + .../specs/V1_0/resize_bilinear_2.mod.py | 34 + .../neural_networks_test/specs/V1_0/rnn.mod.py | 201 + .../specs/V1_0/rnn_state.mod.py | 126 + .../specs/V1_0/softmax_float_1.mod.py | 17 + .../specs/V1_0/softmax_float_2.mod.py | 21 + .../specs/V1_0/softmax_quant8_1.mod.py | 17 + .../specs/V1_0/softmax_quant8_2.mod.py | 21 + .../specs/V1_0/space_to_depth_float_1.mod.py | 16 + .../specs/V1_0/space_to_depth_float_2.mod.py | 16 + .../specs/V1_0/space_to_depth_float_3.mod.py | 22 + .../specs/V1_0/space_to_depth_quant8_1.mod.py | 16 + .../specs/V1_0/space_to_depth_quant8_2.mod.py | 16 + .../neural_networks_test/specs/V1_0/svdf.mod.py | 138 + .../neural_networks_test/specs/V1_0/svdf2.mod.py | 153 + .../specs/V1_0/svdf_state.mod.py | 114 + .../neural_networks_test/specs/V1_0/tanh_.mod.py | 16 + .../specs/V1_1/batch_to_space.mod.py | 16 + .../specs/V1_1/batch_to_space_float_1.mod.py | 16 + .../specs/V1_1/batch_to_space_quant8_1.mod.py | 16 + .../neural_networks_test/specs/V1_1/div_.mod.py | 19 + .../specs/V1_1/div_broadcast_float.mod.py | 19 + .../V1_1/fully_connected_float_4d_simple.mod.py | 42 + .../neural_networks_test/specs/V1_1/mean.mod.py | 19 + .../specs/V1_1/mean_axis01_1_nnfw.mod.py | 18 + .../specs/V1_1/mean_axis01_2_nnfw.mod.py | 17 + .../specs/V1_1/mean_float_1.mod.py | 18 + .../specs/V1_1/mean_float_2.mod.py | 18 + .../specs/V1_1/mean_quant8_1.mod.py | 19 + .../specs/V1_1/mean_quant8_2.mod.py | 19 + .../neural_networks_test/specs/V1_1/pad.mod.py | 20 + .../specs/V1_1/pad_float_1.mod.py | 18 + .../specs/V1_1/space_to_batch.mod.py | 17 + .../specs/V1_1/space_to_batch_float_1.mod.py | 17 + .../specs/V1_1/space_to_batch_float_2.mod.py | 18 + .../specs/V1_1/space_to_batch_float_3.mod.py | 19 + .../specs/V1_1/space_to_batch_quant8_1.mod.py | 17 + .../specs/V1_1/space_to_batch_quant8_2.mod.py | 18 + .../specs/V1_1/space_to_batch_quant8_3.mod.py | 19 + .../neural_networks_test/specs/V1_1/squeeze.mod.py | 16 + .../specs/V1_1/squeeze_2D_float_1_nnfw.mod.py | 16 + .../specs/V1_1/squeeze_float_1.mod.py | 18 + .../specs/V1_1/squeeze_quant8_1.mod.py | 18 + .../specs/V1_1/strided_slice.mod.py | 23 + .../specs/V1_1/strided_slice_float_1.mod.py | 22 + .../specs/V1_1/strided_slice_float_10.mod.py | 22 + .../specs/V1_1/strided_slice_float_11.mod.py | 22 + .../specs/V1_1/strided_slice_float_2.mod.py | 22 + .../specs/V1_1/strided_slice_float_3.mod.py | 22 + .../specs/V1_1/strided_slice_float_4.mod.py | 22 + .../specs/V1_1/strided_slice_float_5.mod.py | 22 + .../specs/V1_1/strided_slice_float_6.mod.py | 22 + .../specs/V1_1/strided_slice_float_7.mod.py | 22 + .../specs/V1_1/strided_slice_float_8.mod.py | 22 + .../specs/V1_1/strided_slice_float_9.mod.py | 22 + .../specs/V1_1/strided_slice_qaunt8_10.mod.py | 22 + .../specs/V1_1/strided_slice_qaunt8_11.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_1.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_2.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_3.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_4.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_5.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_6.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_7.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_8.mod.py | 22 + .../specs/V1_1/strided_slice_quant8_9.mod.py | 22 + .../neural_networks_test/specs/V1_1/sub.mod.py | 19 + .../specs/V1_1/sub_broadcast_float.mod.py | 19 + .../specs/V1_1/transpose.mod.py | 18 + .../specs/V1_1/transpose_float_1.mod.py | 32 + .../specs/V1_1/transpose_quant8_1.mod.py | 32 + .../neural_networks_test/specs/generate_test.sh | 118 + .../specs/generate_vts_test.sh | 68 + .../tests/neural_networks_test/specs/slicing.sh | 74 + scripts/command/docker-run | 26 + scripts/command/docker-shell | 24 + scripts/command/docker_build_cross_arm_neurun.sh | 36 + scripts/command/docker_build_cross_arm_ubuntu.sh | 44 +- ...cker_build_cross_arm_ubuntu_without_aclbuild.sh | 22 +- scripts/command/docker_build_tizen_cross.sh | 22 +- scripts/command/docker_build_ubuntu_coverity.sh | 72 + scripts/command/docker_build_ubuntu_svace.sh | 32 +- scripts/command/docker_coverage_report.sh | 26 +- .../command/docker_cross_test_coverage_build.sh | 34 +- scripts/command/docker_env_neurun | 1 + .../docker_env_pureacl_tflite_benchmark_model | 2 + scripts/command/docker_gbs_build.sh | 22 +- scripts/command/docker_run.sh | 24 - scripts/command/docker_run_test.sh | 36 +- scripts/command/format-checker.sh | 95 +- scripts/command/gen_coverage_report.sh | 23 +- scripts/command/nnfw_docker | 14 + scripts/command/nnfw_docker_tizen | 14 + scripts/command/run_coverity.sh | 60 + scripts/command/tizen_xu4_test.sh | 26 +- scripts/docker/Dockerfile | 6 +- scripts/docker/Dockerfile_tizen | 5 + scripts/docker_helper | 33 + scripts/git-hooks/install_hooks.sh | 11 + scripts/git-hooks/pre-push | 32 + tests/framework/run_test.sh | 76 +- .../tests/MODELS/inception_module/config.sh | 1 + .../tests/MODELS/inception_nonslim/config.sh | 3 + .../tests/MODELS/inception_slim/config.sh | 3 + tests/framework/tests/MODELS/mobilenet/config.sh | 3 + tests/framework/tests/add/1D/config.sh | 1 + tests/framework/tests/add/4D/config.sh | 1 + .../tests/average_pool_2d/avgpool1/config.sh | 1 + .../tests/average_pool_2d/avgpool2/config.sh | 1 + tests/framework/tests/cast/config.sh | 1 + tests/framework/tests/concat/2D/config.sh | 2 + tests/framework/tests/concat/concat1/config.sh | 1 + tests/framework/tests/concat/concat2/config.sh | 1 + .../framework/tests/conv_2d/convolution1/config.sh | 1 + .../framework/tests/conv_2d/convolution2/config.sh | 1 + .../framework/tests/custom/tensorflowmax/config.sh | 1 + .../tests/depthwise_conv_2d/depthconv1/config.sh | 1 + .../tests/depthwise_conv_2d/depthconv2/config.sh | 1 + tests/framework/tests/div/broadcast/config.sh | 1 + tests/framework/tests/embedding_lookup/config.sh | 2 + tests/framework/tests/floor/floor1/config.sh | 1 + tests/framework/tests/floor/floor2/config.sh | 1 + tests/framework/tests/fullyconnected/fc1/config.sh | 1 + .../tests/fullyconnected/matmul2x2/config.sh | 7 + tests/framework/tests/gather/config.sh | 1 + tests/framework/tests/hashtable_lookup/config.sh | 2 + .../tests/inceptionv3/inception_nonslim/config.sh | 9 - .../tests/inceptionv3/inception_slim/config.sh | 9 - tests/framework/tests/l2_normalization/config.sh | 2 + tests/framework/tests/l2_pool_2d/config.sh | 2 + tests/framework/tests/logistic/config.sh | 2 + .../framework/tests/max_pool_2d/maxpool1/config.sh | 1 + .../framework/tests/max_pool_2d/maxpool2/config.sh | 1 + tests/framework/tests/mean/config.sh | 1 + tests/framework/tests/mul/broadcast/config.sh | 1 + tests/framework/tests/pad/4D_2D/config.sh | 1 + tests/framework/tests/pad/pad1/config.sh | 2 + tests/framework/tests/pad/pad2/config.sh | 2 + tests/framework/tests/reduce_mean/test1/config.sh | 3 + tests/framework/tests/reduce_mean/test2/config.sh | 3 + tests/framework/tests/relu/config.sh | 1 + tests/framework/tests/relu6/config.sh | 1 + tests/framework/tests/reshape/3D/config.sh | 1 + tests/framework/tests/reshape/reshape1/config.sh | 1 + tests/framework/tests/reshape/reshape2/config.sh | 1 + tests/framework/tests/resize_bilinear/config.sh | 1 + tests/framework/tests/rnn/config.sh | 2 + tests/framework/tests/softmax/config.sh | 1 + tests/framework/tests/space_to_depth/config.sh | 1 + tests/framework/tests/squeeze/config.sh | 2 + tests/framework/tests/strided_slice/config.sh | 1 + tests/framework/tests/sub/broadcast/config.sh | 2 + tests/framework/tests/tanh/config.sh | 2 + tests/framework/tests/topk_v2/config.sh | 1 + tests/framework/tests/tranpose/config.sh | 2 + tools/CMakeLists.txt | 8 + tools/cross/apt_proxy | 0 tools/cross/build_android_rootfs.sh | 62 +- tools/cross/build_rootfs.sh | 25 +- tools/extract_weights_from_tflite/extract.py | 90 + .../extract_from_tflite.sh | 31 + tools/extract_weights_from_tflite/print_op.py | 58 + tools/image_importer/README.md | 15 + tools/image_importer/image_importer.py | 33 + tools/image_importer/imagegen.py | 40 + tools/modelgen/CONV_2D.template.json | 102 + tools/modelgen/modelgen.py | 98 + tools/modelgen/modelgen.sh | 31 + tools/nnapi_quickcheck/CMakeLists.txt | 82 + tools/nnapi_quickcheck/inc/env.h | 60 + tools/nnapi_quickcheck/inc/memory.h | 34 + tools/nnapi_quickcheck/lib/env.cpp | 50 + tools/nnapi_quickcheck/lib/env.test.cpp | 45 + tools/nnapi_quickcheck/tests/add_1.cpp | 159 + tools/nnapi_quickcheck/tests/add_1.lst | 13 + tools/nnapi_quickcheck/tests/add_2.cpp | 177 + tools/nnapi_quickcheck/tests/add_2.lst | 13 + tools/nnapi_quickcheck/tests/add_3.cpp | 137 + tools/nnapi_quickcheck/tests/add_3.lst | 6 + tools/nnapi_quickcheck/tests/add_4.cpp | 159 + tools/nnapi_quickcheck/tests/add_4.lst | 13 + tools/nnapi_quickcheck/tests/add_5.cpp | 152 + tools/nnapi_quickcheck/tests/add_5.lst | 10 + tools/nnapi_quickcheck/tests/add_6.cpp | 144 + tools/nnapi_quickcheck/tests/add_6.lst | 8 + tools/nnapi_quickcheck/tests/add_7.cpp | 152 + tools/nnapi_quickcheck/tests/add_7.lst | 11 + tools/nnapi_quickcheck/tests/add_8.cpp | 190 + tools/nnapi_quickcheck/tests/add_8.lst | 13 + tools/nnapi_quickcheck/tests/add_9.cpp | 187 + tools/nnapi_quickcheck/tests/add_9.lst | 13 + tools/nnapi_quickcheck/tests/add_quan_1.cpp | 162 + tools/nnapi_quickcheck/tests/add_quan_1.lst | 13 + tools/nnapi_quickcheck/tests/avg_pool_1.cpp | 150 + tools/nnapi_quickcheck/tests/avg_pool_1.lst | 10 + tools/nnapi_quickcheck/tests/avg_pool_quan_1.cpp | 149 + tools/nnapi_quickcheck/tests/avg_pool_quan_1.lst | 10 + tools/nnapi_quickcheck/tests/cast_1.cpp | 136 + tools/nnapi_quickcheck/tests/cast_1.lst | 8 + tools/nnapi_quickcheck/tests/cast_2.cpp | 134 + tools/nnapi_quickcheck/tests/cast_2.lst | 8 + tools/nnapi_quickcheck/tests/cast_q_to_f_1.cpp | 136 + tools/nnapi_quickcheck/tests/cast_q_to_f_1.lst | 8 + tools/nnapi_quickcheck/tests/concat_1.cpp | 161 + tools/nnapi_quickcheck/tests/concat_1.lst | 8 + tools/nnapi_quickcheck/tests/concat_quan_1.cpp | 163 + tools/nnapi_quickcheck/tests/concat_quan_1.lst | 8 + tools/nnapi_quickcheck/tests/conv_1.cpp | 207 + tools/nnapi_quickcheck/tests/conv_1.lst | 14 + tools/nnapi_quickcheck/tests/conv_quan_1.cpp | 211 + tools/nnapi_quickcheck/tests/conv_quan_1.lst | 14 + tools/nnapi_quickcheck/tests/dconv_1.cpp | 205 + tools/nnapi_quickcheck/tests/dconv_1.lst | 16 + tools/nnapi_quickcheck/tests/dconv_quan_1.cpp | 209 + tools/nnapi_quickcheck/tests/dconv_quan_1.lst | 16 + tools/nnapi_quickcheck/tests/dequantize_1.cpp | 136 + tools/nnapi_quickcheck/tests/dequantize_1.lst | 8 + tools/nnapi_quickcheck/tests/div_1.cpp | 159 + tools/nnapi_quickcheck/tests/div_1.lst | 13 + tools/nnapi_quickcheck/tests/div_2.cpp | 152 + tools/nnapi_quickcheck/tests/div_2.lst | 10 + tools/nnapi_quickcheck/tests/fully_connected_1.cpp | 187 + tools/nnapi_quickcheck/tests/fully_connected_1.lst | 9 + .../tests/fully_connected_quan_1.cpp | 189 + .../tests/fully_connected_quan_1.lst | 9 + tools/nnapi_quickcheck/tests/gather_1.cpp | 132 + tools/nnapi_quickcheck/tests/gather_1.lst | 6 + tools/nnapi_quickcheck/tests/gather_2.cpp | 136 + tools/nnapi_quickcheck/tests/gather_2.lst | 7 + tools/nnapi_quickcheck/tests/logistic_quan_1.cpp | 140 + tools/nnapi_quickcheck/tests/logistic_quan_1.lst | 8 + tools/nnapi_quickcheck/tests/max_pool_1.cpp | 156 + tools/nnapi_quickcheck/tests/max_pool_1.lst | 17 + tools/nnapi_quickcheck/tests/max_pool_quan_1.cpp | 158 + tools/nnapi_quickcheck/tests/max_pool_quan_1.lst | 17 + tools/nnapi_quickcheck/tests/mul_1.cpp | 152 + tools/nnapi_quickcheck/tests/mul_1.lst | 10 + tools/nnapi_quickcheck/tests/mul_2.cpp | 150 + tools/nnapi_quickcheck/tests/mul_2.lst | 9 + tools/nnapi_quickcheck/tests/mul_quan_1.cpp | 152 + tools/nnapi_quickcheck/tests/mul_quan_1.lst | 10 + tools/nnapi_quickcheck/tests/relu1_1.cpp | 121 + tools/nnapi_quickcheck/tests/relu1_1.lst | 6 + tools/nnapi_quickcheck/tests/relu6_1.cpp | 125 + tools/nnapi_quickcheck/tests/relu6_1.lst | 6 + tools/nnapi_quickcheck/tests/relu6_quan_1.cpp | 123 + tools/nnapi_quickcheck/tests/relu6_quan_1.lst | 6 + tools/nnapi_quickcheck/tests/relu_1.cpp | 125 + tools/nnapi_quickcheck/tests/relu_1.lst | 6 + tools/nnapi_quickcheck/tests/relu_2.cpp | 128 + tools/nnapi_quickcheck/tests/relu_2.lst | 7 + tools/nnapi_quickcheck/tests/relu_3.cpp | 131 + tools/nnapi_quickcheck/tests/relu_3.lst | 8 + tools/nnapi_quickcheck/tests/relu_quan_1.cpp | 123 + tools/nnapi_quickcheck/tests/relu_quan_1.lst | 6 + tools/nnapi_quickcheck/tests/reshape_1.cpp | 141 + tools/nnapi_quickcheck/tests/reshape_1.lst | 7 + tools/nnapi_quickcheck/tests/reshape_quan_1.cpp | 143 + tools/nnapi_quickcheck/tests/reshape_quan_1.lst | 7 + tools/nnapi_quickcheck/tests/resize_bilinear_1.cpp | 141 + tools/nnapi_quickcheck/tests/resize_bilinear_1.lst | 10 + tools/nnapi_quickcheck/tests/softmax_1.cpp | 120 + tools/nnapi_quickcheck/tests/softmax_1.lst | 6 + tools/nnapi_quickcheck/tests/softmax_2.cpp | 139 + tools/nnapi_quickcheck/tests/softmax_2.lst | 11 + tools/nnapi_quickcheck/tests/softmax_quan_1.cpp | 122 + tools/nnapi_quickcheck/tests/softmax_quan_1.lst | 6 + tools/nnapi_quickcheck/tests/split_1.cpp | 153 + tools/nnapi_quickcheck/tests/split_1.lst | 10 + tools/nnapi_quickcheck/tests/split_2.cpp | 153 + tools/nnapi_quickcheck/tests/split_2.lst | 10 + tools/nnapi_quickcheck/tests/split_3.cpp | 147 + tools/nnapi_quickcheck/tests/split_3.lst | 8 + tools/nnapi_quickcheck/tests/split_4.cpp | 147 + tools/nnapi_quickcheck/tests/split_4.lst | 8 + tools/nnapi_quickcheck/tests/sub_1.cpp | 159 + tools/nnapi_quickcheck/tests/sub_1.lst | 13 + tools/nnapi_quickcheck/tests/sub_2.cpp | 152 + tools/nnapi_quickcheck/tests/sub_2.lst | 10 + tools/nnapi_quickcheck/tests/sub_3.cpp | 144 + tools/nnapi_quickcheck/tests/sub_3.lst | 8 + tools/nnapi_quickcheck/tests/sub_4.cpp | 152 + tools/nnapi_quickcheck/tests/sub_4.lst | 11 + tools/nnapi_quickcheck/tests/sub_5.cpp | 188 + tools/nnapi_quickcheck/tests/sub_5.lst | 13 + tools/nnapi_quickcheck/tests/sub_6.cpp | 188 + tools/nnapi_quickcheck/tests/sub_6.lst | 13 + tools/nnapi_quickcheck/tests/tanh_1.cpp | 134 + tools/nnapi_quickcheck/tests/tanh_1.lst | 8 + tools/nnapi_quickcheck/tests/topk_v2_1.cpp | 138 + tools/nnapi_quickcheck/tests/topk_v2_1.lst | 6 + tools/nnapi_test/src/nnapi_test.cc | 26 +- tools/opencl_tool/CMakeLists.txt | 12 + tools/opencl_tool/src/opencl_info.cc | 154 + tools/pbfile_tool/convert_ckpt_to_pb.py | 80 + tools/pbfile_tool/pb_info.py | 158 + tools/pbfile_tool/readme.md | 17 + tools/tensorflow_model_freezer/__init__.py | 15 + tools/tensorflow_model_freezer/base_freezer.py | 201 + .../tensorflow_model_freezer/model_freezer_util.py | 233 + tools/tensorflow_model_freezer/readme.md | 20 + tools/tensorflow_model_freezer/sample/DIV_gen.py | 148 + tools/tensorflow_model_freezer/sample/MUL_gen.py | 128 + .../sample/Operation_gen.py | 214 + .../tensorflow_model_freezer/sample/SQUEEZE_gen.py | 127 + tools/tensorflow_model_freezer/sample/TOPK_gen.py | 119 + tools/tensorflow_model_freezer/sample/__init__.py | 15 + tools/test_driver/README.md | 63 + tools/test_driver/benchmark_op_list.txt | 11 + tools/test_driver/common.sh | 34 + tools/test_driver/neurun_frameworktest_list.txt | 10 + tools/test_driver/print_to_json.sh | 35 +- tools/test_driver/py/common.py | 39 + tools/test_driver/py/run_frameworktest.py | 199 + tools/test_driver/py/run_unittest.py | 187 + tools/test_driver/py/test_driver.py | 398 + tools/test_driver/run_benchmark.sh | 146 + tools/test_driver/run_benchmark_acl.sh | 113 + tools/test_driver/run_benchmark_op.sh | 209 + tools/test_driver/run_benchmark_tflite_model.in | 1 + tools/test_driver/run_benchmark_tflite_model.sh | 125 + tools/test_driver/run_frameworktest.sh | 95 + tools/test_driver/run_unittest.sh | 109 + tools/test_driver/test_driver.sh | 372 +- tools/tflite_benchmark/CMakeLists.txt | 5 + tools/tflite_benchmark/src/tflite_benchmark.cc | 231 + tools/tflite_benchmark_model/.FORMATDENY | 0 tools/tflite_benchmark_model/CMakeLists.txt | 6 + tools/tflite_benchmark_model/README.md | 209 + tools/tflite_benchmark_model/benchmark_main.cc | 53 + tools/tflite_benchmark_model/benchmark_model.cc | 175 + tools/tflite_benchmark_model/benchmark_model.h | 177 + tools/tflite_benchmark_model/benchmark_params.cc | 73 + tools/tflite_benchmark_model/benchmark_params.h | 118 + .../benchmark_tflite_model.cc | 360 + .../benchmark_tflite_model.h | 95 + tools/tflite_benchmark_model/command_line_flags.cc | 214 + tools/tflite_benchmark_model/command_line_flags.h | 141 + tools/tflite_benchmark_model/logging.h | 92 + tools/tflite_benchmark_model/profile_summarizer.cc | 164 + tools/tflite_benchmark_model/profile_summarizer.h | 55 + tools/tflite_examples/CMakeLists.txt | 2 + tools/tflite_examples/src/conv.cpp | 330 + tools/tflite_run/CMakeLists.txt | 26 + tools/tflite_run/README.md | 91 + tools/tflite_run/src/args.cc | 125 + tools/tflite_run/src/args.h | 55 + tools/tflite_run/src/bin_image.cc | 71 + tools/tflite_run/src/bin_image.h | 43 + tools/tflite_run/src/tensor_dumper.cc | 54 + tools/tflite_run/src/tensor_dumper.h | 38 + tools/tflite_run/src/tensor_loader.cc | 67 + tools/tflite_run/src/tensor_loader.h | 35 + tools/tflite_run/src/tflite_run.cc | 253 + tools/tflite_run/src/tflite_test.cc | 19 + tools/tflitefile_tool/README.md | 81 + tools/tflitefile_tool/model_parser.py | 110 + tools/tflitefile_tool/operation.py | 199 + tools/tflitefile_tool/operator_parser.py | 113 + tools/tflitefile_tool/operator_wrapping.py | 120 + tools/tflitefile_tool/perf_predictor.py | 15 + tools/tflitefile_tool/select_operator.py | 825 + tools/tflitefile_tool/tensor_wrapping.py | 54 + .../tflite/ActivationFunctionType.py | 12 + tools/tflitefile_tool/tflite/AddOptions.py | 39 + tools/tflitefile_tool/tflite/ArgMaxOptions.py | 39 + tools/tflitefile_tool/tflite/ArgMinOptions.py | 39 + .../tflite/BatchToSpaceNDOptions.py | 28 + .../tflite/BidirectionalSequenceRNNOptions.py | 51 + tools/tflitefile_tool/tflite/Buffer.py | 61 + tools/tflitefile_tool/tflite/BuiltinOperator.py | 86 + tools/tflitefile_tool/tflite/BuiltinOptions.py | 65 + tools/tflitefile_tool/tflite/CallOptions.py | 39 + tools/tflitefile_tool/tflite/CastOptions.py | 50 + tools/tflitefile_tool/tflite/CombinerType.py | 9 + .../tflite/ConcatEmbeddingsOptions.py | 105 + .../tflitefile_tool/tflite/ConcatenationOptions.py | 50 + tools/tflitefile_tool/tflite/Conv2DOptions.py | 94 + .../tflitefile_tool/tflite/CustomOptionsFormat.py | 7 + .../tflite/DepthwiseConv2DOptions.py | 83 + tools/tflitefile_tool/tflite/DequantizeOptions.py | 28 + tools/tflitefile_tool/tflite/DivOptions.py | 39 + .../tflite/EmbeddingLookupSparseOptions.py | 39 + tools/tflitefile_tool/tflite/EqualOptions.py | 28 + tools/tflitefile_tool/tflite/ExpOptions.py | 28 + tools/tflitefile_tool/tflite/ExpandDimsOptions.py | 28 + tools/tflitefile_tool/tflite/FakeQuantOptions.py | 72 + .../tflite/FullyConnectedOptions.py | 50 + .../tflite/FullyConnectedOptionsWeightsFormat.py | 8 + tools/tflitefile_tool/tflite/GatherOptions.py | 39 + .../tflitefile_tool/tflite/GreaterEqualOptions.py | 28 + tools/tflitefile_tool/tflite/GreaterOptions.py | 28 + tools/tflitefile_tool/tflite/L2NormOptions.py | 39 + .../tflitefile_tool/tflite/LSHProjectionOptions.py | 39 + tools/tflitefile_tool/tflite/LSHProjectionType.py | 9 + tools/tflitefile_tool/tflite/LSTMKernelType.py | 8 + tools/tflitefile_tool/tflite/LSTMOptions.py | 72 + tools/tflitefile_tool/tflite/LessEqualOptions.py | 28 + tools/tflitefile_tool/tflite/LessOptions.py | 28 + .../tflite/LocalResponseNormalizationOptions.py | 72 + tools/tflitefile_tool/tflite/LogSoftmaxOptions.py | 28 + .../tflite/MaximumMinimumOptions.py | 28 + tools/tflitefile_tool/tflite/MeanOptions.py | 39 + tools/tflitefile_tool/tflite/Model.py | 171 + tools/tflitefile_tool/tflite/MulOptions.py | 39 + tools/tflitefile_tool/tflite/NegOptions.py | 28 + tools/tflitefile_tool/tflite/NotEqualOptions.py | 28 + tools/tflitefile_tool/tflite/Operator.py | 208 + tools/tflitefile_tool/tflite/OperatorCode.py | 62 + tools/tflitefile_tool/tflite/PadOptions.py | 28 + tools/tflitefile_tool/tflite/PadV2Options.py | 28 + tools/tflitefile_tool/tflite/Padding.py | 8 + tools/tflitefile_tool/tflite/Pool2DOptions.py | 94 + tools/tflitefile_tool/tflite/PowOptions.py | 28 + .../tflite/QuantizationParameters.py | 160 + tools/tflitefile_tool/tflite/RNNOptions.py | 39 + tools/tflitefile_tool/tflite/ReducerOptions.py | 39 + tools/tflitefile_tool/tflite/ReshapeOptions.py | 61 + .../tflite/ResizeBilinearOptions.py | 39 + tools/tflitefile_tool/tflite/SVDFOptions.py | 50 + tools/tflitefile_tool/tflite/SelectOptions.py | 28 + tools/tflitefile_tool/tflite/SequenceRNNOptions.py | 50 + tools/tflitefile_tool/tflite/ShapeOptions.py | 39 + tools/tflitefile_tool/tflite/SkipGramOptions.py | 61 + tools/tflitefile_tool/tflite/SliceOptions.py | 28 + tools/tflitefile_tool/tflite/SoftmaxOptions.py | 39 + .../tflite/SpaceToBatchNDOptions.py | 28 + .../tflitefile_tool/tflite/SpaceToDepthOptions.py | 39 + .../tflitefile_tool/tflite/SparseToDenseOptions.py | 39 + tools/tflitefile_tool/tflite/SplitOptions.py | 39 + tools/tflitefile_tool/tflite/SqueezeOptions.py | 61 + .../tflitefile_tool/tflite/StridedSliceOptions.py | 83 + tools/tflitefile_tool/tflite/SubGraph.py | 164 + tools/tflitefile_tool/tflite/SubOptions.py | 39 + tools/tflitefile_tool/tflite/Tensor.py | 122 + tools/tflitefile_tool/tflite/TensorType.py | 15 + tools/tflitefile_tool/tflite/TileOptions.py | 28 + tools/tflitefile_tool/tflite/TopKV2Options.py | 28 + .../tflitefile_tool/tflite/TransposeConvOptions.py | 61 + tools/tflitefile_tool/tflite/TransposeOptions.py | 28 + tools/tflitefile_tool/tflite/__init__.py | 0 1899 files changed, 101213 insertions(+), 154059 deletions(-) create mode 100644 .ctags create mode 100644 benchmark/CMakeLists.txt create mode 100644 benchmark/acl/Benchmark.cpp create mode 100644 benchmark/acl/Benchmark.h create mode 100644 benchmark/acl/CMakeLists.txt create mode 100644 benchmark/acl/benchmark_googlenet.cpp create mode 100644 benchmark/acl/benchmark_inception_v3.cpp create mode 100644 benchmark/acl/benchmark_mobilenet.cpp create mode 100644 cmake/ApplyCompileFlags.cmake create mode 100644 cmake/CfgOptionFlags.cmake create mode 100644 cmake/modules/ExternalProjectTools.cmake create mode 100644 cmake/modules/ExternalSourceTools.cmake create mode 100644 cmake/modules/OptionTools.cmake create mode 100644 cmake/option/identify_platform.cmake create mode 100644 cmake/packages/ARMCompute/CMakeLists.txt create mode 100644 cmake/packages/ARMComputeConfig.cmake create mode 100644 cmake/packages/EigenConfig.cmake create mode 100644 cmake/packages/EigenSourceConfig.cmake create mode 100644 cmake/packages/FarmhashSourceConfig.cmake create mode 100644 cmake/packages/FlatBuffersConfig.cmake create mode 100644 cmake/packages/FlatBuffersSourceConfig.cmake create mode 100644 cmake/packages/GEMMLowpSourceConfig.cmake create mode 100644 cmake/packages/GTestConfig.cmake create mode 100644 cmake/packages/NEON2SSESourceConfig.cmake create mode 100644 cmake/packages/TensorFlowSourceConfig.cmake create mode 100644 cmake/packages/TensorflowConfig.cmake create mode 100644 contrib/CMakeLists.txt create mode 100644 contrib/README.md create mode 100644 contrib/TFLiteSharp/README.md create mode 100644 contrib/TFLiteSharp/TFLiteNative/CMakeLists.txt create mode 100644 contrib/TFLiteSharp/TFLiteNative/include/tflite_log.h create mode 100644 contrib/TFLiteSharp/TFLiteNative/include/tflite_nativewrapper.h create mode 100644 contrib/TFLiteSharp/TFLiteNative/src/tflite_nativewrapper.cpp create mode 100644 contrib/TFLiteSharp/TFLiteNative/tflite-native.pc.in create mode 100644 contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp.sln create mode 100644 contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.Libraries.cs create mode 100644 contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.TFLite.cs create mode 100644 contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/TFLiteSharp.csproj create mode 100644 contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Datatype.cs create mode 100644 contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Interpreter.cs create mode 100644 contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest.sln create mode 100644 contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/Program.cs create mode 100644 contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/TFLiteSharpTest.csproj create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp.csproj create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_App.cs create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_Main.cs create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/res/mobilenet_v1_1.0_224.tflite create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/res/mouse1.bmp create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/res/mouse_224.bmp create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/shared/res/TFLiteTestApp.png create mode 100644 contrib/TFLiteSharp/TFLiteTestApp/tizen-manifest.xml create mode 100644 contrib/TFLiteSharp/packaging/TFLiteSharp.manifest create mode 100644 contrib/TFLiteSharp/packaging/TFLiteSharp.spec create mode 100644 contrib/TFLiteSharp/packaging/tflite-native.manifest create mode 100644 contrib/bindacl/CMakeLists.txt create mode 100644 contrib/bindacl/README.md create mode 100644 contrib/bindacl/src/nnapi_acl.cc create mode 100644 contrib/convacl/CMakeLists.txt create mode 100644 contrib/convacl/src/io_accessor.cc create mode 100644 contrib/convacl/src/io_accessor.h create mode 100644 contrib/convacl/src/nnapi_acl_conv.cc create mode 100644 contrib/detection/CMakeLists.txt create mode 100644 contrib/detection/detection.cpp create mode 100644 contrib/example/CMakeLists.txt create mode 100644 contrib/example/example.cpp create mode 100644 contrib/jniacl/CMakeLists.txt create mode 100644 contrib/jniacl/src/io_accessor.cc create mode 100644 contrib/jniacl/src/io_accessor.h create mode 100644 contrib/jniacl/src/jniacl_main.cc create mode 100644 contrib/kerneltesting/CMakeLists.txt create mode 100644 contrib/kerneltesting/conv2d/CMakeLists.txt create mode 100644 contrib/kerneltesting/conv2d/OperationUtils.h create mode 100644 contrib/kerneltesting/conv2d/common.h create mode 100644 contrib/kerneltesting/conv2d/compatibility.h create mode 100644 contrib/kerneltesting/conv2d/io_accessor.cpp create mode 100644 contrib/kerneltesting/conv2d/io_accessor.h create mode 100644 contrib/kerneltesting/conv2d/nnfw_conv2d_test.cpp create mode 100644 contrib/kerneltesting/conv2d/optimized_ops.h create mode 100644 contrib/kerneltesting/conv2d/types.h create mode 100644 contrib/opencl_test/CMakeLists.txt create mode 100644 contrib/opencl_test/README.md create mode 100644 contrib/opencl_test/src/opencl_test.cc create mode 100644 contrib/tf_test/CMakeLists.txt create mode 100644 contrib/tf_test/tf_test.cpp create mode 100644 docs/HowToContribute.md create mode 100644 docs/HowToImplementOperatorKernel.md create mode 100644 docs/doxygen/Doxyfile create mode 100644 docs/fig/nnfw_architecture.png create mode 100644 docs/fig/nnfw_architecture.pptx create mode 100644 docs/fig/nnfw_behavior.png create mode 100644 docs/fig/nnfw_behavior.pptx create mode 100644 docs/howto.md create mode 100644 docs/howto/BuildTFfromSource.md create mode 100644 docs/howto/CrossBuildForAarch64.md create mode 100644 docs/howto/CrossBuildForArm.md create mode 100644 docs/howto/HowToUseDockerImage.md create mode 100644 docs/howto/device/xu3-dip.png create mode 100644 docs/howto/device/xu3_ubuntu.md create mode 100644 docs/howto/device/xu4_tizen.md create mode 100644 docs/howto/device/xu4_ubuntu.md create mode 100644 docs/project/2018_high_level_design.md create mode 100644 docs/project/2018_requirement_specification.md create mode 100644 docs/roadmap.md create mode 100644 docs/tests/Convolution_manual_3x3.xlsx create mode 100644 docs/tests/Softmax_manual.xlsx create mode 100644 docs/workgroups.md delete mode 100644 externals/acl.cmake delete mode 100644 externals/eigen3.cmake create mode 100644 externals/nnapi_test_generator/README.md create mode 100644 externals/nnapi_test_generator/include/TestHarness.h create mode 100755 externals/nnapi_test_generator/slicing.py create mode 100755 externals/nnapi_test_generator/test_generator.py create mode 100644 externals/nnapi_test_generator/tests/P_conv/conv_1_h3_w2_SAME.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_conv/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_conv/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_depthwise_conv/depthwise_conv.bin.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_depthwise_conv/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_depthwise_conv/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_explicit/explicit_add.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_explicit/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_explicit/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_float/addfloat.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_float/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_float/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_full/addfloat.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_full/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_full/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_lstm/lstm.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_lstm/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_lstm/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_quantized_avgpool/averpoolfloat.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_quantized_avgpool/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_quantized_avgpool/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_quantized_conv/quantized.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_quantized_conv/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_quantized_conv/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_vts_full/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_vts_full/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_vts_full/vts_full.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_vts_operands/addfloat.mod.py create mode 100644 externals/nnapi_test_generator/tests/P_vts_operands/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_vts_operands/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_weird/stderr.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_weird/stdout.txt.expect create mode 100644 externals/nnapi_test_generator/tests/P_weird/weird_add.mod.py create mode 100755 externals/nnapi_test_generator/tests/test.py create mode 100755 externals/nnapi_test_generator/vts_generator.py create mode 100644 include/NeuralNetworksEx.h create mode 100644 include/NeuralNetworksExShim.h create mode 100644 include/NeuralNetworksLoadHelpers.h create mode 100644 include/NeuralNetworksShim.h create mode 100644 include/kernel/acl/Add.h create mode 100644 include/kernel/acl/Mul.h create mode 100644 include/kernel/acl/ReLU.h create mode 100644 include/kernel/acl/ReLU6.h create mode 100644 include/nnfw/std/memory.h create mode 100644 include/support/nnapi/Utils.h create mode 100644 include/support/tflite/Assert.h create mode 100644 include/support/tflite/InterpreterSession.h create mode 100644 include/support/tflite/NNAPISession.h create mode 100644 include/support/tflite/Quantization.h create mode 100644 include/support/tflite/Session.h create mode 100644 include/support/tflite/TensorLogger.h create mode 100644 include/support/tflite/TensorShapeUtils.h create mode 100644 include/support/tflite/kernels/CustomOps.h create mode 100644 include/support/tflite/kernels/RSQRT.h create mode 100644 include/support/tflite/kernels/SquaredDifference.h create mode 100644 include/support/tflite/kernels/TensorFlowMax.h create mode 100644 include/support/tflite/kernels/register.h create mode 100644 include/support/tflite/nnapi_delegate.h create mode 100644 include/util/EnvVar.h create mode 100644 include/util/benchmark.h create mode 100644 include/util/environment.h create mode 100644 include/util/feature/Index.h create mode 100644 include/util/feature/IndexIterator.h create mode 100644 include/util/feature/Object.h create mode 100644 include/util/feature/Reader.h create mode 100644 include/util/feature/Shape.h create mode 100644 include/util/feature/TextFormatter.h create mode 100644 include/util/fp32.h create mode 100644 include/util/kernel/IndexIterator.h create mode 100644 include/util/kernel/RandomObject.h create mode 100644 include/util/kernel/Reader.h create mode 100644 include/util/kernel/Shape.h create mode 100644 include/util/matrix/IndexIterator.h create mode 100644 include/util/matrix/Reader.h create mode 100644 include/util/matrix/Shape.h create mode 100644 include/util/profiling/profile_buffer.h create mode 100644 include/util/profiling/profiler.h create mode 100644 include/util/profiling/profiling.h create mode 100644 include/util/profiling/time.h create mode 100644 include/util/tensor/Comparator.h create mode 100644 include/util/tensor/Diff.h create mode 100644 include/util/tensor/Index.h create mode 100644 include/util/tensor/IndexEnumerator.h create mode 100644 include/util/tensor/IndexFormatter.h create mode 100644 include/util/tensor/IndexIterator.h create mode 100644 include/util/tensor/NonIncreasingStride.h create mode 100644 include/util/tensor/Object.h create mode 100644 include/util/tensor/Reader.h create mode 100644 include/util/tensor/Shape.h create mode 100644 include/util/tensor/Zipper.h create mode 100644 include/util/vector.h create mode 100644 include/util/vector/Object.h create mode 100644 include/util/vector/Reader.h create mode 100644 libs/.FORMATCHECKED create mode 100644 libs/ARMComputeEx/CMakeLists.txt create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/CLKernelLibraryEx.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLCastKernel.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLGatherKernel.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPixelWiseDivisionKernel.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLReduceMaxKernel.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLReductionMeanKernel.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLStridedSliceKernel.h create mode 100644 libs/ARMComputeEx/arm_compute/core/CL/kernels/CLTopKV2Kernel.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLCast.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLGather.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPixelWiseDivision.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLReduceMax.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLReductionMean.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLStridedSlice.h create mode 100644 libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLTopKV2.h create mode 100644 libs/ARMComputeEx/resolve_includes.py create mode 100644 libs/ARMComputeEx/src/core/CL/CLKernelLibrary.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/arithmetic_op_quantized.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/cast.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/fixed_point.h create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/gather.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/helpers_asymm.h create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/pixelwise_div_float.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/pixelwise_div_int.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/pixelwise_mul_quantized.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/reduce_max.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/reduction_mean.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/strided_slice.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/topkv2.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/topkv2_quicksort.cl create mode 100644 libs/ARMComputeEx/src/core/CL/cl_kernels/topkv2_radixsort.cl create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLCastKernel.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLGatherKernel.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLPixelWiseDivisionKernel.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLReduceMaxKernel.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLReductionMeanKernel.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLStridedSliceKernel.cpp create mode 100644 libs/ARMComputeEx/src/core/CL/kernels/CLTopKV2Kernel.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLCast.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLGather.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLPixelWiseDivision.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLReduceMax.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLReductionMean.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLStridedSlice.cpp create mode 100644 libs/ARMComputeEx/src/runtime/CL/functions/CLTopKV2.cpp create mode 100644 libs/ARMComputeEx/src/runtime/topk_v2.h delete mode 100644 libs/kernel/CMakeLists.txt delete mode 100644 libs/kernel/acl/CMakeLists.txt delete mode 100644 libs/kernel/acl/src/CLUniqueTensor.h delete mode 100644 libs/kernel/acl/src/DepthwiseConv2D.h delete mode 100644 libs/kernel/acl/src/DepthwiseConv2D.test.h delete mode 100644 libs/kernel/acl/src/FullyConnected.h delete mode 100644 libs/kernel/acl/src/FullyConnected.test.h delete mode 100644 libs/kernel/acl/src/IO_accessor.cpp delete mode 100644 libs/kernel/acl/src/IO_accessor.h delete mode 100644 libs/kernel/acl/src/Init_acl.cpp delete mode 100644 libs/kernel/acl/src/NEUniqueTensor.h delete mode 100644 libs/kernel/acl/src/Reshape.h delete mode 100644 libs/kernel/acl/src/Reshape.test.h delete mode 100644 libs/kernel/acl/src/cl/Concatenation.cpp delete mode 100644 libs/kernel/acl/src/cl/Concatenation.test.cpp delete mode 100644 libs/kernel/acl/src/cl/Conv2D.cpp delete mode 100644 libs/kernel/acl/src/cl/Conv2D.test.cpp delete mode 100644 libs/kernel/acl/src/cl/DepthwiseConv2D.cpp delete mode 100644 libs/kernel/acl/src/cl/DepthwiseConv2D.test.cpp delete mode 100644 libs/kernel/acl/src/cl/FullyConnected.cpp delete mode 100644 libs/kernel/acl/src/cl/FullyConnected.test.cpp delete mode 100644 libs/kernel/acl/src/cl/Pooling.cpp delete mode 100644 libs/kernel/acl/src/cl/Pooling.test.cpp delete mode 100644 libs/kernel/acl/src/cl/Reshape.cpp delete mode 100644 libs/kernel/acl/src/cl/Reshape.test.cpp delete mode 100644 libs/kernel/acl/src/cl/Softmax.cpp delete mode 100644 libs/kernel/acl/src/cl/Softmax.test.cpp delete mode 100644 libs/kernel/acl/src/gtest_env.cpp delete mode 100644 libs/kernel/acl/src/neon/Concatenation.cpp delete mode 100644 libs/kernel/acl/src/neon/Concatenation.test.cpp delete mode 100644 libs/kernel/acl/src/neon/Conv2D.cpp delete mode 100644 libs/kernel/acl/src/neon/Conv2D.test.cpp delete mode 100644 libs/kernel/acl/src/neon/DepthwiseConv2D.cpp delete mode 100644 libs/kernel/acl/src/neon/DepthwiseConv2D.test.cpp delete mode 100644 libs/kernel/acl/src/neon/FullyConnected.cpp delete mode 100644 libs/kernel/acl/src/neon/FullyConnected.test.cpp delete mode 100644 libs/kernel/acl/src/neon/Pooling.cpp delete mode 100644 libs/kernel/acl/src/neon/Pooling.test.cpp delete mode 100644 libs/kernel/acl/src/neon/Reshape.cpp delete mode 100644 libs/kernel/acl/src/neon/Reshape.test.cpp delete mode 100644 libs/kernel/acl/src/neon/Softmax.cpp delete mode 100644 libs/kernel/acl/src/neon/Softmax.test.cpp delete mode 100644 libs/kernel/acl/src/shape.cpp delete mode 100644 libs/kernel/acl/src/shape.h delete mode 100644 libs/kernel/acl/src/support.cpp delete mode 100644 libs/kernel/acl/src/support.h delete mode 100644 libs/kernel/acl/src/util.cpp delete mode 100644 libs/kernel/acl/src/util.h create mode 100644 libs/support/nnapi/src/Utils.cpp create mode 100644 libs/support/tflite/src/Quantization.cpp create mode 100644 libs/support/tflite/src/TensorShapeUtils.cpp delete mode 100644 libs/support/tflite/src/TensorView.cpp create mode 100644 libs/support/tflite/src/kernels/RSQRT.cpp create mode 100644 libs/support/tflite/src/kernels/SquaredDifference.cpp create mode 100644 libs/support/tflite/src/kernels/TensorFlowMax.cpp create mode 100644 libs/support/tflite/src/kernels/register.cpp create mode 100644 libs/support/tflite/src/nnapi_delegate.cpp create mode 100644 libs/support/tflite/src/nnapi_delegate_ex_AddOpsAndParams_lambda.inc delete mode 100644 libs/util/include/util/benchmark.h delete mode 100644 libs/util/include/util/environment.h delete mode 100644 libs/util/include/util/feature/Index.h delete mode 100644 libs/util/include/util/feature/IndexIterator.h delete mode 100644 libs/util/include/util/feature/Object.h delete mode 100644 libs/util/include/util/feature/Reader.h delete mode 100644 libs/util/include/util/feature/Shape.h delete mode 100644 libs/util/include/util/feature/TextFormatter.h delete mode 100644 libs/util/include/util/fp32.h delete mode 100644 libs/util/include/util/kernel/IndexIterator.h delete mode 100644 libs/util/include/util/kernel/RandomObject.h delete mode 100644 libs/util/include/util/kernel/Reader.h delete mode 100644 libs/util/include/util/kernel/Shape.h delete mode 100644 libs/util/include/util/tensor/Index.h delete mode 100644 libs/util/include/util/tensor/IndexFormatter.h delete mode 100644 libs/util/include/util/tensor/IndexIterator.h delete mode 100644 libs/util/include/util/tensor/NonIncreasingStride.h delete mode 100644 libs/util/include/util/tensor/Object.h delete mode 100644 libs/util/include/util/tensor/Reader.h delete mode 100644 libs/util/include/util/tensor/Shape.h delete mode 100644 libs/util/include/util/tensor/Zipper.h delete mode 100644 libs/util/include/util/vector.h delete mode 100644 libs/util/include/util/vector/Object.h delete mode 100644 libs/util/include/util/vector/Reader.h create mode 100644 libs/util/src/profiling/time.cc create mode 100644 libs/util/src/tensor/Comparator.cpp create mode 100644 runtimes/logging/CMakeLists.txt create mode 100644 runtimes/logging/include/operand.def create mode 100644 runtimes/logging/include/operation.def create mode 100644 runtimes/logging/src/nnapi_logging.cc create mode 100644 runtimes/neurun/.FORMATCHECKED create mode 100644 runtimes/neurun/CMakeLists.txt create mode 100644 runtimes/neurun/src/backend/BackendManager.cc create mode 100644 runtimes/neurun/src/backend/BackendManager.h create mode 100644 runtimes/neurun/src/backend/CMakeLists.txt create mode 100644 runtimes/neurun/src/backend/IBackendConfig.h create mode 100644 runtimes/neurun/src/backend/IInitializerGenerator.h create mode 100644 runtimes/neurun/src/backend/IObject.h create mode 100644 runtimes/neurun/src/backend/IStageGenerator.h create mode 100644 runtimes/neurun/src/backend/ITensorBuilder.h create mode 100644 runtimes/neurun/src/backend/acl_cl/BackendConfig.cc create mode 100644 runtimes/neurun/src/backend/acl_cl/BackendConfig.h create mode 100644 runtimes/neurun/src/backend/acl_cl/CMakeLists.txt create mode 100644 runtimes/neurun/src/backend/acl_cl/InitializerGenerator.cc create mode 100644 runtimes/neurun/src/backend/acl_cl/InitializerGenerator.h create mode 100644 runtimes/neurun/src/backend/acl_cl/StageGenerator.cc create mode 100644 runtimes/neurun/src/backend/acl_cl/StageGenerator.h create mode 100644 runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc create mode 100644 runtimes/neurun/src/backend/acl_cl/TensorBuilder.h create mode 100644 runtimes/neurun/src/backend/acl_cl/feature/View.h create mode 100644 runtimes/neurun/src/backend/acl_cl/kernel/View.h create mode 100644 runtimes/neurun/src/backend/acl_cl/operand/Object.cc create mode 100644 runtimes/neurun/src/backend/acl_cl/operand/Object.h create mode 100644 runtimes/neurun/src/backend/cpu/BackendConfig.cc create mode 100644 runtimes/neurun/src/backend/cpu/BackendConfig.h create mode 100644 runtimes/neurun/src/backend/cpu/CMakeLists.txt create mode 100644 runtimes/neurun/src/backend/cpu/InitializerGenerator.cc create mode 100644 runtimes/neurun/src/backend/cpu/InitializerGenerator.h create mode 100644 runtimes/neurun/src/backend/cpu/MemoryAllocator.cc create mode 100644 runtimes/neurun/src/backend/cpu/MemoryAllocator.h create mode 100644 runtimes/neurun/src/backend/cpu/StageGenerator.cc create mode 100644 runtimes/neurun/src/backend/cpu/StageGenerator.h create mode 100644 runtimes/neurun/src/backend/cpu/TensorBuilder.cc create mode 100644 runtimes/neurun/src/backend/cpu/TensorBuilder.h create mode 100644 runtimes/neurun/src/backend/cpu/operand/Object.cc create mode 100644 runtimes/neurun/src/backend/cpu/operand/Object.h create mode 100644 runtimes/neurun/src/backend/cpu/operand/Tensor.cc create mode 100644 runtimes/neurun/src/backend/cpu/operand/Tensor.h create mode 100644 runtimes/neurun/src/codegen/BackendResolver.cc create mode 100644 runtimes/neurun/src/codegen/BackendResolver.h create mode 100644 runtimes/neurun/src/codegen/IPlanBuilder.h create mode 100644 runtimes/neurun/src/codegen/Plan.cc create mode 100644 runtimes/neurun/src/codegen/Plan.h create mode 100644 runtimes/neurun/src/codegen/PlanBuilder.cc create mode 100644 runtimes/neurun/src/codegen/PlanBuilder.h create mode 100644 runtimes/neurun/src/codegen/Planner.cc create mode 100644 runtimes/neurun/src/codegen/Planner.h create mode 100644 runtimes/neurun/src/codegen/operand/Context.cc create mode 100644 runtimes/neurun/src/codegen/operand/Context.h create mode 100644 runtimes/neurun/src/codegen/operation/Sequence.cc create mode 100644 runtimes/neurun/src/codegen/operation/Sequence.h create mode 100644 runtimes/neurun/src/exec/Sink.h create mode 100644 runtimes/neurun/src/exec/Source.h create mode 100644 runtimes/neurun/src/frontend/compilation.cc create mode 100644 runtimes/neurun/src/frontend/event.cc create mode 100644 runtimes/neurun/src/frontend/execution.cc create mode 100644 runtimes/neurun/src/frontend/memory.cc create mode 100644 runtimes/neurun/src/frontend/model.cc create mode 100644 runtimes/neurun/src/frontend/wrapper/compilation.cc create mode 100644 runtimes/neurun/src/frontend/wrapper/compilation.h create mode 100644 runtimes/neurun/src/frontend/wrapper/event.h create mode 100644 runtimes/neurun/src/frontend/wrapper/execution.h create mode 100644 runtimes/neurun/src/frontend/wrapper/memory.cc create mode 100644 runtimes/neurun/src/frontend/wrapper/memory.h create mode 100644 runtimes/neurun/src/frontend/wrapper/model.cc create mode 100644 runtimes/neurun/src/frontend/wrapper/model.h create mode 100644 runtimes/neurun/src/graph/Graph.cc create mode 100644 runtimes/neurun/src/graph/Graph.h create mode 100644 runtimes/neurun/src/graph/Index.h create mode 100644 runtimes/neurun/src/graph/dumper/Dumper.cc create mode 100644 runtimes/neurun/src/graph/dumper/Dumper.h create mode 100644 runtimes/neurun/src/graph/operand/Data.h create mode 100644 runtimes/neurun/src/graph/operand/DataType.h create mode 100644 runtimes/neurun/src/graph/operand/Index.h create mode 100644 runtimes/neurun/src/graph/operand/IndexSet.cc create mode 100644 runtimes/neurun/src/graph/operand/IndexSet.h create mode 100644 runtimes/neurun/src/graph/operand/Layout.h create mode 100644 runtimes/neurun/src/graph/operand/LayoutSet.cc create mode 100644 runtimes/neurun/src/graph/operand/LayoutSet.h create mode 100644 runtimes/neurun/src/graph/operand/LowerInfo.cc create mode 100644 runtimes/neurun/src/graph/operand/LowerInfo.h create mode 100644 runtimes/neurun/src/graph/operand/Object.cc create mode 100644 runtimes/neurun/src/graph/operand/Object.h create mode 100644 runtimes/neurun/src/graph/operand/Set.cc create mode 100644 runtimes/neurun/src/graph/operand/Set.h create mode 100644 runtimes/neurun/src/graph/operand/Shape.cc create mode 100644 runtimes/neurun/src/graph/operand/Shape.h create mode 100644 runtimes/neurun/src/graph/operand/Shape4DConvert.h create mode 100644 runtimes/neurun/src/graph/operand/TypeInfo.cc create mode 100644 runtimes/neurun/src/graph/operand/TypeInfo.h create mode 100644 runtimes/neurun/src/graph/operation/AvgPool2D.cc create mode 100644 runtimes/neurun/src/graph/operation/AvgPool2D.h create mode 100644 runtimes/neurun/src/graph/operation/Concat.cc create mode 100644 runtimes/neurun/src/graph/operation/Concat.h create mode 100644 runtimes/neurun/src/graph/operation/Conv2D.cc create mode 100644 runtimes/neurun/src/graph/operation/Conv2D.h create mode 100644 runtimes/neurun/src/graph/operation/FullyConnected.cc create mode 100644 runtimes/neurun/src/graph/operation/FullyConnected.h create mode 100644 runtimes/neurun/src/graph/operation/Index.h create mode 100644 runtimes/neurun/src/graph/operation/IndexList.cc create mode 100644 runtimes/neurun/src/graph/operation/IndexList.h create mode 100644 runtimes/neurun/src/graph/operation/LowerInfo.cc create mode 100644 runtimes/neurun/src/graph/operation/LowerInfo.h create mode 100644 runtimes/neurun/src/graph/operation/MaxPool2D.cc create mode 100644 runtimes/neurun/src/graph/operation/MaxPool2D.h create mode 100644 runtimes/neurun/src/graph/operation/NOP.cc create mode 100644 runtimes/neurun/src/graph/operation/NOP.h create mode 100644 runtimes/neurun/src/graph/operation/Node.cc create mode 100644 runtimes/neurun/src/graph/operation/Node.h create mode 100644 runtimes/neurun/src/graph/operation/NodeVisitor.h create mode 100644 runtimes/neurun/src/graph/operation/Op.lst create mode 100644 runtimes/neurun/src/graph/operation/Permute.cc create mode 100644 runtimes/neurun/src/graph/operation/Permute.h create mode 100644 runtimes/neurun/src/graph/operation/Reshape.cc create mode 100644 runtimes/neurun/src/graph/operation/Reshape.h create mode 100644 runtimes/neurun/src/graph/operation/Set.cc create mode 100644 runtimes/neurun/src/graph/operation/Set.h create mode 100644 runtimes/neurun/src/graph/operation/Softmax.cc create mode 100644 runtimes/neurun/src/graph/operation/Softmax.h create mode 100644 runtimes/neurun/src/graph/verifier/IVerifier.cc create mode 100644 runtimes/neurun/src/graph/verifier/IVerifier.h create mode 100644 runtimes/neurun/src/internal/Convert.cc create mode 100644 runtimes/neurun/src/internal/Convert.h create mode 100644 runtimes/neurun/src/internal/Padding.cc create mode 100644 runtimes/neurun/src/internal/Padding.h create mode 100644 runtimes/neurun/src/internal/nnapi/feature/Reader.h create mode 100644 runtimes/neurun/src/internal/nnapi/feature/Utils.h create mode 100644 runtimes/neurun/src/internal/nnapi/feature/View.h create mode 100644 runtimes/neurun/src/internal/nnapi/kernel/Reader.h create mode 100644 runtimes/neurun/src/internal/nnapi/kernel/View.h create mode 100644 runtimes/neurun/src/kernel/CMakeLists.txt create mode 100644 runtimes/neurun/src/kernel/acl_cl/CMakeLists.txt create mode 100644 runtimes/neurun/src/kernel/acl_cl/ConcatLayer.cc create mode 100644 runtimes/neurun/src/kernel/acl_cl/ConcatLayer.h create mode 100644 runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.cc create mode 100644 runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.h create mode 100644 runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.cc create mode 100644 runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/AvgPoolLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/AvgPoolLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/CMakeLists.txt create mode 100644 runtimes/neurun/src/kernel/cpu/ConcatLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/ConcatLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/ConvolutionLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/ConvolutionLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/FullyConnectedLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/FullyConnectedLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/MaxPoolLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/MaxPoolLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/OperationUtils.cc create mode 100644 runtimes/neurun/src/kernel/cpu/OperationUtils.h create mode 100644 runtimes/neurun/src/kernel/cpu/ReshapeLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/ReshapeLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/SoftMaxLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/SoftMaxLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/TensorConvertFromCommonLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/TensorConvertFromCommonLayer.h create mode 100644 runtimes/neurun/src/kernel/cpu/TensorConvertToCommonLayer.cc create mode 100644 runtimes/neurun/src/kernel/cpu/TensorConvertToCommonLayer.h create mode 100644 runtimes/neurun/src/library_info.cc create mode 100644 runtimes/neurun/src/linear/Linear.cc create mode 100644 runtimes/neurun/src/linear/Linear.h create mode 100644 runtimes/neurun/src/logging.h create mode 100644 runtimes/neurun/test/graph/Graph.cc create mode 100644 runtimes/neurun/test/graph/Index.cc create mode 100644 runtimes/neurun/test/graph/operand/IndexSet.cc create mode 100644 runtimes/neurun/test/graph/operand/LayoutSet.cc create mode 100644 runtimes/neurun/test/graph/operand/Set.cc create mode 100644 runtimes/neurun/test/graph/operand/UseDef.cc create mode 100644 runtimes/neurun/test/graph/operation/Insert.cc create mode 100644 runtimes/neurun/test/graph/operation/MockNode.h create mode 100644 runtimes/neurun/test/graph/operation/Set.cc create mode 100644 runtimes/neurun/test/graph/operation/SetIO.cc create mode 100644 runtimes/neurun/test/graph/verifier/Verifier.cc create mode 100644 runtimes/neurun/test/model.cc delete mode 100644 runtimes/nn/CMakeLists.txt delete mode 100644 runtimes/nn/README.md delete mode 100644 runtimes/nn/common/CMakeLists.txt delete mode 100644 runtimes/nn/common/CpuExecutor.cpp delete mode 100644 runtimes/nn/common/Logging.cpp delete mode 100644 runtimes/nn/common/NNFWKernels.cpp delete mode 100644 runtimes/nn/common/NNFWKernels.h delete mode 100644 runtimes/nn/common/NNFWKernels.lst delete mode 100644 runtimes/nn/common/OperationsUtils.cpp delete mode 100644 runtimes/nn/common/Utils.cpp delete mode 100644 runtimes/nn/common/include/ActivationFunctor.h delete mode 100644 runtimes/nn/common/include/CpuExecutor.h delete mode 100644 runtimes/nn/common/include/HalInterfaces.h delete mode 100644 runtimes/nn/common/include/Logging.h delete mode 100644 runtimes/nn/common/include/Operations.h delete mode 100644 runtimes/nn/common/include/OperationsUtils.h delete mode 100644 runtimes/nn/common/include/Utils.h delete mode 100644 runtimes/nn/common/operations/Activation.cpp delete mode 100644 runtimes/nn/common/operations/Concatenation.cpp delete mode 100644 runtimes/nn/common/operations/Conv2D.cpp delete mode 100644 runtimes/nn/common/operations/DepthwiseConv2D.cpp delete mode 100644 runtimes/nn/common/operations/FullyConnected.cpp delete mode 100644 runtimes/nn/common/operations/Pooling.cpp delete mode 100644 runtimes/nn/common/operations/Reshape.cpp delete mode 100644 runtimes/nn/common/operations/SimpleMath.cpp delete mode 100644 runtimes/nn/common/operations/internal/common.h delete mode 100644 runtimes/nn/common/operations/internal/compatibility.h delete mode 100644 runtimes/nn/common/operations/internal/optimized/cpu_check.h delete mode 100644 runtimes/nn/common/operations/internal/optimized/depthwiseconv_float.h delete mode 100644 runtimes/nn/common/operations/internal/optimized/depthwiseconv_uint8.h delete mode 100644 runtimes/nn/common/operations/internal/optimized/neon_tensor_utils.cc delete mode 100644 runtimes/nn/common/operations/internal/optimized/neon_tensor_utils.h delete mode 100644 runtimes/nn/common/operations/internal/optimized/optimized_ops.h delete mode 100644 runtimes/nn/common/operations/internal/optimized/tensor_utils_impl.h delete mode 100644 runtimes/nn/common/operations/internal/tensor_utils.cc delete mode 100644 runtimes/nn/common/operations/internal/tensor_utils.h delete mode 100644 runtimes/nn/common/operations/internal/tensor_utils_test.cc delete mode 100644 runtimes/nn/common/operations/internal/types.h delete mode 100644 runtimes/nn/depend/CMakeLists.txt delete mode 100644 runtimes/nn/depend/external/CMakeLists.txt delete mode 100644 runtimes/nn/depend/external/eigen/CMakeLists.txt delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/CMakeLists.txt delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Cholesky delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/CholmodSupport delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Core delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Dense delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Eigen delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Eigenvalues delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Geometry delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Householder delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/IterativeLinearSolvers delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Jacobi delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/LU delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/MetisSupport delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/OrderingMethods delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/PaStiXSupport delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/PardisoSupport delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/QR delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/QtAlignedMalloc delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SPQRSupport delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SVD delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/Sparse delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SparseCholesky delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SparseCore delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SparseLU delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SparseQR delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/StdDeque delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/StdList delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/StdVector delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/SuperLUSupport delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/UmfPackSupport delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Cholesky/LDLT.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Cholesky/LLT.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/CholmodSupport/CholmodSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Array.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/ArrayBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/ArrayWrapper.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Assign.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/AssignEvaluator.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/Assign_MKL.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/BandMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Block.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/BooleanRedux.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CommaInitializer.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/ConditionEstimator.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CoreEvaluators.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CoreIterators.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CwiseBinaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CwiseNullaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CwiseTernaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CwiseUnaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/CwiseUnaryView.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/DenseBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/DenseCoeffsBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/DenseStorage.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Diagonal.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/DiagonalMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/DiagonalProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Dot.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/EigenBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/ForceAlignedAccess.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Fuzzy.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/GeneralProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/GenericPacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/GlobalFunctions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/IO.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Inverse.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Map.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/MapBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/MathFunctions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/MathFunctionsImpl.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Matrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/MatrixBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/NestByValue.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/NoAlias.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/NumTraits.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/PermutationMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/PlainObjectBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Product.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/ProductEvaluators.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Random.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Redux.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Ref.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Replicate.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/ReturnByValue.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Reverse.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Select.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/SelfAdjointView.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Solve.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/SolveTriangular.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/SolverBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/StableNorm.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Stride.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Swap.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Transpose.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Transpositions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/TriangularMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/VectorBlock.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/VectorwiseOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/Visitor.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AVX/Complex.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AVX/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AltiVec/Complex.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/CUDA/Complex.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/CUDA/Half.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/Default/Settings.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/NEON/Complex.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/NEON/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/SSE/Complex.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/SSE/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/ZVector/Complex.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/functors/AssignmentFunctors.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/functors/BinaryFunctors.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/functors/NullaryFunctors.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/functors/StlFunctors.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/functors/TernaryFunctors.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/functors/UnaryFunctors.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralMatrixVector.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/Parallelizer.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/SelfadjointProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularMatrixVector.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/products/TriangularSolverVector.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/BlasUtil.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/Constants.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/DisableStupidWarnings.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/ForwardDeclarations.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/MKL_support.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/Macros.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/Memory.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/Meta.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/NonMPL2.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/StaticAssert.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Core/util/XprHelper.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/ComplexSchur.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/EigenSolver.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/RealQZ.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/RealSchur.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/AlignedBox.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/AngleAxis.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/EulerAngles.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Homogeneous.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Hyperplane.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/OrthoMethods.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/ParametrizedLine.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Quaternion.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Rotation2D.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/RotationBase.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Scaling.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Transform.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Translation.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/Umeyama.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Householder/BlockHouseholder.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Householder/Householder.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Householder/HouseholderSequence.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/Jacobi/Jacobi.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/LU/Determinant.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/LU/FullPivLU.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/LU/InverseImpl.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/LU/PartialPivLU.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/LU/arch/Inverse_SSE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/MetisSupport/MetisSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/OrderingMethods/Ordering.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/PardisoSupport/PardisoSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/QR/ColPivHouseholderQR.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/QR/FullPivHouseholderQR.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/QR/HouseholderQR.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SVD/BDCSVD.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SVD/JacobiSVD.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SVD/SVDBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SVD/UpperBidiagonalization.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/AmbiVector.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/CompressedStorage.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseAssign.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseBlock.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseColEtree.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseCompressedBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseDenseProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseDot.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseFuzzy.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseMap.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseMatrixBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparsePermutation.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseProduct.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseRedux.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseRef.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseSolverBase.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseTranspose.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseTriangularView.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseUtil.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseVector.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/SparseView.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseCore/TriangularSolver.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLUImpl.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_Memory.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_Structs.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_Utils.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SparseQR/SparseQR.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/StlSupport/StdDeque.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/StlSupport/StdList.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/StlSupport/StdVector.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/StlSupport/details.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/misc/Image.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/misc/Kernel.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/misc/RealSvd2x2.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/misc/blas.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/misc/lapack.h delete mode 100755 runtimes/nn/depend/external/eigen/Eigen/src/misc/lapacke.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/misc/lapacke_mangling.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/BlockMethods.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h delete mode 100644 runtimes/nn/depend/external/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/CMakeLists.txt delete mode 100644 runtimes/nn/depend/external/gemmlowp/fixedpoint/fixedpoint.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/fixedpoint/fixedpoint_neon.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/fixedpoint/fixedpoint_sse.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/allocator.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/block_params.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/common.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/compute.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/dispatch_gemm_shape.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/kernel.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/kernel_default.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/kernel_neon.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/kernel_reference.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/kernel_sse.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/multi_thread_gemm.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/output.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/output_neon.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/output_sse.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/pack.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/pack_neon.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/pack_sse.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/simd_wrappers.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/simd_wrappers_common_neon_sse.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/simd_wrappers_neon.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/simd_wrappers_sse.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/single_thread_gemm.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/internal/unpack.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/profiling/instrumentation.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/profiling/profiler.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/public/bit_depth.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/public/gemmlowp.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/public/map.h delete mode 100644 runtimes/nn/depend/external/gemmlowp/public/output_stages.h delete mode 100644 runtimes/nn/depend/hal/CMakeLists.txt delete mode 100644 runtimes/nn/depend/hal/include/android/hardware/neuralnetworks/1.0/types.h delete mode 100644 runtimes/nn/depend/libcutils/CMakeLists.txt delete mode 100644 runtimes/nn/depend/libcutils/ashmem-host.c delete mode 100644 runtimes/nn/depend/libcutils/include/cutils/ashmem.h delete mode 100644 runtimes/nn/depend/libcutils/include/cutils/native_handle.h delete mode 100644 runtimes/nn/depend/libcutils/native_handle.c delete mode 100644 runtimes/nn/depend/libhidl/CMakeLists.txt delete mode 100644 runtimes/nn/depend/libhidl/base/CMakeLists.txt delete mode 100644 runtimes/nn/depend/libhidl/base/HidlSupport.cpp delete mode 100644 runtimes/nn/depend/libhidl/base/Status.cpp delete mode 100644 runtimes/nn/depend/libhidl/base/include/hidl/HidlInternal.h delete mode 100644 runtimes/nn/depend/libhidl/base/include/hidl/HidlSupport.h delete mode 100644 runtimes/nn/depend/libhidl/base/include/hidl/Status.h delete mode 100644 runtimes/nn/depend/libutils/CMakeLists.txt delete mode 100644 runtimes/nn/depend/libutils/RefBase.cpp delete mode 100644 runtimes/nn/depend/libutils/StrongPointer.cpp delete mode 100644 runtimes/nn/depend/libutils/include/utils/Compat.h delete mode 100644 runtimes/nn/depend/libutils/include/utils/Errors.h delete mode 100644 runtimes/nn/depend/libutils/include/utils/LightRefBase.h delete mode 100644 runtimes/nn/depend/libutils/include/utils/RefBase.h delete mode 100644 runtimes/nn/depend/libutils/include/utils/StrongPointer.h delete mode 100644 runtimes/nn/depend/libutils/include/utils/TypeHelpers.h delete mode 100644 runtimes/nn/runtime/CMakeLists.txt delete mode 100644 runtimes/nn/runtime/Callbacks.cpp delete mode 100644 runtimes/nn/runtime/Callbacks.h delete mode 100644 runtimes/nn/runtime/CompilationBuilder.cpp delete mode 100644 runtimes/nn/runtime/CompilationBuilder.h delete mode 100644 runtimes/nn/runtime/ExecutionBuilder.cpp delete mode 100644 runtimes/nn/runtime/ExecutionBuilder.h delete mode 100644 runtimes/nn/runtime/Memory.cpp delete mode 100644 runtimes/nn/runtime/Memory.h delete mode 100644 runtimes/nn/runtime/ModelBuilder.cpp delete mode 100644 runtimes/nn/runtime/ModelBuilder.h delete mode 100644 runtimes/nn/runtime/NeuralNetworks.cpp create mode 100644 runtimes/pure_arm_compute/.FORMATCHECKED create mode 100644 runtimes/pure_arm_compute/CMakeLists.txt create mode 100644 runtimes/pure_arm_compute/src/compilation.cc create mode 100644 runtimes/pure_arm_compute/src/compilation.h create mode 100644 runtimes/pure_arm_compute/src/event.cc create mode 100644 runtimes/pure_arm_compute/src/event.h create mode 100644 runtimes/pure_arm_compute/src/execution.cc create mode 100644 runtimes/pure_arm_compute/src/execution.h create mode 100644 runtimes/pure_arm_compute/src/internal/FeatureSink.h create mode 100644 runtimes/pure_arm_compute/src/internal/FeatureSource.h create mode 100644 runtimes/pure_arm_compute/src/internal/IExecutionBuilder.h create mode 100644 runtimes/pure_arm_compute/src/internal/MatrixSink.h create mode 100644 runtimes/pure_arm_compute/src/internal/MatrixSource.h create mode 100644 runtimes/pure_arm_compute/src/internal/Model.cc create mode 100644 runtimes/pure_arm_compute/src/internal/Model.h create mode 100644 runtimes/pure_arm_compute/src/internal/Sink.h create mode 100644 runtimes/pure_arm_compute/src/internal/Sinks.h create mode 100644 runtimes/pure_arm_compute/src/internal/Source.h create mode 100644 runtimes/pure_arm_compute/src/internal/Swizzle.h create mode 100644 runtimes/pure_arm_compute/src/internal/Tensor3DSink.h create mode 100644 runtimes/pure_arm_compute/src/internal/Tensor3DSource.h create mode 100644 runtimes/pure_arm_compute/src/internal/TensorSource.h create mode 100644 runtimes/pure_arm_compute/src/internal/VectorSink.h create mode 100644 runtimes/pure_arm_compute/src/internal/VectorSource.h create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute.cc create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute.h create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute/feature/View.h create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute/kernel/View.h create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute/matrix/View.h create mode 100644 runtimes/pure_arm_compute/src/internal/arm_compute/tensor/View.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/FeatureLoggingLayer.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/GenericFullyConnectedLayer.cc create mode 100644 runtimes/pure_arm_compute/src/internal/layers/GenericFullyConnectedLayer.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/GenericReshapeLayer.cc create mode 100644 runtimes/pure_arm_compute/src/internal/layers/GenericReshapeLayer.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/PadLayer.cc create mode 100644 runtimes/pure_arm_compute/src/internal/layers/PadLayer.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SimpleArithmeticAddition.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SimpleCastLayer.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SimpleEmbeddingLookup.cc create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SimpleEmbeddingLookup.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SimpleSpaceToDepth.cc create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SimpleSpaceToDepth.h create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SquaredDifferenceOperation.cc create mode 100644 runtimes/pure_arm_compute/src/internal/layers/SquaredDifferenceOperation.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/feature/Reader.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/feature/Utils.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/feature/View.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/tensor/ConstView.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/tensor/Reader.h create mode 100644 runtimes/pure_arm_compute/src/internal/nnapi/tensor/View.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Add.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Add.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/AvgPool2D.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/AvgPool2D.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Cast.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Cast.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Concat.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Concat.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Conv2D.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Conv2D.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/DepthwiseConv2D.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/DepthwiseConv2D.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Dequantize.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Dequantize.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Div.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Div.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/EmbeddingLookup.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/EmbeddingLookup.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Floor.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Floor.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/FullyConnected.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/FullyConnected.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Gather.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Gather.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/HashtableLookup.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/HashtableLookup.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/L2Normalization.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/L2Normalization.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/L2Pool2D.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/L2Pool2D.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Logistic.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Logistic.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Lstm.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Lstm.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/MaxPool2D.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/MaxPool2D.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Mean.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Mean.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Mul.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Mul.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Node.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/NodeVisitor.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Pad.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Pad.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/RSQRT.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/RSQRT.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReLU.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReLU.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReLU1.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReLU1.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReLU6.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReLU6.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReduceMax.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/ReduceMax.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Reshape.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Reshape.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/ResizeBilinear.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/ResizeBilinear.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Rnn.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Rnn.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Softmax.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Softmax.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/SpaceToDepth.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/SpaceToDepth.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Split.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Split.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/SquaredDifference.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/SquaredDifference.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Squeeze.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Squeeze.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/StridedSlice.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/StridedSlice.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Sub.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Sub.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Tanh.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Tanh.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/TopKV2.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/TopKV2.h create mode 100644 runtimes/pure_arm_compute/src/internal/op/Transpose.cc create mode 100644 runtimes/pure_arm_compute/src/internal/op/Transpose.h create mode 100644 runtimes/pure_arm_compute/src/library_info.cc create mode 100644 runtimes/pure_arm_compute/src/logging.h create mode 100644 runtimes/pure_arm_compute/src/memory.cc create mode 100644 runtimes/pure_arm_compute/src/memory.h create mode 100644 runtimes/pure_arm_compute/src/model.cc create mode 100644 runtimes/pure_arm_compute/src/model.h create mode 100644 runtimes/pure_arm_compute/symbolcheck.cpp create mode 100644 runtimes/template/CMakeLists.txt create mode 100644 runtimes/template/src/compilation.cc create mode 100644 runtimes/template/src/compilation.h create mode 100644 runtimes/template/src/event.cc create mode 100644 runtimes/template/src/event.h create mode 100644 runtimes/template/src/execution.cc create mode 100644 runtimes/template/src/execution.h create mode 100644 runtimes/template/src/memory.cc create mode 100644 runtimes/template/src/memory.h create mode 100644 runtimes/template/src/model.cc create mode 100644 runtimes/template/src/model.h delete mode 100644 runtimes/tests/bring_up_test/CMakeLists.txt delete mode 100644 runtimes/tests/bring_up_test/add_main.cpp delete mode 100644 runtimes/tests/bring_up_test/cplusplus_main.cpp delete mode 100644 runtimes/tests/bring_up_test/simple_model.cpp delete mode 100644 runtimes/tests/bring_up_test/simple_model.h delete mode 100644 runtimes/tests/bring_up_test/simple_model_main.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/batch_to_space.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/batch_to_space_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/batch_to_space_quant8_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/cast_ex_float32_to_int32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/cast_ex_int32_to_float32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/concat_float_4D_axis3_1_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/div.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/div_.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/div_broadcast_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/embedding_lookup_2d_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/embedding_lookup_4d_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/floor_.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/fully_connected_float_1_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/fully_connected_float_3.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/fully_connected_float_4d_simple.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/gather_1D_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/gather_1D_int32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/gather_1D_quant8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/gather_2D_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/gather_2D_int32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/gather_2D_quant8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean_axis01_1_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean_axis01_2_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean_float_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean_quant8_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mean_quant8_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mul_broadcast_3D_1D_1_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/mul_broadcast_3D_1D_2_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/pad.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/pad_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch_float_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch_float_3.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch_quant8_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch_quant8_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/space_to_batch_quant8_3.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/squeeze.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/squeeze_2D_float_1_nnfw.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/squeeze_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/squeeze_quant8_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_10.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_3.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_4.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_5.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_6.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_7.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_ex_float_9.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_10.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_11.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_3.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_4.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_5.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_6.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_7.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_float_9.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_qaunt8_10.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_qaunt8_11.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_2.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_3.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_4.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_5.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_6.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_7.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/strided_slice_quant8_9.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/sub.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/sub_broadcast_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/tanh_.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/tensorflowmax_ex_2D_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/tensorflowmax_ex_2D_int32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/topk_v2_1D_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/topk_v2_1D_int32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/topk_v2_1D_quant8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/topk_v2_2D_float.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/topk_v2_2D_int32.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/topk_v2_2D_quant8.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/transpose.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/transpose_float_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/examples/transpose_quant8_1.example.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/batch_to_space.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/batch_to_space_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/batch_to_space_quant8_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/cast_ex_float32_to_int32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/cast_ex_int32_to_float32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/concat_float_4D_axis3_1_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/div.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/div_.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/div_broadcast_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/embedding_lookup_2d_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/embedding_lookup_4d_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/floor_.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/fully_connected_float_1_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/fully_connected_float_3.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/fully_connected_float_4d_simple.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/gather_1D_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/gather_1D_int32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/gather_1D_quant8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/gather_2D_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/gather_2D_int32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/gather_2D_quant8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean_axis01_1_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean_axis01_2_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean_float_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean_quant8_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mean_quant8_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mul_broadcast_3D_1D_1_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/mul_broadcast_3D_1D_2_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/pad.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/pad_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch_float_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch_float_3.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch_quant8_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch_quant8_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/space_to_batch_quant8_3.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/squeeze.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/squeeze_2D_float_1_nnfw.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/squeeze_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/squeeze_quant8_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_10.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_3.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_4.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_5.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_6.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_7.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_ex_float_9.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_10.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_11.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_3.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_4.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_5.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_6.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_7.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_float_9.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_qaunt8_10.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_qaunt8_11.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_2.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_3.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_4.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_5.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_6.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_7.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/strided_slice_quant8_9.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/sub.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/sub_broadcast_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/tanh_.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/tensorflowmax_ex_2D_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/tensorflowmax_ex_2D_int32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/topk_v2_1D_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/topk_v2_1D_int32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/topk_v2_1D_quant8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/topk_v2_2D_float.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/topk_v2_2D_int32.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/topk_v2_2D_quant8.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/transpose.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/transpose_float_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/generated/models/transpose_quant8_1.model.cpp create mode 100644 runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux create mode 100644 runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux.neurun create mode 100644 runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-tizen create mode 100644 runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.x86_64-linux create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/cast_ex_float32_to_int32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/cast_ex_int32_to_float32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/gather_1D_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/gather_1D_int32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/gather_1D_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/gather_2D_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/gather_2D_int32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/gather_2D_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_int32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_int32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_int32.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/add.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/add_broadcast_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/add_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_float_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_float_5.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_quant8_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_quant8_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/avg_pool_quant8_5.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_float_4D_axis3_1_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/concat_quant8_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_1_h3_w2_SAME.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_1_h3_w2_VALID.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_3_h3_w2_SAME.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_3_h3_w2_VALID.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float_channels.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float_channels_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float_large_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_float_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_channels.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_channels_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_large_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_overflow.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_overflow_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/conv_quant8_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depth_to_space_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depth_to_space_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depth_to_space_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depth_to_space_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depth_to_space_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float_large_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float_large_2_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float_large_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_float_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_quant8_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_quant8_large_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/depthwise_conv2d_quant8_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/dequantize.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/embedding_lookup.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/embedding_lookup_2d_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/embedding_lookup_4d_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/floor_.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float_1_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float_large_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_float_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_quant8_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_quant8_large_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/fully_connected_quant8_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/hashtable_lookup_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/hashtable_lookup_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/l2_normalization.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/l2_normalization_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/l2_normalization_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/l2_pool_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/l2_pool_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/l2_pool_float_large.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/local_response_norm_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/local_response_norm_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/local_response_norm_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/local_response_norm_float_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/logistic_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/logistic_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/logistic_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/logistic_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lsh_projection.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lsh_projection_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lsh_projection_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm2_state.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm2_state2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm3_state.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm3_state2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm3_state3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm_state.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/lstm_state2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_float_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_quant8_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/max_pool_quant8_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mobilenet_224_gender_basic_fixed.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mobilenet_quantized.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mul.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mul_broadcast_3D_1D_1_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mul_broadcast_3D_1D_2_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mul_broadcast_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mul_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/mul_relu.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu1_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu1_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu1_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu1_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu6_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu6_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu6_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu6_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/relu_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/reshape.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/reshape_quant8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/reshape_quant8_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/reshape_weights_as_inputs.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/resize_bilinear.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/resize_bilinear_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/rnn.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/rnn_state.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/softmax_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/softmax_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/softmax_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/softmax_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/space_to_depth_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/space_to_depth_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/space_to_depth_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/space_to_depth_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/space_to_depth_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/svdf.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/svdf2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/svdf_state.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_0/tanh_.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/batch_to_space.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/batch_to_space_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/batch_to_space_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/div_.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/div_broadcast_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/fully_connected_float_4d_simple.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean_axis01_1_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean_axis01_2_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/mean_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/pad.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/pad_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/space_to_batch_quant8_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/squeeze.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/squeeze_2D_float_1_nnfw.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/squeeze_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/squeeze_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_10.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_11.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_5.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_6.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_7.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_float_9.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_qaunt8_10.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_qaunt8_11.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_2.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_3.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_4.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_5.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_6.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_7.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_8.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/strided_slice_quant8_9.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/sub.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/sub_broadcast_float.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/transpose.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/transpose_float_1.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/V1_1/transpose_quant8_1.mod.py create mode 100755 runtimes/tests/neural_networks_test/specs/generate_test.sh create mode 100755 runtimes/tests/neural_networks_test/specs/generate_vts_test.sh create mode 100755 runtimes/tests/neural_networks_test/specs/slicing.sh create mode 100644 scripts/command/docker-run create mode 100755 scripts/command/docker-shell create mode 100755 scripts/command/docker_build_cross_arm_neurun.sh create mode 100755 scripts/command/docker_build_ubuntu_coverity.sh create mode 100644 scripts/command/docker_env_neurun create mode 100644 scripts/command/docker_env_pureacl_tflite_benchmark_model delete mode 100755 scripts/command/docker_run.sh create mode 100644 scripts/command/nnfw_docker create mode 100644 scripts/command/nnfw_docker_tizen create mode 100755 scripts/command/run_coverity.sh create mode 100644 scripts/docker_helper create mode 100755 scripts/git-hooks/install_hooks.sh create mode 100755 scripts/git-hooks/pre-push create mode 100644 tests/framework/tests/MODELS/inception_module/config.sh create mode 100644 tests/framework/tests/MODELS/inception_nonslim/config.sh create mode 100644 tests/framework/tests/MODELS/inception_slim/config.sh create mode 100644 tests/framework/tests/MODELS/mobilenet/config.sh create mode 100644 tests/framework/tests/add/1D/config.sh create mode 100644 tests/framework/tests/add/4D/config.sh create mode 100644 tests/framework/tests/average_pool_2d/avgpool1/config.sh create mode 100644 tests/framework/tests/average_pool_2d/avgpool2/config.sh create mode 100644 tests/framework/tests/cast/config.sh create mode 100644 tests/framework/tests/concat/2D/config.sh create mode 100644 tests/framework/tests/concat/concat1/config.sh create mode 100644 tests/framework/tests/concat/concat2/config.sh create mode 100644 tests/framework/tests/conv_2d/convolution1/config.sh create mode 100644 tests/framework/tests/conv_2d/convolution2/config.sh create mode 100644 tests/framework/tests/custom/tensorflowmax/config.sh create mode 100644 tests/framework/tests/depthwise_conv_2d/depthconv1/config.sh create mode 100644 tests/framework/tests/depthwise_conv_2d/depthconv2/config.sh create mode 100644 tests/framework/tests/div/broadcast/config.sh create mode 100644 tests/framework/tests/embedding_lookup/config.sh create mode 100644 tests/framework/tests/floor/floor1/config.sh create mode 100644 tests/framework/tests/floor/floor2/config.sh create mode 100644 tests/framework/tests/fullyconnected/fc1/config.sh create mode 100644 tests/framework/tests/fullyconnected/matmul2x2/config.sh create mode 100644 tests/framework/tests/gather/config.sh create mode 100644 tests/framework/tests/hashtable_lookup/config.sh delete mode 100644 tests/framework/tests/inceptionv3/inception_nonslim/config.sh delete mode 100644 tests/framework/tests/inceptionv3/inception_slim/config.sh create mode 100644 tests/framework/tests/l2_normalization/config.sh create mode 100644 tests/framework/tests/l2_pool_2d/config.sh create mode 100644 tests/framework/tests/logistic/config.sh create mode 100644 tests/framework/tests/max_pool_2d/maxpool1/config.sh create mode 100644 tests/framework/tests/max_pool_2d/maxpool2/config.sh create mode 100644 tests/framework/tests/mean/config.sh create mode 100644 tests/framework/tests/mul/broadcast/config.sh create mode 100644 tests/framework/tests/pad/4D_2D/config.sh create mode 100644 tests/framework/tests/pad/pad1/config.sh create mode 100644 tests/framework/tests/pad/pad2/config.sh create mode 100644 tests/framework/tests/reduce_mean/test1/config.sh create mode 100644 tests/framework/tests/reduce_mean/test2/config.sh create mode 100644 tests/framework/tests/relu/config.sh create mode 100644 tests/framework/tests/relu6/config.sh create mode 100644 tests/framework/tests/reshape/3D/config.sh create mode 100644 tests/framework/tests/reshape/reshape1/config.sh create mode 100644 tests/framework/tests/reshape/reshape2/config.sh create mode 100644 tests/framework/tests/resize_bilinear/config.sh create mode 100644 tests/framework/tests/rnn/config.sh create mode 100644 tests/framework/tests/softmax/config.sh create mode 100644 tests/framework/tests/space_to_depth/config.sh create mode 100644 tests/framework/tests/squeeze/config.sh create mode 100644 tests/framework/tests/strided_slice/config.sh create mode 100644 tests/framework/tests/sub/broadcast/config.sh create mode 100644 tests/framework/tests/tanh/config.sh create mode 100644 tests/framework/tests/topk_v2/config.sh create mode 100644 tests/framework/tests/tranpose/config.sh delete mode 100644 tools/cross/apt_proxy create mode 100755 tools/extract_weights_from_tflite/extract.py create mode 100755 tools/extract_weights_from_tflite/extract_from_tflite.sh create mode 100755 tools/extract_weights_from_tflite/print_op.py create mode 100644 tools/image_importer/README.md create mode 100755 tools/image_importer/image_importer.py create mode 100755 tools/image_importer/imagegen.py create mode 100644 tools/modelgen/CONV_2D.template.json create mode 100755 tools/modelgen/modelgen.py create mode 100755 tools/modelgen/modelgen.sh create mode 100644 tools/nnapi_quickcheck/CMakeLists.txt create mode 100644 tools/nnapi_quickcheck/inc/env.h create mode 100644 tools/nnapi_quickcheck/inc/memory.h create mode 100644 tools/nnapi_quickcheck/lib/env.cpp create mode 100644 tools/nnapi_quickcheck/lib/env.test.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_1.lst create mode 100644 tools/nnapi_quickcheck/tests/add_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_2.lst create mode 100644 tools/nnapi_quickcheck/tests/add_3.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_3.lst create mode 100644 tools/nnapi_quickcheck/tests/add_4.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_4.lst create mode 100644 tools/nnapi_quickcheck/tests/add_5.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_5.lst create mode 100644 tools/nnapi_quickcheck/tests/add_6.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_6.lst create mode 100644 tools/nnapi_quickcheck/tests/add_7.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_7.lst create mode 100644 tools/nnapi_quickcheck/tests/add_8.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_8.lst create mode 100644 tools/nnapi_quickcheck/tests/add_9.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_9.lst create mode 100644 tools/nnapi_quickcheck/tests/add_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/add_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/avg_pool_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/avg_pool_1.lst create mode 100644 tools/nnapi_quickcheck/tests/avg_pool_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/avg_pool_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/cast_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/cast_1.lst create mode 100644 tools/nnapi_quickcheck/tests/cast_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/cast_2.lst create mode 100644 tools/nnapi_quickcheck/tests/cast_q_to_f_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/cast_q_to_f_1.lst create mode 100644 tools/nnapi_quickcheck/tests/concat_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/concat_1.lst create mode 100644 tools/nnapi_quickcheck/tests/concat_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/concat_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/conv_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/conv_1.lst create mode 100644 tools/nnapi_quickcheck/tests/conv_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/conv_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/dconv_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/dconv_1.lst create mode 100644 tools/nnapi_quickcheck/tests/dconv_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/dconv_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/dequantize_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/dequantize_1.lst create mode 100644 tools/nnapi_quickcheck/tests/div_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/div_1.lst create mode 100644 tools/nnapi_quickcheck/tests/div_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/div_2.lst create mode 100644 tools/nnapi_quickcheck/tests/fully_connected_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/fully_connected_1.lst create mode 100644 tools/nnapi_quickcheck/tests/fully_connected_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/fully_connected_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/gather_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/gather_1.lst create mode 100644 tools/nnapi_quickcheck/tests/gather_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/gather_2.lst create mode 100644 tools/nnapi_quickcheck/tests/logistic_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/logistic_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/max_pool_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/max_pool_1.lst create mode 100644 tools/nnapi_quickcheck/tests/max_pool_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/max_pool_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/mul_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/mul_1.lst create mode 100644 tools/nnapi_quickcheck/tests/mul_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/mul_2.lst create mode 100644 tools/nnapi_quickcheck/tests/mul_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/mul_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/relu1_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu1_1.lst create mode 100644 tools/nnapi_quickcheck/tests/relu6_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu6_1.lst create mode 100644 tools/nnapi_quickcheck/tests/relu6_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu6_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/relu_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu_1.lst create mode 100644 tools/nnapi_quickcheck/tests/relu_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu_2.lst create mode 100644 tools/nnapi_quickcheck/tests/relu_3.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu_3.lst create mode 100644 tools/nnapi_quickcheck/tests/relu_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/relu_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/reshape_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/reshape_1.lst create mode 100644 tools/nnapi_quickcheck/tests/reshape_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/reshape_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/resize_bilinear_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/resize_bilinear_1.lst create mode 100644 tools/nnapi_quickcheck/tests/softmax_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/softmax_1.lst create mode 100644 tools/nnapi_quickcheck/tests/softmax_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/softmax_2.lst create mode 100644 tools/nnapi_quickcheck/tests/softmax_quan_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/softmax_quan_1.lst create mode 100644 tools/nnapi_quickcheck/tests/split_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/split_1.lst create mode 100644 tools/nnapi_quickcheck/tests/split_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/split_2.lst create mode 100644 tools/nnapi_quickcheck/tests/split_3.cpp create mode 100644 tools/nnapi_quickcheck/tests/split_3.lst create mode 100644 tools/nnapi_quickcheck/tests/split_4.cpp create mode 100644 tools/nnapi_quickcheck/tests/split_4.lst create mode 100644 tools/nnapi_quickcheck/tests/sub_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/sub_1.lst create mode 100644 tools/nnapi_quickcheck/tests/sub_2.cpp create mode 100644 tools/nnapi_quickcheck/tests/sub_2.lst create mode 100644 tools/nnapi_quickcheck/tests/sub_3.cpp create mode 100644 tools/nnapi_quickcheck/tests/sub_3.lst create mode 100644 tools/nnapi_quickcheck/tests/sub_4.cpp create mode 100644 tools/nnapi_quickcheck/tests/sub_4.lst create mode 100644 tools/nnapi_quickcheck/tests/sub_5.cpp create mode 100644 tools/nnapi_quickcheck/tests/sub_5.lst create mode 100644 tools/nnapi_quickcheck/tests/sub_6.cpp create mode 100644 tools/nnapi_quickcheck/tests/sub_6.lst create mode 100644 tools/nnapi_quickcheck/tests/tanh_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/tanh_1.lst create mode 100644 tools/nnapi_quickcheck/tests/topk_v2_1.cpp create mode 100644 tools/nnapi_quickcheck/tests/topk_v2_1.lst create mode 100644 tools/opencl_tool/CMakeLists.txt create mode 100644 tools/opencl_tool/src/opencl_info.cc create mode 100644 tools/pbfile_tool/convert_ckpt_to_pb.py create mode 100755 tools/pbfile_tool/pb_info.py create mode 100644 tools/pbfile_tool/readme.md create mode 100644 tools/tensorflow_model_freezer/__init__.py create mode 100644 tools/tensorflow_model_freezer/base_freezer.py create mode 100644 tools/tensorflow_model_freezer/model_freezer_util.py create mode 100644 tools/tensorflow_model_freezer/readme.md create mode 100755 tools/tensorflow_model_freezer/sample/DIV_gen.py create mode 100755 tools/tensorflow_model_freezer/sample/MUL_gen.py create mode 100644 tools/tensorflow_model_freezer/sample/Operation_gen.py create mode 100755 tools/tensorflow_model_freezer/sample/SQUEEZE_gen.py create mode 100755 tools/tensorflow_model_freezer/sample/TOPK_gen.py create mode 100644 tools/tensorflow_model_freezer/sample/__init__.py create mode 100644 tools/test_driver/README.md create mode 100644 tools/test_driver/benchmark_op_list.txt create mode 100755 tools/test_driver/common.sh create mode 100644 tools/test_driver/neurun_frameworktest_list.txt create mode 100755 tools/test_driver/py/common.py create mode 100755 tools/test_driver/py/run_frameworktest.py create mode 100755 tools/test_driver/py/run_unittest.py create mode 100755 tools/test_driver/py/test_driver.py create mode 100755 tools/test_driver/run_benchmark.sh create mode 100755 tools/test_driver/run_benchmark_acl.sh create mode 100755 tools/test_driver/run_benchmark_op.sh create mode 100644 tools/test_driver/run_benchmark_tflite_model.in create mode 100755 tools/test_driver/run_benchmark_tflite_model.sh create mode 100755 tools/test_driver/run_frameworktest.sh create mode 100755 tools/test_driver/run_unittest.sh create mode 100644 tools/tflite_benchmark/CMakeLists.txt create mode 100644 tools/tflite_benchmark/src/tflite_benchmark.cc create mode 100644 tools/tflite_benchmark_model/.FORMATDENY create mode 100644 tools/tflite_benchmark_model/CMakeLists.txt create mode 100644 tools/tflite_benchmark_model/README.md create mode 100644 tools/tflite_benchmark_model/benchmark_main.cc create mode 100644 tools/tflite_benchmark_model/benchmark_model.cc create mode 100644 tools/tflite_benchmark_model/benchmark_model.h create mode 100644 tools/tflite_benchmark_model/benchmark_params.cc create mode 100644 tools/tflite_benchmark_model/benchmark_params.h create mode 100644 tools/tflite_benchmark_model/benchmark_tflite_model.cc create mode 100644 tools/tflite_benchmark_model/benchmark_tflite_model.h create mode 100644 tools/tflite_benchmark_model/command_line_flags.cc create mode 100644 tools/tflite_benchmark_model/command_line_flags.h create mode 100644 tools/tflite_benchmark_model/logging.h create mode 100644 tools/tflite_benchmark_model/profile_summarizer.cc create mode 100644 tools/tflite_benchmark_model/profile_summarizer.h create mode 100644 tools/tflite_examples/CMakeLists.txt create mode 100644 tools/tflite_examples/src/conv.cpp create mode 100644 tools/tflite_run/CMakeLists.txt create mode 100644 tools/tflite_run/README.md create mode 100644 tools/tflite_run/src/args.cc create mode 100644 tools/tflite_run/src/args.h create mode 100644 tools/tflite_run/src/bin_image.cc create mode 100644 tools/tflite_run/src/bin_image.h create mode 100644 tools/tflite_run/src/tensor_dumper.cc create mode 100644 tools/tflite_run/src/tensor_dumper.h create mode 100644 tools/tflite_run/src/tensor_loader.cc create mode 100644 tools/tflite_run/src/tensor_loader.h create mode 100644 tools/tflite_run/src/tflite_run.cc create mode 100644 tools/tflite_run/src/tflite_test.cc create mode 100644 tools/tflitefile_tool/README.md create mode 100755 tools/tflitefile_tool/model_parser.py create mode 100755 tools/tflitefile_tool/operation.py create mode 100755 tools/tflitefile_tool/operator_parser.py create mode 100755 tools/tflitefile_tool/operator_wrapping.py create mode 100755 tools/tflitefile_tool/perf_predictor.py create mode 100755 tools/tflitefile_tool/select_operator.py create mode 100755 tools/tflitefile_tool/tensor_wrapping.py create mode 100644 tools/tflitefile_tool/tflite/ActivationFunctionType.py create mode 100644 tools/tflitefile_tool/tflite/AddOptions.py create mode 100644 tools/tflitefile_tool/tflite/ArgMaxOptions.py create mode 100644 tools/tflitefile_tool/tflite/ArgMinOptions.py create mode 100644 tools/tflitefile_tool/tflite/BatchToSpaceNDOptions.py create mode 100644 tools/tflitefile_tool/tflite/BidirectionalSequenceRNNOptions.py create mode 100644 tools/tflitefile_tool/tflite/Buffer.py create mode 100644 tools/tflitefile_tool/tflite/BuiltinOperator.py create mode 100644 tools/tflitefile_tool/tflite/BuiltinOptions.py create mode 100644 tools/tflitefile_tool/tflite/CallOptions.py create mode 100644 tools/tflitefile_tool/tflite/CastOptions.py create mode 100644 tools/tflitefile_tool/tflite/CombinerType.py create mode 100644 tools/tflitefile_tool/tflite/ConcatEmbeddingsOptions.py create mode 100644 tools/tflitefile_tool/tflite/ConcatenationOptions.py create mode 100644 tools/tflitefile_tool/tflite/Conv2DOptions.py create mode 100644 tools/tflitefile_tool/tflite/CustomOptionsFormat.py create mode 100644 tools/tflitefile_tool/tflite/DepthwiseConv2DOptions.py create mode 100644 tools/tflitefile_tool/tflite/DequantizeOptions.py create mode 100644 tools/tflitefile_tool/tflite/DivOptions.py create mode 100644 tools/tflitefile_tool/tflite/EmbeddingLookupSparseOptions.py create mode 100644 tools/tflitefile_tool/tflite/EqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/ExpOptions.py create mode 100644 tools/tflitefile_tool/tflite/ExpandDimsOptions.py create mode 100644 tools/tflitefile_tool/tflite/FakeQuantOptions.py create mode 100644 tools/tflitefile_tool/tflite/FullyConnectedOptions.py create mode 100644 tools/tflitefile_tool/tflite/FullyConnectedOptionsWeightsFormat.py create mode 100644 tools/tflitefile_tool/tflite/GatherOptions.py create mode 100644 tools/tflitefile_tool/tflite/GreaterEqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/GreaterOptions.py create mode 100644 tools/tflitefile_tool/tflite/L2NormOptions.py create mode 100644 tools/tflitefile_tool/tflite/LSHProjectionOptions.py create mode 100644 tools/tflitefile_tool/tflite/LSHProjectionType.py create mode 100644 tools/tflitefile_tool/tflite/LSTMKernelType.py create mode 100644 tools/tflitefile_tool/tflite/LSTMOptions.py create mode 100644 tools/tflitefile_tool/tflite/LessEqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/LessOptions.py create mode 100644 tools/tflitefile_tool/tflite/LocalResponseNormalizationOptions.py create mode 100644 tools/tflitefile_tool/tflite/LogSoftmaxOptions.py create mode 100644 tools/tflitefile_tool/tflite/MaximumMinimumOptions.py create mode 100644 tools/tflitefile_tool/tflite/MeanOptions.py create mode 100644 tools/tflitefile_tool/tflite/Model.py create mode 100644 tools/tflitefile_tool/tflite/MulOptions.py create mode 100644 tools/tflitefile_tool/tflite/NegOptions.py create mode 100644 tools/tflitefile_tool/tflite/NotEqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/Operator.py create mode 100644 tools/tflitefile_tool/tflite/OperatorCode.py create mode 100644 tools/tflitefile_tool/tflite/PadOptions.py create mode 100644 tools/tflitefile_tool/tflite/PadV2Options.py create mode 100644 tools/tflitefile_tool/tflite/Padding.py create mode 100644 tools/tflitefile_tool/tflite/Pool2DOptions.py create mode 100644 tools/tflitefile_tool/tflite/PowOptions.py create mode 100644 tools/tflitefile_tool/tflite/QuantizationParameters.py create mode 100644 tools/tflitefile_tool/tflite/RNNOptions.py create mode 100644 tools/tflitefile_tool/tflite/ReducerOptions.py create mode 100644 tools/tflitefile_tool/tflite/ReshapeOptions.py create mode 100644 tools/tflitefile_tool/tflite/ResizeBilinearOptions.py create mode 100644 tools/tflitefile_tool/tflite/SVDFOptions.py create mode 100644 tools/tflitefile_tool/tflite/SelectOptions.py create mode 100644 tools/tflitefile_tool/tflite/SequenceRNNOptions.py create mode 100644 tools/tflitefile_tool/tflite/ShapeOptions.py create mode 100644 tools/tflitefile_tool/tflite/SkipGramOptions.py create mode 100644 tools/tflitefile_tool/tflite/SliceOptions.py create mode 100644 tools/tflitefile_tool/tflite/SoftmaxOptions.py create mode 100644 tools/tflitefile_tool/tflite/SpaceToBatchNDOptions.py create mode 100644 tools/tflitefile_tool/tflite/SpaceToDepthOptions.py create mode 100644 tools/tflitefile_tool/tflite/SparseToDenseOptions.py create mode 100644 tools/tflitefile_tool/tflite/SplitOptions.py create mode 100644 tools/tflitefile_tool/tflite/SqueezeOptions.py create mode 100644 tools/tflitefile_tool/tflite/StridedSliceOptions.py create mode 100644 tools/tflitefile_tool/tflite/SubGraph.py create mode 100644 tools/tflitefile_tool/tflite/SubOptions.py create mode 100644 tools/tflitefile_tool/tflite/Tensor.py create mode 100644 tools/tflitefile_tool/tflite/TensorType.py create mode 100644 tools/tflitefile_tool/tflite/TileOptions.py create mode 100644 tools/tflitefile_tool/tflite/TopKV2Options.py create mode 100644 tools/tflitefile_tool/tflite/TransposeConvOptions.py create mode 100644 tools/tflitefile_tool/tflite/TransposeOptions.py create mode 100644 tools/tflitefile_tool/tflite/__init__.py diff --git a/.ctags b/.ctags new file mode 100644 index 000000000..e3d621775 --- /dev/null +++ b/.ctags @@ -0,0 +1,6 @@ +--extra=+f +--exclude=Product +--exclude=tags +--exclude=tests/framework/cache +--exclude=tools/cross/rootfs +--exclude=doxygen diff --git a/.gitignore b/.gitignore index ddba013ae..96188f895 100644 --- a/.gitignore +++ b/.gitignore @@ -63,10 +63,30 @@ GRTAGS # Test cache for model download /tests/framework/cache -# external libs -/externals/absl/ -/externals/eigen/ -/externals/farmhash/ -/externals/flatbuffers/ -/externals/gemmlowp/ -/externals/neon_2_sse/ +# Test report +/report + +# doxygen +/docs/doxygen/html + +# Generated by format checker +/format.patch + +# Default path for ndk +/tools/cross/ndk + +# ignore the embeded cl_kernels +/libs/ARMComputeEx/src/core/CL/cl_kernels/*.clembed +/libs/ARMComputeEx/src/core/CL/cl_kernels/*.hembed + +# External stamp file +/externals/*.stamp + +# External library +/externals/eigen +/externals/farmhash +/externals/flatbuffers +/externals/gemmlowp +/externals/gtest +/externals/neon_2_sse +/externals/tensorflow diff --git a/.gitmodules b/.gitmodules index a82b4eac5..cc6da5068 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,8 +1,4 @@ -[submodule "tensorflow"] - path = externals/tensorflow - url = git://git.tizen.org/platform/upstream/tensorflow - branch = tizen [submodule "acl"] path = externals/acl - url = git://git.tizen.org/platform/upstream/armcl - branch = master + url = https://github.com/ARM-software/ComputeLibrary.git + ignore = dirty diff --git a/CMakeLists.txt b/CMakeLists.txt index faf88ef6d..fd9be5f30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,181 +1,80 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.1) project(nnfw) -if(CMAKE_VERSION VERSION_LESS 3.1.0) - set(CMAKE_CXX_FLAGS "-std=c++11") -else(CMAKE_VERSION VERSION_LESS 3.1.0) - set(CMAKE_CXX_STANDARD 11) -endif(CMAKE_VERSION VERSION_LESS 3.1.0) - -# set host platform to build -if(NOT HOST_ARCH OR "${HOST_ARCH}" STREQUAL "") - set(HOST_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR}) -endif() - -# set target platform to run -if(NOT TARGET_ARCH OR "${TARGET_ARCH}" STREQUAL "") - set(TARGET_ARCH "${HOST_ARCH}") -endif() - -if(NOT DEFINED TARGET_OS) - set(TARGET_OS "${HOST_OS}") -endif() - -if("${HOST_ARCH}" STREQUAL "x86_64") - set(HOST_ARCH_BASE ${HOST_ARCH}) -elseif("${HOST_ARCH}" STREQUAL "armv7l") - set(HOST_ARCH_BASE "arm") -elseif("${HOST_ARCH}" STREQUAL "arm64") - set(HOST_ARCH_BASE "arm64") -elseif("${HOST_ARCH}" STREQUAL "aarch64") - set(HOST_ARCH_BASE "aarch64") -else() - message(FATAL_ERROR "'${HOST_ARCH}' architecture is not supported") -endif() - -if("${TARGET_ARCH}" STREQUAL "x86_64") - set(TARGET_ARCH_BASE ${TARGET_ARCH}) -elseif("${TARGET_ARCH}" STREQUAL "armv7l") - set(TARGET_ARCH_BASE "arm") -elseif("${TARGET_ARCH}" STREQUAL "arm64") - set(TARGET_ARCH_BASE "arm64") -elseif("${TARGET_ARCH}" STREQUAL "aarch64") - set(TARGET_ARCH_BASE "aarch64") -else() - message(FATAL_ERROR "'${TARGET_ARCH}' architecture is not supported") -endif() - -# Determine native or cross build -if("${HOST_ARCH}" STREQUAL "${TARGET_ARCH}") - set(BUILD_IS_NATIVE True) -else() - set(BUILD_IS_NATIVE False) -endif() - -# host & target platform name -set(HOST_PLATFORM "${HOST_ARCH}-${HOST_OS}") -set(TARGET_PLATFORM "${TARGET_ARCH}-${TARGET_OS}") - -# lib pthread as a variable (pthread must be disabled on android) -set(LIB_PTHREAD pthread) +macro(nnfw_include PREFIX) + include("${CMAKE_SOURCE_DIR}/cmake/modules/${PREFIX}.cmake") +endmacro(nnfw_include) + +macro(nnfw_find_package PREFIX) + find_package(${PREFIX} CONFIG NO_DEFAULT_PATH PATHS ${CMAKE_SOURCE_DIR}/cmake/packages ${ARGN}) +endmacro(nnfw_find_package) + +set(CMAKE_CXX_STANDARD 11) + +# identify platform: HOST_PLATFORM, TARGET_PLATFORM and related +include("cmake/option/identify_platform.cmake") # platform specific options include("cmake/option/option_${TARGET_PLATFORM}.cmake") -# test-coverage build flag -if("${COVERAGE_BUILD}" STREQUAL "1") - set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE ON) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") - set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") -endif() - -# add common flags -foreach(FLAG ${FLAGS_COMMON}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") -endforeach() - -# add c flags -foreach(FLAG ${FLAGS_CONLY}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") -endforeach() - -# add cxx flags -foreach(FLAG ${FLAGS_CXXONLY}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") -endforeach() - -# +# apply compilation flags +# note: this should be placed after cmake/option/option_xxx.cmake files +include("cmake/ApplyCompileFlags.cmake") + # Configuration flags -# -option(BUILD_ACL "Build ARM Compute Library" OFF) -option(BUILD_ACL_STATIC_LIB "Build ARM Comput Static Library" OFF) -option(BUILD_BENCHMARK_ACL "Build ARM Compute Library Benchmarks" OFF) -option(BUILD_NN_RUNTIME "Build NN Runtime" ON) -option(BUILD_LABS "Build lab projects" ON) -option(BUILD_ANDROID_NN_RUNTIME_TEST "Build Android NN Runtime Test" ON) - -# -# Common variables -# -set(NNFW_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) - -if(NOT "${TARGET_OS}" STREQUAL "tizen" AND NOT "${TARGET_OS}" STREQUAL "android") - set(NNFW_ACL_FOLDER ${CMAKE_SOURCE_DIR}/externals/acl) - set(NNFW_ACL_INCLUDES ${NNFW_ACL_FOLDER} - ${NNFW_ACL_FOLDER}/include) -else() - set(NNFW_ACL_FOLDER "") - set(NNFW_ACL_INCLUDES "") -endif() -set(NNFW_ACL_LIBS arm_compute_graph arm_compute arm_compute_core) -set(NNFW_NN_RUNTIME_ROOT ${CMAKE_SOURCE_DIR}/runtimes/nn) +include("cmake/CfgOptionFlags.cmake") +# and besides CfgOptionFlags.cmake that can be given outside +# OBS_BUILD: build boolean flag that tizen in OBS build +# COVERAGE_BUILD: build boolean flag that enables converage test +# ROOTFS_ARM: arm rootfs path for cross building +# ROOTFS_ARM64: arm 64bit rootfs path for cross building, linux,tizen,android +# TARGET_ARCH: target architecture string for cross building +# TARGET_OS: target os string for cross building # NOTE '${CMAKE_INSTALL_PREFIX}/lib' should be added as a link directory as # CI server places pre-built ARM compute libraries on this directory. link_directories(${CMAKE_INSTALL_PREFIX}/lib) -# +# Download configuration +option(DOWNLOAD_TENSORFLOW "Download Tensorflow source" ON) +option(DOWNLOAD_EIGEN "Download Eigen source" ON) +option(DOWNLOAD_FARMHASH "Download farmhash source" ON) +option(DOWNLOAD_GEMMLOWP "Download GEMM low precesion library source" ON) +option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" ON) +option(DOWNLOAD_FLATBUFFERS "Download FlatBuffers source" ON) + # GTest support -# -if("${TARGET_OS}" STREQUAL "tizen" AND NOT "${TARGET_OS}" STREQUAL "android") - enable_testing() - find_package(GTest REQUIRED) - include_directories(${GTEST_INCLUDE_DIR}) -else() - include(ExternalProject) - # Download and install GoogleTest - ExternalProject_Add( - googletest - URL https://github.com/google/googletest/archive/release-1.8.0.zip - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/googletest - # Disable install step - INSTALL_COMMAND "" - LOG_DOWNLOAD 1 - LOG_BUILD 1 - LOG_CONFIGURE 1 - CMAKE_ARGS - -DCMAKE_TOOLCHAIN_FILE=${PROJECT_SOURCE_DIR}/cmake/config/config_${TARGET_ARCH}-${TARGET_OS}.cmake - ) - ExternalProject_Get_Property(googletest source_dir binary_dir) - - # include and link path for all sub project - include_directories(${source_dir}/googletest/include/) - link_directories(${binary_dir}/googlemock/gtest/) -endif() - -# gtest libs -set(NNFW_GTEST_LIBS libgtest.a libgtest_main.a ${LIB_PTHREAD}) +option(BUILD_GTEST "Download and build Google Test" ON) +nnfw_find_package(GTest QUIET) # TODO For now Android build is being enabled incrementally so not all subdirectories are added yet. # However we are going to have the same subdirectories with other OS eventually. if("${TARGET_OS}" STREQUAL "android") include_directories(externals/tensorflow) + include_directories(externals/acl) + include_directories(externals/acl/include) include_directories(externals/flatbuffers/include) include_directories(include) add_subdirectory(libs) add_subdirectory(externals) add_subdirectory(tools/nnapi_test) + add_subdirectory(tools/tflite_benchmark) - if(BUILD_NN_RUNTIME) - add_subdirectory(runtimes/nn) - endif(BUILD_NN_RUNTIME) - add_subdirectory(src/support/tflite) + add_subdirectory(runtimes) else("${TARGET_OS}" STREQUAL "android") # General case (non-android build) -# TODO Fix indentation + if (NOT OBS_BUILD) + add_subdirectory(externals) + endif() + add_subdirectory(libs) + add_subdirectory(tools) + add_subdirectory(runtimes) -if (NOT ${TARGET_OS} STREQUAL "tizen") - add_subdirectory(externals) -endif() -add_subdirectory(libs) -add_subdirectory(tools) -add_subdirectory(runtimes) + add_subdirectory(benchmark) + add_subdirectory(contrib) endif("${TARGET_OS}" STREQUAL "android") diff --git a/LICENSE b/LICENSE index eb1c3bbc1..4d3b3ab13 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,7 @@ This file provides full text of licenses used in this project - Apache Licence 2.0 -- Mozilla Public License 2.0 -- 3-Clause BSD License +- MIT ............................................................................... @@ -211,403 +210,24 @@ limitations under the License. ............................................................................... -Mozilla Public License Version 2.0 -================================== +Copyright (c) 2016-2018 ARM Limited. -1. Definitions --------------- +SPDX-License-Identifier: MIT -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - -............................................................................... - -Copyright (c) 2011, Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* Neither the name of Intel Corporation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile index 63b172973..4c7b98ea8 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,13 @@ CROSS_BUILD?=0 HOST_OS?=linux TARGET_OS?=linux NPROCS:=1 -OBS_BUILD?=0 +PARALLEL_BUILD?=1 +## TODO: fix obs build break +OBS_BUILD?=OFF COVERAGE_BUILD?=0 BENCHMARK_ACL_BUILD?=0 OPTIONS?= +UPDATE_MODULE?=1 # make TARGET and TYPE to lowercase TARGET_ARCH_LC=$(shell echo $(TARGET_ARCH) | tr A-Z a-z) @@ -56,9 +59,11 @@ ifeq ($(BENCHMARK_ACL_BUILD),1) OPTIONS+= -DBUILD_BENCHMARK_ACL=1 endif -# Get number of processors (linux only for now) -ifeq ($(HOST_OS),linux) - NPROCS:=$(shell grep -c ^processor /proc/cpuinfo) +ifeq ($(PARALLEL_BUILD),1) + # Get number of processors (linux only for now) + ifeq ($(HOST_OS),linux) + NPROCS:=$(shell grep -c ^processor /proc/cpuinfo) + endif endif WORKHOME=Product @@ -79,19 +84,36 @@ TIMESTAMP_CONFIGURE=$(WORKDIR)/CONFIGURE TIMESTAMP_BUILD=$(WORKDIR)/BUILD TIMESTAMP_INSTALL=$(WORKDIR)/INSTALL +# +# for Build Arm Compute Library with SCONS +# ACL_FOLDER=externals/acl -ACL_COMMAND=scons -j${NPROCS} Werror=1 neon=1 opencl=1 os=linux examples=0 embed_kernels=1 +ACL_COMMAND=scons -j${NPROCS} neon=1 opencl=1 examples=0 embed_kernels=1 os=$(TARGET_OS) ifeq ($(TARGET_ARCH_LC),armv7l) ACL_COMMAND+= arch=armv7a + ACL_BUILD_OUT=armv7a-$(TARGET_OS) else ifeq ($(TARGET_ARCH_LC),aarch64) ACL_COMMAND+= arch=arm64-v8a + ACL_BUILD_OUT=arm64-v8a-$(TARGET_OS) +else ifeq ($(TARGET_ARCH_BASE),arm64) + ACL_COMMAND+= arch=arm64-v8a + ACL_BUILD_OUT=arm64-v8a-$(TARGET_OS) endif -ifeq ($(BUILD_TYPE_LC),debug) - ACL_COMMAND+=debug=1 asserts=1 build_dir=debug - ACL_FOLDER_BUILD=$(ACL_FOLDER)/build/debug +ifeq ($(TARGET_OS),android) + ACL_COMMAND+= Werror=0 + ANDROID_GNUSTL_PATH=$(ROOTFS_ARM64)/bin:$(ROOTFS_ARM64)/aarch64-linux-android/bin:$$PATH else - ACL_COMMAND+=build_dir=release - ACL_FOLDER_BUILD=$(ACL_FOLDER)/build/release + ACL_COMMAND+= Werror=1 +endif +ifeq ($(BUILD_TYPE_LC),debug) + ACL_COMMAND+= debug=1 asserts=1 +endif +ACL_FOLDER_NAME=$(ACL_BUILD_OUT).$(BUILD_TYPE_LC) +ACL_COMMAND+= build_dir=$(ACL_FOLDER_NAME) +ACL_FOLDER_BUILD=$(ACL_FOLDER)/build/$(ACL_FOLDER_NAME) + +ifeq ($(OBS_BUILD),ON) + UPDATE_MODULE=0 endif all: build @@ -122,7 +144,7 @@ tflite: tflite_build_internal ### Command (internal) ### configure_internal: -ifneq ($(TARGET_OS),tizen) +ifeq ($(UPDATE_MODULE),1) git submodule update --init --recursive endif @@ -132,6 +154,7 @@ endif -DCMAKE_BUILD_TYPE=$(BUILD_TYPE_LC) -DTARGET_ARCH=$(TARGET_ARCH_LC) \ -DHOST_OS=$(HOST_OS) \ -DTARGET_OS=$(TARGET_OS) \ + -DOBS_BUILD=$(OBS_BUILD) \ $(OPTION_TOOLCHAIN) \ $(OPTIONS) touch $(TIMESTAMP_CONFIGURE) @@ -149,7 +172,15 @@ install_internal: touch $(TIMESTAMP_INSTALL) internal_acl_build: +ifeq ($(UPDATE_MODULE),1) + git submodule update --init --recursive +endif + +ifeq ($(TARGET_OS),android) + cd $(ACL_FOLDER) && CXX=clang++ CC=clang PATH=$(ANDROID_GNUSTL_PATH) $(ACL_COMMAND) +else cd $(ACL_FOLDER) && $(ACL_COMMAND) +endif internal_acl_install: @mkdir -vp $(INSTALL_PATH)/lib @@ -193,7 +224,7 @@ build_coverage_suite: install_internal @mv coverage-suite.tar.gz $(INSTALL_ROOT)/. runtime_build_internal: $(BUILD_ROOT) - cd $(BUILD_ROOT) && make -j $(NPROCS) runtime + cd $(BUILD_ROOT) && make -j $(NPROCS) nnapi_pure_arm_compute rm -rf $(BUILD_ALIAS) ln -s $(BUILD_FOLDER) $(BUILD_ALIAS) touch $(TIMESTAMP_BUILD) @@ -202,14 +233,14 @@ test_build_internal: $(BUILD_ROOT) # Build test cd $(BUILD_ROOT) && make -j $(NPROCS) nnapi_test # Build unittest - cd $(BUILD_ROOT) && make -j $(NPROCS) kernelacl_test runtime_run_android_nn_test + cd $(BUILD_ROOT) && make -j $(NPROCS) runtime_run_android_nn_test rm -rf $(BUILD_ALIAS) ln -s $(BUILD_FOLDER) $(BUILD_ALIAS) touch $(TIMESTAMP_BUILD) tflite_build_internal: $(BUILD_ROOT) # Build test - cd $(BUILD_ROOT) && make -j $(NPROCS) tensorflow-lite + cd $(BUILD_ROOT) && make -j $(NPROCS) tensorflow-lite gtest_main rm -rf $(BUILD_ALIAS) ln -s $(BUILD_FOLDER) $(BUILD_ALIAS) touch $(TIMESTAMP_BUILD) diff --git a/README.md b/README.md index 3d2a1f451..952c09883 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,31 @@ This project _nnfw_ aims at providing a high-performance, on-device neural netwo framework that performs inference of a given NN model on processors, such as CPU, GPU, or NPU, in the target platform, such as Tizen and Smart Machine Platform (SMP). -## About this _experimental_ release -_Experimental_ means the Tizen M1 release of _nnfw_ has very limited capability, which could only -run InceptionV3, and would have very limited support from the developers. And, the backward -compatibility in the future release, e.g., one planned in October, might not be guaranteed. +## Project Documents +- [Roadmap](docs/roadmap.md) +- [SW Requirement Specification](docs/project/2018_requirement_specification.md) +- [SW High Level Design](docs/project/2018_high_level_design.md) -## How-to documents -- [How to add unittest using gtest](docs/howto/HowToAddUnittest.md) +## Getting started +- For the contribution, please refer to our [contribution guide](docs/HowToContribute.md). +- You can also find how-to documents [HERE](docs/howto.md). + +## Feature Request (NEW) + +You can suggest development of nnfw's features that are not yet available. + +The functions requested so far can be checked in the [popular feature request](https://github.sec.samsung.net/STAR/nnfw/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3AFEATURE_REQUEST+sort%3Areactions-%2B1-desc) list. + +- If the feature you want is on the list, :+1: to the body of the issue. The feature with the most +:+1: is placed at the top of the list. When adding new features, we will prioritize them with this reference. +Of course, it is good to add an additional comment which describes your request in detail. + +- For features not listed, [create a new issue](https://github.sec.samsung.net/STAR/nnfw/issues/new). +Sooner or later, the maintainer will tag the `FEATURE_REQUEST` label and appear on the list. + +We expect most current feature requests to be focused on operator kernel implementations. +It is good to make a request, but it is better if you contribute by yourself. See the following guide, +[How to Implement Operator Kernel](docs/HowToImplementOperatorKernel.md), for help. + +We are looking forward to your participation. +Thank you in advance! diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt new file mode 100644 index 000000000..e36a0ece2 --- /dev/null +++ b/benchmark/CMakeLists.txt @@ -0,0 +1,3 @@ +if(BUILD_BENCHMARK_ACL) + add_subdirectory(acl) +endif(BUILD_BENCHMARK_ACL) diff --git a/benchmark/acl/Benchmark.cpp b/benchmark/acl/Benchmark.cpp new file mode 100644 index 000000000..ba6001232 --- /dev/null +++ b/benchmark/acl/Benchmark.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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 "Benchmark.h" + +#include + +Count::Count() : _value(1) +{ + auto env = std::getenv("COUNT"); + + if (env) + { + _value = atoi(env); + } +} + +uint32_t Count::value(void) const { return _value; } + +#include +#include +#include + +#include +#include + +using namespace boost::accumulators; + +void run_benchmark(arm_compute::graph::frontend::Stream &graph) +{ + // NOTE Here the number of warming-up iterations is hardcoded + // TODO Decide the number of warming-up iterations appropriately + for (uint32_t n = 0; n < 3; ++n) + { + auto beg = std::chrono::steady_clock::now(); + graph.run(); + auto end = std::chrono::steady_clock::now(); + auto elapsed = std::chrono::duration_cast(end - beg); + + std::cout << "Warming-up " << n << ": " << elapsed.count() << "ms" << std::endl; + } + + accumulator_set> acc; + + const Count count; + + for (uint32_t n = 0; n < count.value(); ++n) + { + auto beg = std::chrono::steady_clock::now(); + graph.run(); + auto end = std::chrono::steady_clock::now(); + auto elapsed = std::chrono::duration_cast(end - beg); + + std::cout << "Iteration " << n << ": " << elapsed.count() << "ms" << std::endl; + + acc(elapsed.count()); + } + + std::cout << "--------" << std::endl; + std::cout << "Mean: " << mean(acc) << "ms" << std::endl; +} diff --git a/benchmark/acl/Benchmark.h b/benchmark/acl/Benchmark.h new file mode 100644 index 000000000..200f40952 --- /dev/null +++ b/benchmark/acl/Benchmark.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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 __ACL_BENCHMARK_H__ +#define __ACL_BENCHMARK_H__ + +#include "arm_compute/graph/ITensorAccessor.h" +#include "arm_compute/graph.h" +#include "arm_compute/core/CL/OpenCL.h" + +struct InputAccessor final : public arm_compute::graph::ITensorAccessor +{ + InputAccessor() = default; + /** Allows instances to move constructed */ + InputAccessor(InputAccessor &&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor &tensor) override + { + return true; + } +}; + +struct OutputAccessor final : public arm_compute::graph::ITensorAccessor +{ + OutputAccessor() = default; + /** Allows instances to move constructed */ + OutputAccessor(OutputAccessor &&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor &tensor) override + { + return false; + } +}; + +template std::unique_ptr get_accessor() +{ + return std::unique_ptr(new T()); +} + +class Count +{ +public: + Count(); + +public: + uint32_t value(void) const; + +private: + uint32_t _value; +}; + +inline arm_compute::graph::Target set_target_hint(int target) +{ + if(target == 1 && arm_compute::opencl_is_available()) + { + // If type of target is OpenCL, check if OpenCL is available and initialize the scheduler + return arm_compute::graph::Target::CL; + } + else + { + return arm_compute::graph::Target::NEON; + } +} + +void run_benchmark(arm_compute::graph::frontend::Stream &graph); + +#endif diff --git a/benchmark/acl/CMakeLists.txt b/benchmark/acl/CMakeLists.txt new file mode 100644 index 000000000..3bebc275e --- /dev/null +++ b/benchmark/acl/CMakeLists.txt @@ -0,0 +1,20 @@ +nnfw_find_package(ARMCompute REQUIRED) + +add_library(arm_compute_benchmark SHARED "Benchmark.cpp") +target_include_directories(arm_compute_benchmark PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(arm_compute_benchmark arm_compute_graph) +install(TARGETS arm_compute_benchmark DESTINATION lib) + +# GoogLeNet benchmark +add_executable(benchmark_googlenet "benchmark_googlenet.cpp") +target_link_libraries(benchmark_googlenet arm_compute_benchmark) + +# GoogLeNet benchmark +add_executable(benchmark_inception_v3 "benchmark_inception_v3.cpp") +target_link_libraries(benchmark_inception_v3 arm_compute_benchmark) + +# MobileNet benchmark +add_executable(benchmark_mobilenet "benchmark_mobilenet.cpp") +target_link_libraries(benchmark_mobilenet arm_compute_benchmark) + +install(TARGETS benchmark_googlenet benchmark_inception_v3 benchmark_mobilenet DESTINATION bin) diff --git a/benchmark/acl/benchmark_googlenet.cpp b/benchmark/acl/benchmark_googlenet.cpp new file mode 100644 index 000000000..ecefdcbea --- /dev/null +++ b/benchmark/acl/benchmark_googlenet.cpp @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/graph.h" + +#include "Benchmark.h" + +#include +#include + +using namespace arm_compute::graph::frontend; + +inline std::unique_ptr get_input_accessor(void) +{ + return get_accessor(); +} + +inline std::unique_ptr get_random_accessor(float lower, float upper) +{ + return get_accessor(); +} + +inline std::unique_ptr get_weights_accessor(const std::string &path, const std::string &data_file, DataLayout file_layout = DataLayout::NCHW) +{ + return get_accessor(); +} + +inline std::unique_ptr get_output_accessor(void) +{ + return get_accessor(); +} + +/** Example demonstrating how to implement Googlenet's network using the Compute Library's graph API + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments ( [optional] Target (0 = NEON, 1 = OpenCL, 2 = OpenCL with Tuner), [optional] Path to the weights folder, [optional] image, [optional] labels, [optional] Fast math for convolution layer (0 = DISABLED, 1 = ENABLED) ) + */ +class GraphGooglenetExample +{ +public: + void do_setup(int argc, char **argv) + { + std::string data_path; /* Path to the trainable data */ + std::string image; /* Image data */ + std::string label; /* Label data */ + + const std::array mean_rgb{ { 122.68f, 116.67f, 104.01f } }; + // Set target. 0 (NEON), 1 (OpenCL), 2 (OpenCL with Tuner). By default it is NEON + const int target = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0; + Target target_hint = set_target_hint(target); + FastMathHint fast_math_hint = FastMathHint::DISABLED; + + // Parse arguments + if(argc < 2) + { + // Print help + std::cout << "Usage: " << argv[0] << " [target] [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 2) + { + std::cout << "Usage: " << argv[0] << " " << argv[1] << " [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 3) + { + data_path = argv[2]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No image provided: using random values\n\n"; + } + else if(argc == 4) + { + data_path = argv[2]; + image = argv[3]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " [labels] [fast_math_hint]\n\n"; + std::cout << "No text file with labels provided: skipping output accessor\n\n"; + } + else if(argc == 5) + { + data_path = argv[2]; + image = argv[3]; + label = argv[4]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " " << argv[4] << " [fast_math_hint]\n\n"; + std::cout << "No fast math info provided: disabling fast math\n\n"; + } + else + { + data_path = argv[2]; + image = argv[3]; + label = argv[4]; + fast_math_hint = (std::strtol(argv[5], nullptr, 1) == 0) ? FastMathHint::DISABLED : FastMathHint::ENABLED; + } + + graph << target_hint + << fast_math_hint + << InputLayer(TensorDescriptor(TensorShape(224U, 224U, 3U, 1U), DataType::F32), + get_input_accessor()) + << ConvolutionLayer( + 7U, 7U, 64U, + get_weights_accessor(data_path, "/cnn_data/googlenet_model/conv1/conv1_7x7_s2_w.npy"), + get_weights_accessor(data_path, "/cnn_data/googlenet_model/conv1/conv1_7x7_s2_b.npy"), + PadStrideInfo(2, 2, 3, 3)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))) + << NormalizationLayer(NormalizationLayerInfo(NormType::CROSS_MAP, 5, 0.0001f, 0.75f)) + << ConvolutionLayer( + 1U, 1U, 64U, + get_weights_accessor(data_path, "/cnn_data/googlenet_model/conv2/conv2_3x3_reduce_w.npy"), + get_weights_accessor(data_path, "/cnn_data/googlenet_model/conv2/conv2_3x3_reduce_b.npy"), + PadStrideInfo(1, 1, 0, 0)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + << ConvolutionLayer( + 3U, 3U, 192U, + get_weights_accessor(data_path, "/cnn_data/googlenet_model/conv2/conv2_3x3_w.npy"), + get_weights_accessor(data_path, "/cnn_data/googlenet_model/conv2/conv2_3x3_b.npy"), + PadStrideInfo(1, 1, 1, 1)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + << NormalizationLayer(NormalizationLayerInfo(NormType::CROSS_MAP, 5, 0.0001f, 0.75f)) + << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + graph << get_inception_node(data_path, "inception_3a", 64, std::make_tuple(96U, 128U), std::make_tuple(16U, 32U), 32U); + graph << get_inception_node(data_path, "inception_3b", 128, std::make_tuple(128U, 192U), std::make_tuple(32U, 96U), 64U); + graph << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + graph << get_inception_node(data_path, "inception_4a", 192, std::make_tuple(96U, 208U), std::make_tuple(16U, 48U), 64U); + graph << get_inception_node(data_path, "inception_4b", 160, std::make_tuple(112U, 224U), std::make_tuple(24U, 64U), 64U); + graph << get_inception_node(data_path, "inception_4c", 128, std::make_tuple(128U, 256U), std::make_tuple(24U, 64U), 64U); + graph << get_inception_node(data_path, "inception_4d", 112, std::make_tuple(144U, 288U), std::make_tuple(32U, 64U), 64U); + graph << get_inception_node(data_path, "inception_4e", 256, std::make_tuple(160U, 320U), std::make_tuple(32U, 128U), 128U); + graph << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + graph << get_inception_node(data_path, "inception_5a", 256, std::make_tuple(160U, 320U), std::make_tuple(32U, 128U), 128U); + graph << get_inception_node(data_path, "inception_5b", 384, std::make_tuple(192U, 384U), std::make_tuple(48U, 128U), 128U); + graph << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 7, PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL))) + << FullyConnectedLayer( + 1000U, + get_weights_accessor(data_path, "/cnn_data/googlenet_model/loss3/loss3_classifier_w.npy"), + get_weights_accessor(data_path, "/cnn_data/googlenet_model/loss3/loss3_classifier_b.npy")) + << SoftmaxLayer() + << OutputLayer(get_output_accessor()); + + // Finalize graph + GraphConfig config; + config.use_tuner = (target == 2); + graph.finalize(target_hint, config); + } + void do_run() + { + run_benchmark(graph); + } + +private: + Stream graph{ 0, "GoogleNet" }; + + BranchLayer get_inception_node(const std::string &data_path, std::string &¶m_path, + unsigned int a_filt, + std::tuple b_filters, + std::tuple c_filters, + unsigned int d_filt) + { + std::string total_path = "/cnn_data/googlenet_model/" + param_path + "/" + param_path + "_"; + SubStream i_a(graph); + i_a << ConvolutionLayer( + 1U, 1U, a_filt, + get_weights_accessor(data_path, total_path + "1x1_w.npy"), + get_weights_accessor(data_path, total_path + "1x1_b.npy"), + PadStrideInfo(1, 1, 0, 0)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); + + SubStream i_b(graph); + i_b << ConvolutionLayer( + 1U, 1U, std::get<0>(b_filters), + get_weights_accessor(data_path, total_path + "3x3_reduce_w.npy"), + get_weights_accessor(data_path, total_path + "3x3_reduce_b.npy"), + PadStrideInfo(1, 1, 0, 0)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + << ConvolutionLayer( + 3U, 3U, std::get<1>(b_filters), + get_weights_accessor(data_path, total_path + "3x3_w.npy"), + get_weights_accessor(data_path, total_path + "3x3_b.npy"), + PadStrideInfo(1, 1, 1, 1)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); + + SubStream i_c(graph); + i_c << ConvolutionLayer( + 1U, 1U, std::get<0>(c_filters), + get_weights_accessor(data_path, total_path + "5x5_reduce_w.npy"), + get_weights_accessor(data_path, total_path + "5x5_reduce_b.npy"), + PadStrideInfo(1, 1, 0, 0)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + << ConvolutionLayer( + 5U, 5U, std::get<1>(c_filters), + get_weights_accessor(data_path, total_path + "5x5_w.npy"), + get_weights_accessor(data_path, total_path + "5x5_b.npy"), + PadStrideInfo(1, 1, 2, 2)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); + + SubStream i_d(graph); + i_d << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))) + << ConvolutionLayer( + 1U, 1U, d_filt, + get_weights_accessor(data_path, total_path + "pool_proj_w.npy"), + get_weights_accessor(data_path, total_path + "pool_proj_b.npy"), + PadStrideInfo(1, 1, 0, 0)) + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); + + return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + } +}; + +/** Main program for Googlenet + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments ( [optional] Target (0 = NEON, 1 = OpenCL, 2 = OpenCL with Tuner), [optional] Path to the weights folder, [optional] image, [optional] labels, [optional] Fast math for convolution layer (0 = DISABLED, 1 = ENABLED) ) + */ +int main(int argc, char **argv) +{ + GraphGooglenetExample example; + + example.do_setup(argc, argv); + example.do_run(); + + return 0; +} diff --git a/benchmark/acl/benchmark_inception_v3.cpp b/benchmark/acl/benchmark_inception_v3.cpp new file mode 100644 index 000000000..7bb31fcdb --- /dev/null +++ b/benchmark/acl/benchmark_inception_v3.cpp @@ -0,0 +1,891 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * Copyright (c) 2017-2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/graph.h" + +#include "Benchmark.h" + +#include +#include + +using namespace arm_compute::graph::frontend; + +inline std::unique_ptr get_input_accessor(void) +{ + return get_accessor(); +} + +inline std::unique_ptr get_random_accessor(float lower, float upper) +{ + return get_accessor(); +} + +inline std::unique_ptr get_weights_accessor(const std::string &path, const std::string &data_file, DataLayout file_layout = DataLayout::NCHW) +{ + return get_accessor(); +} + +inline std::unique_ptr get_output_accessor(void) +{ + return get_accessor(); +} + +/** Example demonstrating how to implement InceptionV3's network using the Compute Library's graph API + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments ( [optional] Target (0 = NEON, 1 = OpenCL, 2 = OpenCL with Tuner), [optional] Path to the weights folder, [optional] image, [optional] labels ) + */ +class InceptionV3Example +{ +public: + void do_setup(int argc, char **argv) + { + std::string data_path; /* Path to the trainable data */ + std::string image; /* Image data */ + std::string label; /* Label data */ + + // Set target. 0 (NEON), 1 (OpenCL), 2 (OpenCL with Tuner). By default it is NEON + const int target = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0; + Target target_hint = set_target_hint(target); + FastMathHint fast_math_hint = FastMathHint::DISABLED; + + // Parse arguments + if(argc < 2) + { + // Print help + std::cout << "Usage: " << argv[0] << " [target] [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 2) + { + std::cout << "Usage: " << argv[0] << " " << argv[1] << " [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 3) + { + data_path = argv[2]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No image provided: using random values\n\n"; + } + else if(argc == 4) + { + data_path = argv[2]; + image = argv[3]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " [labels] [fast_math_hint]\n\n"; + std::cout << "No text file with labels provided: skipping output accessor\n\n"; + } + else if(argc == 5) + { + data_path = argv[2]; + image = argv[3]; + label = argv[4]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " " << argv[4] << " [fast_math_hint]\n\n"; + std::cout << "No fast math info provided: disabling fast math\n\n"; + } + else + { + data_path = argv[2]; + image = argv[3]; + label = argv[4]; + fast_math_hint = (std::strtol(argv[5], nullptr, 1) == 0) ? FastMathHint::DISABLED : FastMathHint::ENABLED; + } + + graph << target_hint + << fast_math_hint + << InputLayer(TensorDescriptor(TensorShape(299U, 299U, 3U, 1U), DataType::F32), + get_input_accessor()) + << ConvolutionLayer(3U, 3U, 32U, + get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_weights.npy"), + std::unique_ptr(nullptr), PadStrideInfo(2, 2, 0, 0)) + .set_name("Conv2d_1a_3x3/convolution") + << BatchNormalizationLayer(get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name("Conv2d_1a_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_1a_3x3/Relu") + << ConvolutionLayer(3U, 3U, 32U, + get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_weights.npy"), + std::unique_ptr(nullptr), PadStrideInfo(1, 1, 0, 0)) + .set_name("Conv2d_2a_3x3/convolution") + << BatchNormalizationLayer(get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name("Conv2d_2a_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_2a_3x3/Relu") + + << ConvolutionLayer(3U, 3U, 64U, + get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_weights.npy"), + std::unique_ptr(nullptr), PadStrideInfo(1, 1, 1, 1)) + .set_name("Conv2d_2b_3x3/convolution") + << BatchNormalizationLayer(get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name("Conv2d_2b_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_2b_3x3/Relu") + + << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name("MaxPool_3a_3x3/MaxPool") + + << ConvolutionLayer(1U, 1U, 80U, + get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_weights.npy"), + std::unique_ptr(nullptr), PadStrideInfo(1, 1, 0, 0)) + .set_name("Conv2d_3b_1x1/convolution") + << BatchNormalizationLayer(get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name("Conv2d_3b_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_3b_1x1/Relu") + + << ConvolutionLayer(3U, 3U, 192U, + get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_weights.npy"), + std::unique_ptr(nullptr), PadStrideInfo(1, 1, 0, 0)) + .set_name("Conv2d_4a_3x3/convolution") + << BatchNormalizationLayer(get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name("Conv2d_4a_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_4a_3x3/Relu") + + << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name("MaxPool_5a_3x3/MaxPool"); + + graph << get_inception_node_A(data_path, "Mixed_5b", 64U, std::make_tuple(48U, 64U), std::make_tuple(64U, 96U, 96U), + 32U) + .set_name("Mixed_5b/concat"); + graph << get_inception_node_A(data_path, "Mixed_5c", 64U, std::make_tuple(48U, 64U), std::make_tuple(64U, 96U, 96U), + 64U, true) + .set_name("Mixed_5c/concat"); + graph << get_inception_node_A(data_path, "Mixed_5d", 64U, std::make_tuple(48U, 64U), std::make_tuple(64U, 96U, 96U), + 64U) + .set_name("Mixed_5d/concat"); + + graph << get_inception_node_B(data_path, "Mixed_6a", 384U, std::make_tuple(64U, 96U, 96U)).set_name("Mixed_6a/concat"); + + graph << get_inception_node_C(data_path, "Mixed_6b", 192U, std::make_tuple(128U, 128U, 192U), + std::make_tuple(128U, 128U, 128U, 128U, 192U), 192U) + .set_name("Mixed_6b/concat"); + graph << get_inception_node_C(data_path, "Mixed_6c", 192U, std::make_tuple(160U, 160U, 192U), + std::make_tuple(160U, 160U, 160U, 160U, 192U), 192U) + .set_name("Mixed_6c/concat"); + graph << get_inception_node_C(data_path, "Mixed_6d", 192U, std::make_tuple(160U, 160U, 192U), + std::make_tuple(160U, 160U, 160U, 160U, 192U), 192U) + .set_name("Mixed_6d/concat"); + graph << get_inception_node_C(data_path, "Mixed_6e", 192U, std::make_tuple(192U, 192U, 192U), + std::make_tuple(192U, 192U, 192U, 192U, 192U), 192U) + .set_name("Mixed_6e/concat"); + + graph << get_inception_node_D(data_path, "Mixed_7a", std::make_tuple(192U, 320U), + std::make_tuple(192U, 192U, 192U, 192U)) + .set_name("Mixed_7a/concat"); + + graph << get_inception_node_E(data_path, "Mixed_7b", 320U, std::make_tuple(384U, 384U, 384U), + std::make_tuple(448U, 384U, 384U, 384U), 192U) + .set_name("Mixed_7b/concat"); + graph << get_inception_node_E(data_path, "Mixed_7c", 320U, std::make_tuple(384U, 384U, 384U), + std::make_tuple(448U, 384U, 384U, 384U), 192U, true) + .set_name("Mixed_7c/concat"); + + graph << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 8, PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL))).set_name("Logits/AvgPool_1a_8x8/AvgPool") + << ConvolutionLayer(1U, 1U, 1001U, get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Logits_Conv2d_1c_1x1_weights.npy"), + get_weights_accessor(data_path, + "/cnn_data/inceptionv3_model/Logits_Conv2d_1c_1x1_biases.npy"), + PadStrideInfo(1, 1, 0, 0)) + .set_name("Logits/Conv2d_1c_1x1/convolution") + << ReshapeLayer(TensorShape(1001U)).set_name("Predictions/Reshape") + << SoftmaxLayer().set_name("Predictions/Softmax") + << OutputLayer(get_output_accessor()); + + // Finalize graph + GraphConfig config; + config.use_tuner = (target == 2); + graph.finalize(target_hint, config); + } + + void do_run() + { + run_benchmark(graph); + } + +private: + Stream graph{ 0, "InceptionV3" }; + +private: + BranchLayer get_inception_node_A(const std::string &data_path, std::string &¶m_path, + unsigned int a_filt, + std::tuple b_filters, + std::tuple c_filters, + unsigned int d_filt, + bool is_name_different = false) + { + std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_"; + + // This is due to a naming issue in the tf model + std::string conv_id0 = "_0a_"; + std::string conv_id1 = "2d_0b_"; + if(is_name_different) + { + conv_id0 = "_0b_"; + conv_id1 = "_1_0c_"; + } + + SubStream i_a(graph); + i_a << ConvolutionLayer( + 1U, 1U, a_filt, + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu"); + + SubStream i_b(graph); + i_b << ConvolutionLayer( + 1U, 1U, std::get<0>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/Relu") + << ConvolutionLayer( + 5U, 5U, std::get<1>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 2, 2)) + .set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/Relu"); + + SubStream i_c(graph); + i_c << ConvolutionLayer( + 1U, 1U, std::get<0>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<1>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 1, 1)) + .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_3x3/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<2>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 1, 1)) + .set_name(param_path + "/Branch_2/Conv2d_0c_3x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0c_3x3/BatchNorm/batcnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_3x3/Relu"); + + SubStream i_d(graph); + i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true)).set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool") + << ConvolutionLayer( + 1U, 1U, d_filt, + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu"); + + return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + } + + BranchLayer get_inception_node_B(const std::string &data_path, std::string &¶m_path, + unsigned int a_filt, + std::tuple b_filters) + { + std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_"; + SubStream i_a(graph); + i_a << ConvolutionLayer( + 3U, 3U, a_filt, + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(2, 2, 0, 0)) + .set_name(param_path + "/Branch_0/Conv2d_1a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_0/Conv2d_1a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_1a_1x1/Relu"); + + SubStream i_b(graph); + i_b << ConvolutionLayer( + 1U, 1U, std::get<0>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<1>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 1, 1)) + .set_name(param_path + "/Branch_1/Conv2d_0b_3x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0b_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_3x3/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<2>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(2, 2, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d_1a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_1a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_1a_1x1/Relu"); + + SubStream i_c(graph); + i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name(param_path + "/Branch_2/MaxPool_1a_3x3/MaxPool"); + + return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c)); + } + + BranchLayer get_inception_node_C(const std::string &data_path, std::string &¶m_path, + unsigned int a_filt, + std::tuple b_filters, + std::tuple c_filters, + unsigned int d_filt) + { + std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_"; + SubStream i_a(graph); + i_a << ConvolutionLayer( + 1U, 1U, a_filt, + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu"); + + SubStream i_b(graph); + i_b << ConvolutionLayer( + 1U, 1U, std::get<0>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 7U, 1U, std::get<1>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 3, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x7/Relu") + << ConvolutionLayer( + 1U, 7U, std::get<2>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 3)) + .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0c_7x1/Relu"); + + SubStream i_c(graph); + i_c << ConvolutionLayer( + 1U, 1U, std::get<0>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 1U, 7U, std::get<1>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 3)) + .set_name(param_path + "/Branch_2/Conv2d_0b_7x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0b_7x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_7x1/Relu") + << ConvolutionLayer( + 7U, 1U, std::get<2>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 3, 0)) + .set_name(param_path + "/Branch_2/Conv2d_0c_1x7/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0c_1x7/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_1x7/Relu") + << ConvolutionLayer( + 1U, 7U, std::get<3>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 3)) + .set_name(param_path + "/Branch_2/Conv2d_0d_7x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0d_7x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0d_7x1/Relu") + << ConvolutionLayer( + 7U, 1U, std::get<4>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 3, 0)) + .set_name(param_path + "/Branch_2/Conv2d_0e_1x7/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0e_1x7/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0e_1x7/Relu"); + + SubStream i_d(graph); + i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true)).set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool") + << ConvolutionLayer( + 1U, 1U, d_filt, + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu"); + + return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + } + + BranchLayer get_inception_node_D(const std::string &data_path, std::string &¶m_path, + std::tuple a_filters, + std::tuple b_filters) + { + std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_"; + SubStream i_a(graph); + i_a << ConvolutionLayer( + 1U, 1U, std::get<0>(a_filters), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<1>(a_filters), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(2, 2, 0, 0)) + .set_name(param_path + "/Branch_0/Conv2d_1a_3x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_0/Conv2d_1a_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_1a_3x3/Relu"); + + SubStream i_b(graph); + i_b << ConvolutionLayer( + 1U, 1U, std::get<0>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 7U, 1U, std::get<1>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 3, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x7/Relu") + << ConvolutionLayer( + 1U, 7U, std::get<2>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 3)) + .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0c_7x1/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<3>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(2, 2, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d_1a_3x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_1a_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_1a_3x3/Relu"); + + SubStream i_c(graph); + i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name(param_path + "/Branch_2/MaxPool_1a_3x3/MaxPool"); + + return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c)); + } + + BranchLayer get_inception_node_E(const std::string &data_path, std::string &¶m_path, + unsigned int a_filt, + std::tuple b_filters, + std::tuple c_filters, + unsigned int d_filt, + bool is_name_different = false) + { + // This is due to a naming issue in the tf model + std::string conv_id = "_0b_"; + if(is_name_different) + { + conv_id = "_0c_"; + } + + std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_"; + SubStream i_a(graph); + i_a << ConvolutionLayer( + 1U, 1U, a_filt, + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu"); + + SubStream i_b(graph); + i_b << ConvolutionLayer( + 1U, 1U, std::get<0>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu"); + + SubStream i_b1(static_cast(i_b)); + i_b1 << ConvolutionLayer( + 3U, 1U, std::get<1>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 1, 0)) + .set_name(param_path + "/Branch_1/Conv2d_0b_1x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d_0b_1x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x3/Relu"); + + SubStream i_b2(static_cast(i_b)); + i_b2 << ConvolutionLayer( + 1U, 3U, std::get<2>(b_filters), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 1)) + .set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/Relu"); + + // Merge b1 and b2 + i_b << BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_b1), std::move(i_b2)).set_name(param_path + "/Branch_1/concat"); + + SubStream i_c(graph); + i_c << ConvolutionLayer( + 1U, 1U, std::get<0>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu") + << ConvolutionLayer( + 3U, 3U, std::get<1>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 1, 1)) + .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_3x3/Relu"); + + SubStream i_c1(static_cast(i_c)); + i_c1 << ConvolutionLayer( + 3U, 1U, std::get<2>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 1, 0)) + .set_name(param_path + "/Branch_2/Conv2d_0c_1x3/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0c_1x3/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_1x3/Relu"); + + SubStream i_c2(static_cast(i_c)); + i_c2 << ConvolutionLayer( + 1U, 3U, std::get<3>(c_filters), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 1)) + .set_name(param_path + "/Branch_2/Conv2d_0d_3x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_2/Conv2d_0d_3x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0d_3x1/Relu"); + + // Merge i_c1 and i_c2 + i_c << BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_c1), std::move(i_c2)).set_name(param_path + "/Branch_2/concat"); + + SubStream i_d(graph); + i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true)).set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool") + << ConvolutionLayer( + 1U, 1U, d_filt, + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy"), + std::unique_ptr(nullptr), + PadStrideInfo(1, 1, 0, 0)) + .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"), + get_random_accessor(1.f, 1.f), + get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"), + 0.001f) + .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu"); + + return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + } +}; + +/** Main program for Inception V3 + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments ( [optional] Target (0 = NEON, 1 = OpenCL, 2 = OpenCL with Tuner), [optional] Path to the weights folder, [optional] image, [optional] labels, [optional] Fast math for convolution layer (0 = DISABLED, 1 = ENABLED) ) + */ +int main(int argc, char **argv) +{ + InceptionV3Example example; + + example.do_setup(argc, argv); + example.do_run(); + + return 0; +} diff --git a/benchmark/acl/benchmark_mobilenet.cpp b/benchmark/acl/benchmark_mobilenet.cpp new file mode 100644 index 000000000..765606e94 --- /dev/null +++ b/benchmark/acl/benchmark_mobilenet.cpp @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/graph.h" + +#include "Benchmark.h" + +#include + +using namespace arm_compute::graph::frontend; + +inline std::unique_ptr get_input_accessor(void) +{ + return get_accessor(); +} + +inline std::unique_ptr get_random_accessor(float lower, float upper) +{ + return get_accessor(); +} + +inline std::unique_ptr get_weights_accessor(const std::string &path, const std::string &data_file, DataLayout file_layout = DataLayout::NCHW) +{ + return get_accessor(); +} + +inline std::unique_ptr get_output_accessor(void) +{ + return get_accessor(); +} + +/** Example demonstrating how to implement MobileNet's network using the Compute Library's graph API + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments ( [optional] Target (0 = NEON, 1 = OpenCL), [optional] Path to the weights folder, [optional] image, [optional] labels ) + */ +class GraphMobilenetExample +{ +public: + void do_setup(int argc, char **argv) + { + std::string data_path; /* Path to the trainable data */ + std::string image; /* Image data */ + std::string label; /* Label data */ + + // Set target. 0 (NEON), 1 (OpenCL), 2 (OpenCL with Tuner). By default it is NEON + const int target = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0; + Target target_hint = set_target_hint(target); + ConvolutionMethod convolution_hint = ConvolutionMethod::GEMM; + DepthwiseConvolutionMethod depthwise_convolution_hint = DepthwiseConvolutionMethod::OPTIMIZED_3x3; + FastMathHint fast_math_hint = FastMathHint::DISABLED; + + // Set model to execute. 0 (MobileNetV1_1.0_224), 1 (MobileNetV1_0.75_160) + int model_id = (argc > 2) ? std::strtol(argv[2], nullptr, 10) : 0; + ARM_COMPUTE_ERROR_ON_MSG(model_id > 1, "Invalid model ID. Model must be 0 (MobileNetV1_1.0_224) or 1 (MobileNetV1_0.75_160)"); + int layout_id = (argc > 3) ? std::strtol(argv[3], nullptr, 10) : 0; + ARM_COMPUTE_ERROR_ON_MSG(layout_id > 1, "Invalid layout ID. Layout must be 0 (NCHW) or 1 (NHWC)"); + + float depth_scale = (model_id == 0) ? 1.f : 0.75; + unsigned int spatial_size = (model_id == 0) ? 224 : 160; + std::string model_path = (model_id == 0) ? "/cnn_data/mobilenet_v1_1_224_model/" : "/cnn_data/mobilenet_v1_075_160_model/"; + TensorDescriptor input_descriptor_nchw = TensorDescriptor(TensorShape(spatial_size, spatial_size, 3U, 1U), DataType::F32); + TensorDescriptor input_descriptor_nhwc = TensorDescriptor(TensorShape(3U, spatial_size, spatial_size, 1U), DataType::F32).set_layout(DataLayout::NHWC); + TensorDescriptor input_descriptor = (layout_id == 0) ? input_descriptor_nchw : input_descriptor_nhwc; + + // Parse arguments + if(argc < 2) + { + // Print help + std::cout << "Usage: " << argv[0] << " [target] [model] [layout] [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No model ID provided: using MobileNetV1_1.0_224\n\n"; + std::cout << "No data layout provided: using NCHW\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 2) + { + std::cout << "Usage: " << argv[0] << " " << argv[1] << " [model] [layout] [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No model ID provided: using MobileNetV1_1.0_224\n\n"; + std::cout << "No data layout provided: using NCHW\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 3) + { + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " [layout] [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No data layout provided: using NCHW\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 4) + { + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " [path_to_data] [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No data folder provided: using random values\n\n"; + } + else if(argc == 5) + { + data_path = argv[4]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " " << argv[4] << " [image] [labels] [fast_math_hint]\n\n"; + std::cout << "No image provided: using random values\n\n"; + std::cout << "No text file with labels provided: skipping output accessor\n\n"; + } + else if(argc == 6) + { + data_path = argv[4]; + image = argv[5]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " [labels] [fast_math_hint]\n\n"; + std::cout << "No text file with labels provided: skipping output accessor\n\n"; + } + else if(argc == 7) + { + data_path = argv[4]; + image = argv[5]; + label = argv[6]; + std::cout << "Usage: " << argv[0] << " " << argv[1] << " " << argv[2] << " " << argv[3] << " " << argv[4] << " [fast_math_hint]\n\n"; + std::cout << "No fast math info provided: disabling fast math\n\n"; + } + else + { + data_path = argv[4]; + image = argv[5]; + label = argv[6]; + fast_math_hint = (std::strtol(argv[7], nullptr, 1) == 0) ? FastMathHint::DISABLED : FastMathHint::ENABLED; + } + + // Add model path to data path + if(!data_path.empty()) + { + data_path += model_path; + } + + graph << target_hint + << convolution_hint + << depthwise_convolution_hint + << fast_math_hint + << InputLayer(input_descriptor, + get_input_accessor()) + << ConvolutionLayer( + 3U, 3U, 32U * depth_scale, + get_weights_accessor(data_path, "Conv2d_0_weights.npy", DataLayout::NCHW), + std::unique_ptr(nullptr), + PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::FLOOR)) + .set_name("Conv2d_0") + << BatchNormalizationLayer( + get_weights_accessor(data_path, "Conv2d_0_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, "Conv2d_0_BatchNorm_moving_variance.npy"), + get_weights_accessor(data_path, "Conv2d_0_BatchNorm_gamma.npy"), + get_weights_accessor(data_path, "Conv2d_0_BatchNorm_beta.npy"), + 0.001f) + .set_name("Conv2d_0/BatchNorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f)).set_name("Conv2d_0/Relu6"); + graph << get_dwsc_node(data_path, "Conv2d_1", 64 * depth_scale, PadStrideInfo(1, 1, 1, 1), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_2", 128 * depth_scale, PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_3", 128 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_4", 256 * depth_scale, PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_5", 256 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_6", 512 * depth_scale, PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_7", 512 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_8", 512 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_9", 512 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_10", 512 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_11", 512 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_12", 1024 * depth_scale, PadStrideInfo(2, 2, 0, 1, 0, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << get_dwsc_node(data_path, "Conv2d_13", 1024 * depth_scale, PadStrideInfo(1, 1, 1, 1, 1, 1, DimensionRoundingType::CEIL), PadStrideInfo(1, 1, 0, 0)); + graph << PoolingLayer(PoolingLayerInfo(PoolingType::AVG)).set_name("Logits/AvgPool_1a") + << ConvolutionLayer( + 1U, 1U, 1001U, + get_weights_accessor(data_path, "Logits_Conv2d_1c_1x1_weights.npy", DataLayout::NCHW), + get_weights_accessor(data_path, "Logits_Conv2d_1c_1x1_biases.npy"), + PadStrideInfo(1, 1, 0, 0)) + .set_name("Logits/Conv2d_1c_1x1") + << ReshapeLayer(TensorShape(1001U)).set_name("Reshape") + << SoftmaxLayer().set_name("Softmax") + << OutputLayer(get_output_accessor()); + + // Finalize graph + GraphConfig config; + config.use_tuner = (target == 2); + graph.finalize(target_hint, config); + } + void do_run() + { + run_benchmark(graph); + } + +private: + Stream graph{ 0, "MobileNetV1" }; + + BranchLayer get_dwsc_node(const std::string &data_path, std::string &¶m_path, + unsigned int conv_filt, + PadStrideInfo dwc_pad_stride_info, PadStrideInfo conv_pad_stride_info) + { + std::string total_path = param_path + "_"; + SubStream sg(graph); + sg << DepthwiseConvolutionLayer( + 3U, 3U, + get_weights_accessor(data_path, total_path + "depthwise_depthwise_weights.npy", DataLayout::NCHW), + std::unique_ptr(nullptr), + dwc_pad_stride_info) + .set_name(total_path + "depthwise/depthwise") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "depthwise_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "depthwise_BatchNorm_moving_variance.npy"), + get_weights_accessor(data_path, total_path + "depthwise_BatchNorm_gamma.npy"), + get_weights_accessor(data_path, total_path + "depthwise_BatchNorm_beta.npy"), + 0.001f) + .set_name(total_path + "depthwise/BatchNorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f)).set_name(total_path + "depthwise/Relu6") + << ConvolutionLayer( + 1U, 1U, conv_filt, + get_weights_accessor(data_path, total_path + "pointwise_weights.npy", DataLayout::NCHW), + std::unique_ptr(nullptr), + conv_pad_stride_info) + .set_name(total_path + "pointwise/Conv2D") + << BatchNormalizationLayer( + get_weights_accessor(data_path, total_path + "pointwise_BatchNorm_moving_mean.npy"), + get_weights_accessor(data_path, total_path + "pointwise_BatchNorm_moving_variance.npy"), + get_weights_accessor(data_path, total_path + "pointwise_BatchNorm_gamma.npy"), + get_weights_accessor(data_path, total_path + "pointwise_BatchNorm_beta.npy"), + 0.001f) + .set_name(total_path + "pointwise/BatchNorm") + << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f)).set_name(total_path + "pointwise/Relu6"); + + return BranchLayer(std::move(sg)); + } +}; + +/** Main program for MobileNetV1 + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments ( [optional] Target (0 = NEON, 1 = OpenCL, 2 = OpenCL with Tuner), + * [optional] Model ID (0 = MobileNetV1_1.0_224, 1 = MobileNetV1_0.75_160), + * [optional] Path to the weights folder, + * [optional] image, + * [optional] labels, + * [optional] data layout, + * [optional] Fast math for convolution layer (0 = DISABLED, 1 = ENABLED) ) + */ +int main(int argc, char **argv) +{ + GraphMobilenetExample example; + + example.do_setup(argc, argv); + example.do_run(); + + return 0; +} diff --git a/cmake/ApplyCompileFlags.cmake b/cmake/ApplyCompileFlags.cmake new file mode 100644 index 000000000..e2124bb1f --- /dev/null +++ b/cmake/ApplyCompileFlags.cmake @@ -0,0 +1,15 @@ +# add common flags +foreach(FLAG ${FLAGS_COMMON}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") +endforeach() + +# add c flags +foreach(FLAG ${FLAGS_CONLY}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") +endforeach() + +# add cxx flags +foreach(FLAG ${FLAGS_CXXONLY}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") +endforeach() diff --git a/cmake/CfgOptionFlags.cmake b/cmake/CfgOptionFlags.cmake new file mode 100644 index 000000000..1a9d7244e --- /dev/null +++ b/cmake/CfgOptionFlags.cmake @@ -0,0 +1,23 @@ +# +# Configuration flags +# +option(BUILD_ACL "Build ARM Compute Library" OFF) +option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON) +option(BUILD_ACL_STATIC_LIB "Build ARM Comput Static Library" OFF) +option(BUILD_BENCHMARK_ACL "Build ARM Compute Library Benchmarks" OFF) +option(BUILD_NEURUN "Build neurun" OFF) #if implementation is done, it would replace nn runtime. +option(BUILD_LABS "Build lab projects" ON) +option(BUILD_ANDROID_NN_RUNTIME_TEST "Build Android NN Runtime Test" ON) +option(BUILD_DETECTION_APP "Build detection example app" OFF) +option(BUILD_NNAPI_QUICKCHECK "Build NN API Quickcheck tools" OFF) +option(BUILD_TFLITE_BENCHMARK_MODEL "Build tflite benchmark model" OFF) + +if("${TARGET_ARCH}" STREQUAL "armv7l" AND NOT "${TARGET_OS}" STREQUAL "tizen") + set(BUILD_PURE_ARM_COMPUTE ON) +endif() + +# On x86, disable pureacl/new runtine build which depends on arm compute library +if("${TARGET_ARCH}" STREQUAL "x86_64") + set(BUILD_PURE_ARM_COMPUTE OFF) + set(BUILD_NEW_RUNTIME OFF) +endif() diff --git a/cmake/config/config_aarch64-linux.cmake b/cmake/config/config_aarch64-linux.cmake index b13a8b02f..4879c5817 100644 --- a/cmake/config/config_aarch64-linux.cmake +++ b/cmake/config/config_aarch64-linux.cmake @@ -6,13 +6,13 @@ include(CMakeForceCompiler) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR aarch64) -set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc-5) -set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-5) +set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) # where is the target environment set(ROOTFS_ARM64 $ENV{ROOTFS_ARM64}) if(NOT EXISTS "${ROOTFS_ARM64}/lib/aarch64-linux-gnu") - set(ROOTFS_ARM64 "${CMAKE_SOURCE_DIR}/tools/cross/rootfs/arm64") + set(ROOTFS_ARM64 "${CMAKE_CURRENT_LIST_DIR}/../../tools/cross/rootfs/arm64") endif() set(CMAKE_SYSROOT ${ROOTFS_ARM64}) @@ -30,4 +30,3 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/cmake/config/config_aarch64-tizen.cmake b/cmake/config/config_aarch64-tizen.cmake index e76ad219b..422174712 100644 --- a/cmake/config/config_aarch64-tizen.cmake +++ b/cmake/config/config_aarch64-tizen.cmake @@ -32,7 +32,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) add_compile_options(--sysroot=${ROOTFS_ARM64}) diff --git a/cmake/config/config_armv7l-linux.cmake b/cmake/config/config_armv7l-linux.cmake index 01d3df937..e092596a2 100644 --- a/cmake/config/config_armv7l-linux.cmake +++ b/cmake/config/config_armv7l-linux.cmake @@ -12,7 +12,7 @@ set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) # where is the target environment set(ROOTFS_ARM $ENV{ROOTFS_ARM}) if(NOT EXISTS "${ROOTFS_ARM}/lib/arm-linux-gnueabihf") - set(ROOTFS_ARM "${CMAKE_SOURCE_DIR}/tools/cross/rootfs/arm") + set(ROOTFS_ARM "${CMAKE_CURRENT_LIST_DIR}/../../tools/cross/rootfs/arm") endif() set(CMAKE_SYSROOT ${ROOTFS_ARM}) @@ -30,4 +30,3 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/cmake/config/config_armv7l-tizen.cmake b/cmake/config/config_armv7l-tizen.cmake index 3d49492cd..7971d9156 100644 --- a/cmake/config/config_armv7l-tizen.cmake +++ b/cmake/config/config_armv7l-tizen.cmake @@ -32,7 +32,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/cmake/modules/ExternalProjectTools.cmake b/cmake/modules/ExternalProjectTools.cmake new file mode 100644 index 000000000..7dde65f35 --- /dev/null +++ b/cmake/modules/ExternalProjectTools.cmake @@ -0,0 +1,5 @@ +macro(add_extdirectory DIR TAG) + add_subdirectory(${DIR} "${CMAKE_BINARY_DIR}/externals/${TAG}") +endmacro(add_extdirectory) + +set(ExternalProjectTools_FOUND TRUE) diff --git a/cmake/modules/ExternalSourceTools.cmake b/cmake/modules/ExternalSourceTools.cmake new file mode 100644 index 000000000..cb1851413 --- /dev/null +++ b/cmake/modules/ExternalSourceTools.cmake @@ -0,0 +1,49 @@ +function(ExternalSource_Download PREFIX URL) + get_filename_component(FILENAME ${URL} NAME) + + set(CACHE_DIR "${CMAKE_SOURCE_DIR}/externals") + set(OUT_DIR "${CACHE_DIR}/${PREFIX}") + set(TMP_DIR "${CACHE_DIR}/${PREFIX}-tmp") + + set(DOWNLOAD_PATH "${CACHE_DIR}/${PREFIX}-${FILENAME}") + set(STAMP_PATH "${CACHE_DIR}/${PREFIX}.stamp") + + if(NOT EXISTS "${CACHE_DIR}") + file(MAKE_DIRECTORY "${CACHE_DIR}") + endif(NOT EXISTS "${CACHE_DIR}") + + if(NOT EXISTS "${STAMP_PATH}") + file(REMOVE_RECURSE "${OUT_DIR}") + file(REMOVE_RECURSE "${TMP_DIR}") + + file(MAKE_DIRECTORY "${TMP_DIR}") + + message("-- Download ${PREFIX} from ${URL}") + file(DOWNLOAD ${URL} "${DOWNLOAD_PATH}") + message("-- Download ${PREFIX} from ${URL} - done") + + message("-- Extract ${PREFIX}") + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz "${DOWNLOAD_PATH}" + WORKING_DIRECTORY "${TMP_DIR}") + file(REMOVE "${DOWNLOAD_PATH}") + message("-- Extract ${PREFIX} - done") + + message("-- Cleanup ${PREFIX}") + file(GLOB contents "${TMP_DIR}/*") + list(LENGTH contents n) + if(NOT n EQUAL 1 OR NOT IS_DIRECTORY "${contents}") + set(contents "${TMP_DIR}") + endif() + + get_filename_component(contents ${contents} ABSOLUTE) + + file(RENAME ${contents} "${OUT_DIR}") + file(REMOVE_RECURSE "${TMP_DIR}") + file(WRITE "${STAMP_PATH}" "${URL}") + message("-- Cleanup ${PREFIX} - done") + endif() + + set(${PREFIX}_SOURCE_DIR "${OUT_DIR}" PARENT_SCOPE) +endfunction(ExternalSource_Download) + +set(ExternalSourceTools_FOUND TRUE) diff --git a/cmake/modules/OptionTools.cmake b/cmake/modules/OptionTools.cmake new file mode 100644 index 000000000..066d53078 --- /dev/null +++ b/cmake/modules/OptionTools.cmake @@ -0,0 +1,11 @@ +function(envoption PREFIX DEFAULT_VALUE) + set(VALUE ${DEFAULT_VALUE}) + + if(DEFINED ENV{${PREFIX}}) + set(VALUE $ENV{${PREFIX}}) + endif() + + set(${PREFIX} ${VALUE} PARENT_SCOPE) +endfunction(envoption) + +set(OptionTools_FOUND TRUE) diff --git a/cmake/option/identify_platform.cmake b/cmake/option/identify_platform.cmake new file mode 100644 index 000000000..3f62b524f --- /dev/null +++ b/cmake/option/identify_platform.cmake @@ -0,0 +1,48 @@ +# set host platform to build +if(NOT HOST_ARCH OR "${HOST_ARCH}" STREQUAL "") + set(HOST_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR}) +endif() + +# set target platform to run +if(NOT TARGET_ARCH OR "${TARGET_ARCH}" STREQUAL "") + set(TARGET_ARCH "${HOST_ARCH}") +endif() + +if(NOT DEFINED TARGET_OS) + set(TARGET_OS "${HOST_OS}") +endif() + +if("${HOST_ARCH}" STREQUAL "x86_64") + set(HOST_ARCH_BASE ${HOST_ARCH}) +elseif("${HOST_ARCH}" STREQUAL "armv7l") + set(HOST_ARCH_BASE "arm") +elseif("${HOST_ARCH}" STREQUAL "arm64") + set(HOST_ARCH_BASE "arm64") +elseif("${HOST_ARCH}" STREQUAL "aarch64") + set(HOST_ARCH_BASE "aarch64") +else() + message(FATAL_ERROR "'${HOST_ARCH}' architecture is not supported") +endif() + +if("${TARGET_ARCH}" STREQUAL "x86_64") + set(TARGET_ARCH_BASE ${TARGET_ARCH}) +elseif("${TARGET_ARCH}" STREQUAL "armv7l") + set(TARGET_ARCH_BASE "arm") +elseif("${TARGET_ARCH}" STREQUAL "arm64") + set(TARGET_ARCH_BASE "arm64") +elseif("${TARGET_ARCH}" STREQUAL "aarch64") + set(TARGET_ARCH_BASE "aarch64") +else() + message(FATAL_ERROR "'${TARGET_ARCH}' architecture is not supported") +endif() + +# Determine native or cross build +if("${HOST_ARCH}" STREQUAL "${TARGET_ARCH}") + set(BUILD_IS_NATIVE True) +else() + set(BUILD_IS_NATIVE False) +endif() + +# host & target platform name +set(HOST_PLATFORM "${HOST_ARCH}-${HOST_OS}") +set(TARGET_PLATFORM "${TARGET_ARCH}-${TARGET_OS}") diff --git a/cmake/option/option_arm64-android.cmake b/cmake/option/option_arm64-android.cmake index 42e504afe..3ce2c815b 100644 --- a/cmake/option/option_arm64-android.cmake +++ b/cmake/option/option_arm64-android.cmake @@ -2,3 +2,8 @@ include("cmake/option/option_linux.cmake") # On Android, pthread is contained in bionic(libc) set(LIB_PTHREAD "") + +# SIMD for arm64 +set(FLAGS_COMMON ${FLAGS_COMMON} + "-ftree-vectorize" + ) diff --git a/cmake/option/option_armv7l-linux.cmake b/cmake/option/option_armv7l-linux.cmake index d4505ce1b..42988bc9d 100644 --- a/cmake/option/option_armv7l-linux.cmake +++ b/cmake/option/option_armv7l-linux.cmake @@ -19,3 +19,13 @@ set(FLAGS_COMMON ${FLAGS_COMMON} "-funsafe-math-optimizations" "-ftree-vectorize" ) + +# remove warning from arm cl +# https://github.com/ARM-software/ComputeLibrary/issues/330 +set(GCC_VERSION_DISABLE_WARNING 6.0) +if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER GCC_VERSION_DISABLE_WARNING) + message(STATUS "GCC version higher than ${GCC_VERSION_DISABLE_WARNING}") + set(FLAGS_CXXONLY ${FLAGS_CXXONLY} + "-Wno-ignored-attributes" + ) +endif() diff --git a/cmake/option/option_linux.cmake b/cmake/option/option_linux.cmake index ea533ec36..8cae4e9a1 100644 --- a/cmake/option/option_linux.cmake +++ b/cmake/option/option_linux.cmake @@ -7,3 +7,27 @@ set(CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DDEBUG") set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") + +# test-coverage build flag +if("${COVERAGE_BUILD}" STREQUAL "1") + set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE ON) + set(FLAGS_COMMON "${FLAGS_COMMON} -fprofile-arcs -ftest-coverage") + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") +endif() + +# +# linux common variable and settings +# + +# lib pthread as a variable (pthread must be disabled on android) +set(LIB_PTHREAD pthread) + +# nnfw common path +set(NNFW_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) +set(NNFW_EXTERNALS_DIR ${CMAKE_SOURCE_DIR}/externals) + +# External sources to build tflite +# If already downloaded files are in tensorflow/tensorflow/contrib/lite/downloads, +# set TFLITE_DEPEND_DIR to ${NNFW_EXTERNALS_DIR}/tensorflow/tensorflow/contrib/lite/downloads +set(TFLITE_DEPEND_DIR ${NNFW_EXTERNALS_DIR}) diff --git a/cmake/packages/ARMCompute/CMakeLists.txt b/cmake/packages/ARMCompute/CMakeLists.txt new file mode 100644 index 000000000..88a79ef4a --- /dev/null +++ b/cmake/packages/ARMCompute/CMakeLists.txt @@ -0,0 +1,153 @@ +### +### ARM Compute Library +### +set(ACL_BASE ${CMAKE_SOURCE_DIR}/externals/acl) +set(ACL_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/acl_generated) +set(ACL_VERSION_TAG "${ACL_GENERATED}/arm_compute_version.embed") + +# Create 'arm_compute_version.embed' +add_custom_command(OUTPUT ${ACL_VERSION_TAG} + COMMAND mkdir -p "${ACL_GENERATED}" + COMMAND echo '"unknown"' > "${ACL_VERSION_TAG}") + +file(GLOB_RECURSE ACL_UTIL_SRCS "${ACL_BASE}/src/core/utils/*.cpp") + +### ARM Compute Library - Foundation library (such as I/O and logging) +if(BUILD_ACL_STATIC_LIB) + add_library(acl_foundation ${ACL_UTIL_SRCS}) + target_include_directories(acl_foundation PUBLIC "${ACL_BASE}") + target_include_directories(acl_foundation PUBLIC "${ACL_BASE}/include") + target_link_libraries(acl_foundation dl ${LIB_PTHREAD}) +endif(BUILD_ACL_STATIC_LIB) + +### +### ARM Compute Library Common (Core & Runtime) +### +file(GLOB ACL_CORE_COMMON_SRCS "${ACL_BASE}/src/core/*.cpp") +list(APPEND ACL_CORE_COMMON_SRCS ${ACL_VERSION_TAG}) +# Both CL & NEON runtime funtions use these CPP kernels +list(APPEND ACL_CORE_COMMON_SRCS "${ACL_BASE}/src/core/CPP/kernels/CPPCornerCandidatesKernel.cpp") +list(APPEND ACL_CORE_COMMON_SRCS "${ACL_BASE}/src/core/CPP/kernels/CPPDetectionWindowNonMaximaSuppressionKernel.cpp") +list(APPEND ACL_CORE_COMMON_SRCS "${ACL_BASE}/src/core/CPP/kernels/CPPSortEuclideanDistanceKernel.cpp") + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_core_common ${ACL_CORE_COMMON_SRCS}) + target_include_directories(acl_core_common PUBLIC "${ACL_GENERATED}") + target_link_libraries(acl_core_common acl_foundation) +endif(BUILD_ACL_STATIC_LIB) + +file(GLOB ACL_RUNTIME_COMMON_SRCS "${ACL_BASE}/src/runtime/*.cpp") +# src/runtime/Scheduler.cpp depends on this scheduler +list(APPEND ACL_RUNTIME_COMMON_SRCS "${ACL_BASE}/src/runtime/CPP/SingleThreadScheduler.cpp") + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_core_opencl ${ACL_CORE_OPENCL_SRCS}) + target_link_libraries(acl_core_opencl acl_core_common OpenCL) +endif(BUILD_ACL_STATIC_LIB) + +### +### ARM Compute Library Open CL (Core & Runtime & Example) +### +file(GLOB ACL_CORE_OPENCL_SRCS "${ACL_BASE}/src/core/CL/*.cpp") +file(GLOB ACL_CORE_OPENCL_KERNEL_SRCS "${ACL_BASE}/src/core/CL/kernels/*.cpp") +list(APPEND ACL_CORE_OPENCL_SRCS ${ACL_CORE_OPENCL_KERNEL_SRCS}) + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_runtime_opencl ${ACL_RUNTIME_OPENCL_SRCS}) + target_link_libraries(acl_runtime_opencl acl_runtime_common acl_core_opencl) +endif(BUILD_ACL_STATIC_LIB) + +file(GLOB_RECURSE ACL_RUNTIME_OPENCL_SRCS "${ACL_BASE}/src/runtime/CL/*.cpp") + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_core_neon ${ACL_CORE_NEON_SRCS}) + target_include_directories(acl_core_neon PUBLIC "${ACL_BASE}/arm_compute/core/NEON/kernels/assembly") + target_link_libraries(acl_core_neon acl_core_common) +endif(BUILD_ACL_STATIC_LIB) + +### +### ARM Compute Library NEON (Core & Runtime & Example) +### +file(GLOB ACL_CORE_NEON_SRCS "${ACL_BASE}/src/core/NEON/kernels/*.cpp" "${ACL_BASE}/src/core/NEON/kernels/arm32/*.cpp") +file(GLOB_RECURSE ACL_CORE_NEON_CONVOLUTION_SRCS "${ACL_BASE}/src/core/NEON/kernels/convolution/winograd/*.cpp" "${ACL_BASE}/src/core/NEON/kernels/convolution/depthwise/*.cpp") +list(APPEND ACL_CORE_NEON_SRCS ${ACL_CORE_NEON_CONVOLUTION_SRCS}) +list(APPEND ACL_CORE_NEON_SRCS "${ACL_BASE}/src/core/CPP/ICPPSimpleKernel.cpp") +list(APPEND ACL_CORE_NEON_SRCS "${ACL_BASE}/src/core/CPP/kernels/CPPPermuteKernel.cpp") + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_runtime_neon ${ACL_RUNTIME_NEON_SRCS}) + target_link_libraries(acl_runtime_neon acl_runtime_common acl_core_neon) +endif(BUILD_ACL_STATIC_LIB) + +file(GLOB_RECURSE ACL_RUNTIME_NEON_SRCS "${ACL_BASE}/src/runtime/NEON/*.cpp") +# runtime/NEON/functions/NEWinogradLayer.h use this implementation +list(APPEND ACL_RUNTIME_NEON_SRCS "${ACL_BASE}/src/runtime/CPP/ICPPSimpleFunction.cpp") +list(APPEND ACL_RUNTIME_NEON_SRCS "${ACL_BASE}/src/runtime/CPP/functions/CPPPermute.cpp") + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_graph ${ACL_GRAPH_SRCS}) + target_link_libraries(acl_graph acl_runtime_opencl acl_runtime_neon) +endif(BUILD_ACL_STATIC_LIB) + +# TODO Support Open MP core(?) +# TODO Support Open GLES core(?) + +### +### ARM Compute Library (Graph & Example) +### +file(GLOB ACL_GRAPH_COMMON_SRCS "${ACL_BASE}/src/graph/*.cpp" "${ACL_BASE}/src/graph/nodes/*.cpp") +file(GLOB ACL_GRAPH_OPENCL_SRCS "${ACL_BASE}/src/graph/CL/*.cpp" "${ACL_BASE}/src/graph/operations/CL*.cpp") +file(GLOB ACL_GRAPH_NEON_SRCS "${ACL_BASE}/src/graph/NE/*.cpp" "${ACL_BASE}/src/graph/operations/NE*.cpp") + +list(APPEND ACL_GRAPH_SRCS ${ACL_GRAPH_COMMON_SRCS}) +list(APPEND ACL_GRAPH_SRCS ${ACL_GRAPH_OPENCL_SRCS}) +list(APPEND ACL_GRAPH_SRCS ${ACL_GRAPH_NEON_SRCS}) + +if(BUILD_ACL_STATIC_LIB) + add_library(acl_graph ${ACL_GRAPH_SRCS}) + target_link_libraries(acl_graph acl_runtime_opencl acl_runtime_neon) +endif(BUILD_ACL_STATIC_LIB) + +### +### ARM Compute Shared Libraries +### +list(APPEND ACL_CORE_SRCS ${ACL_UTIL_SRCS}) +list(APPEND ACL_CORE_SRCS ${ACL_CORE_COMMON_SRCS}) +list(APPEND ACL_CORE_SRCS ${ACL_CORE_OPENCL_SRCS}) +list(APPEND ACL_CORE_SRCS ${ACL_CORE_NEON_SRCS}) + +add_library(arm_compute_core SHARED ${ACL_CORE_SRCS}) +target_include_directories(arm_compute_core PUBLIC "${ACL_GENERATED}") +target_include_directories(arm_compute_core PUBLIC "${ACL_BASE}") +target_include_directories(arm_compute_core PUBLIC "${ACL_BASE}/include") +target_include_directories(arm_compute_core PUBLIC "${ACL_BASE}/arm_compute/core/NEON/kernels/assembly") +target_link_libraries(arm_compute_core dl ${LIB_PTHREAD}) +install(TARGETS arm_compute_core DESTINATION lib) + +list(APPEND ACL_RUNTIME_SRCS ${ACL_RUNTIME_COMMON_SRCS}) +list(APPEND ACL_RUNTIME_SRCS ${ACL_RUNTIME_OPENCL_SRCS}) +list(APPEND ACL_RUNTIME_SRCS ${ACL_RUNTIME_NEON_SRCS}) + +add_library(arm_compute SHARED ${ACL_RUNTIME_SRCS}) +target_link_libraries(arm_compute arm_compute_core OpenCL) +install(TARGETS arm_compute DESTINATION lib) + +add_library(arm_compute_graph SHARED ${ACL_GRAPH_SRCS}) +target_link_libraries(arm_compute_graph arm_compute) +install(TARGETS arm_compute_graph DESTINATION lib) + +add_library(arm_compute_test SHARED "${ACL_BASE}/utils/Utils.cpp") +target_link_libraries(arm_compute_test arm_compute) + +add_library(arm_compute_graph_test SHARED "${ACL_BASE}/utils/GraphUtils.cpp") +target_link_libraries(arm_compute_graph_test arm_compute_graph arm_compute_test) + +add_executable(cl_convolution "${ACL_BASE}/examples/cl_convolution.cpp") +target_compile_definitions(cl_convolution PRIVATE ARM_COMPUTE_CL) +target_link_libraries(cl_convolution arm_compute_test) + +add_executable(neon_convolution "${ACL_BASE}/examples/neon_convolution.cpp") +target_link_libraries(neon_convolution arm_compute_test) + +add_executable(graph_lenet "${ACL_BASE}/examples/graph_lenet.cpp") +target_link_libraries(graph_lenet arm_compute_graph_test) diff --git a/cmake/packages/ARMComputeConfig.cmake b/cmake/packages/ARMComputeConfig.cmake new file mode 100644 index 000000000..7d3753094 --- /dev/null +++ b/cmake/packages/ARMComputeConfig.cmake @@ -0,0 +1,88 @@ +function(_ARMCompute_Build) + if(TARGET arm_compute_core) + set(ARMCompute_FOUND TRUE PARENT_SCOPE) + return() + endif(TARGET arm_compute_core) + + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ARMCompute" "${CMAKE_BINARY_DIR}/externals/ARMCompute") + set(ARMCompute_FOUND TRUE PARENT_SCOPE) +endfunction(_ARMCompute_Build) + +function(_ARMCompute_Import) + include(FindPackageHandleStandardArgs) + + list(APPEND ARMCompute_INCLUDE_SEARCH_PATHS /usr/include) + + list(APPEND ARMCompute_LIB_SEARCH_PATHS /usr/lib) + + find_path(INCLUDE_DIR NAMES arm_compute/core/ITensor.h PATHS ${ARMCompute_INCLUDE_SEARCH_PATHS}) + + find_library(CORE_LIBRARY NAMES arm_compute_core PATHS ${ARMCompute_LIB_SEARCH_PATHS}) + find_library(RUNTIME_LIBRARY NAMES arm_compute PATHS ${ARMCompute_LIB_SEARCH_PATHS}) + find_library(GRAPH_LIBRARY NAMES arm_compute_graph PATHS ${ARMCompute_LIB_SEARCH_PATHS}) + + if(NOT INCLUDE_DIR) + set(INCLUDE_DIR ${CMAKE_SOURCE_DIR}/externals/acl ${CMAKE_SOURCE_DIR}/externals/acl/include) + endif(NOT INCLUDE_DIR) + + # NOTE '${CMAKE_INSTALL_PREFIX}/lib' should be searched as CI server places + # pre-built ARM compute libraries on this directory + if(NOT CORE_LIBRARY AND EXISTS ${CMAKE_INSTALL_PREFIX}/lib/libarm_compute_core.so) + set(CORE_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libarm_compute_core.so) + endif() + + if(NOT CORE_LIBRARY) + return() + set(ARMCompute_FOUND FALSE PARENT_SCOPE) + endif() + + if(NOT RUNTIME_LIBRARY AND EXISTS ${CMAKE_INSTALL_PREFIX}/lib/libarm_compute.so) + set(RUNTIME_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libarm_compute.so) + endif() + + if(NOT RUNTIME_LIBRARY) + return() + set(ARMCompute_FOUND FALSE PARENT_SCOPE) + endif() + + if(NOT GRAPH_LIBRARY AND EXISTS ${CMAKE_INSTALL_PREFIX}/lib/libarm_compute_graph.so) + set(GRAPH_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libarm_compute_graph.so) + endif() + + if(NOT GRAPH_LIBRARY) + return() + set(ARMCompute_FOUND FALSE PARENT_SCOPE) + endif() + + if(NOT TARGET arm_compute_core) + add_library(arm_compute_core INTERFACE) + target_include_directories(arm_compute_core INTERFACE ${INCLUDE_DIR}) + target_link_libraries(arm_compute_core INTERFACE dl ${LIB_PTHREAD}) + target_link_libraries(arm_compute_core INTERFACE ${CORE_LIBRARY}) + if (${TARGET_OS} STREQUAL "tizen") + target_link_libraries(arm_compute_core INTERFACE OpenCL) + endif() + endif(NOT TARGET arm_compute_core) + + if(NOT TARGET arm_compute) + add_library(arm_compute INTERFACE) + target_include_directories(arm_compute INTERFACE ${INCLUDE_DIR}) + target_link_libraries(arm_compute INTERFACE ${RUNTIME_LIBRARY}) + target_link_libraries(arm_compute INTERFACE arm_compute_core) + endif(NOT TARGET arm_compute) + + if(NOT TARGET arm_compute_graph) + add_library(arm_compute_graph INTERFACE) + target_include_directories(arm_compute_graph INTERFACE ${INCLUDE_DIR}) + target_link_libraries(arm_compute_graph INTERFACE ${GRAPH_LIBRARY}) + target_link_libraries(arm_compute_graph INTERFACE arm_compute) + endif(NOT TARGET arm_compute_graph) + + set(ARMCompute_FOUND TRUE PARENT_SCOPE) +endfunction(_ARMCompute_Import) + +if(BUILD_ACL) + _ARMCompute_Build() +else(BUILD_ACL) + _ARMCompute_Import() +endif(BUILD_ACL) diff --git a/cmake/packages/EigenConfig.cmake b/cmake/packages/EigenConfig.cmake new file mode 100644 index 000000000..0feb0890a --- /dev/null +++ b/cmake/packages/EigenConfig.cmake @@ -0,0 +1,17 @@ +function(_Eigen_import) + nnfw_find_package(EigenSource QUIET) + + if(NOT EigenSource_FOUND) + set(Eigen_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT EigenSource_FOUND) + + if(NOT TARGET eigen) + add_library(eigen INTERFACE) + target_include_directories(eigen INTERFACE "${EigenSource_DIR}") + endif(NOT TARGET eigen) + + set(Eigen_FOUND TRUE PARENT_SCOPE) +endfunction(_Eigen_import) + +_Eigen_import() diff --git a/cmake/packages/EigenSourceConfig.cmake b/cmake/packages/EigenSourceConfig.cmake new file mode 100644 index 000000000..0b4360953 --- /dev/null +++ b/cmake/packages/EigenSourceConfig.cmake @@ -0,0 +1,19 @@ +function(_EigenSource_import) + if(NOT DOWNLOAD_EIGEN) + set(EigenSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_EIGEN) + + nnfw_include(ExternalSourceTools) + nnfw_include(OptionTools) + + # NOTE The following URL comes from TensorFlow 1.9 + envoption(EIGEN_URL https://bitbucket.org/eigen/eigen/get/fd6845384b86.zip) + + ExternalSource_Download("eigen" ${EIGEN_URL}) + + set(EigenSource_DIR ${eigen_SOURCE_DIR} PARENT_SCOPE) + set(EigenSource_FOUND TRUE PARENT_SCOPE) +endfunction(_EigenSource_import) + +_EigenSource_import() diff --git a/cmake/packages/FarmhashSourceConfig.cmake b/cmake/packages/FarmhashSourceConfig.cmake new file mode 100644 index 000000000..fe22c03a3 --- /dev/null +++ b/cmake/packages/FarmhashSourceConfig.cmake @@ -0,0 +1,19 @@ +function(_FarmhashSource_import) + if(NOT DOWNLOAD_FARMHASH) + set(FarmhashSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_FARMHASH) + + nnfw_include(ExternalSourceTools) + nnfw_include(OptionTools) + + # NOTE TensorFlow 1.9 downloads farmhash from the following URL + envoption(FARMHASH_URL https://github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.zip) + + ExternalSource_Download("farmhash" ${FARMHASH_URL}) + + set(FarmhashSource_DIR ${farmhash_SOURCE_DIR} PARENT_SCOPE) + set(FarmhashSource_FOUND TRUE PARENT_SCOPE) +endfunction(_FarmhashSource_import) + +_FarmhashSource_import() diff --git a/cmake/packages/FlatBuffersConfig.cmake b/cmake/packages/FlatBuffersConfig.cmake new file mode 100644 index 000000000..fab08fe39 --- /dev/null +++ b/cmake/packages/FlatBuffersConfig.cmake @@ -0,0 +1,73 @@ +function(_FlatBuffers_import) + nnfw_find_package(FlatBuffersSource QUIET) + + if(NOT FlatBuffersSource_FOUND) + set(FlatBuffers_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT FlatBuffersSource_FOUND) + + # From FlatBuffers's CMakeLists.txt + list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/code_generators.cpp") + list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/idl_parser.cpp") + list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_text.cpp") + list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/reflection.cpp") + list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/util.cpp") + + # From FlatBuffers's CMakeLists.txt + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_cpp.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_general.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_go.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_js.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_php.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_python.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_fbs.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_grpc.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_json_schema.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/flatc.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/src/flatc_main.cpp") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/grpc/src/compiler/cpp_generator.cc") + list(APPEND FlatBuffers_Compiler_SRCS "${FlatBuffersSource_DIR}/grpc/src/compiler/go_generator.cc") + + if(NOT TARGET flatbuffers) + add_library(flatbuffers ${FlatBuffers_Library_SRCS}) + target_include_directories(flatbuffers PUBLIC "${FlatBuffersSource_DIR}/include") + endif(NOT TARGET flatbuffers) + + if(NOT TARGET flatc) + add_executable(flatc ${FlatBuffers_Compiler_SRCS}) + target_include_directories(flatc PRIVATE "${FlatBuffersSource_DIR}/grpc") + target_link_libraries(flatc flatbuffers) + endif(NOT TARGET flatc) + + set(FlatBuffers_FOUND TRUE PARENT_SCOPE) +endfunction(_FlatBuffers_import) + +_FlatBuffers_import() + +if(FlatBuffers_FOUND) + function(FlatBuffers_Generate PREFIX OUTPUT_DIR SCHEMA_DIR) + get_filename_component(abs_output_dir ${OUTPUT_DIR} ABSOLUTE) + get_filename_component(abs_schema_dir ${SCHEMA_DIR} ABSOLUTE) + + foreach(schema ${ARGN}) + get_filename_component(schema_fn "${schema}" NAME) + get_filename_component(dir "${schema}" DIRECTORY) + + get_filename_component(schema_fn_we "${schema_fn}" NAME_WE) + + list(APPEND SCHEMA_FILES "${abs_schema_dir}/${schema}") + list(APPEND OUTPUT_FILES "${abs_output_dir}/${schema_fn_we}_generated.h") + endforeach() + + add_custom_command(OUTPUT ${OUTPUT_FILES} + COMMAND ${CMAKE_COMMAND} -E make_directory "${abs_output_dir}" + COMMAND "$" -c --no-includes + --no-union-value-namespacing + --gen-object-api -o "${abs_output_dir}" + ${SCHEMA_FILES} + DEPENDS flatc) + + set(${PREFIX}_SOURCES ${OUTPUT_FILES} PARENT_SCOPE) + set(${PREFIX}_INCLUDE_DIRS ${abs_output_dir} PARENT_SCOPE) + endfunction(FlatBuffers_Generate) +endif(FlatBuffers_FOUND) diff --git a/cmake/packages/FlatBuffersSourceConfig.cmake b/cmake/packages/FlatBuffersSourceConfig.cmake new file mode 100644 index 000000000..e136a266c --- /dev/null +++ b/cmake/packages/FlatBuffersSourceConfig.cmake @@ -0,0 +1,19 @@ +function(_FlatBuffersSource_import) + if(NOT DOWNLOAD_FLATBUFFERS) + set(FlatBuffersSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_FLATBUFFERS) + + nnfw_include(ExternalSourceTools) + nnfw_include(OptionTools) + + # NOTE TensorFlow 1.9 downloads FlatBuffers from the following URL + envoption(FLATBUFFERS_URL https://github.com/google/flatbuffers/archive/971a68110e4fc1bace10fcb6deeb189e7e1a34ce.zip) + + ExternalSource_Download("flatbuffers" ${FLATBUFFERS_URL}) + + set(FlatBuffersSource_DIR ${flatbuffers_SOURCE_DIR} PARENT_SCOPE) + set(FlatBuffersSource_FOUND TRUE PARENT_SCOPE) +endfunction(_FlatBuffersSource_import) + +_FlatBuffersSource_import() diff --git a/cmake/packages/GEMMLowpSourceConfig.cmake b/cmake/packages/GEMMLowpSourceConfig.cmake new file mode 100644 index 000000000..b8a2c3ed4 --- /dev/null +++ b/cmake/packages/GEMMLowpSourceConfig.cmake @@ -0,0 +1,19 @@ +function(_GEMMLowpSource_import) + if(NOT DOWNLOAD_GEMMLOWP) + set(GEMMLowpSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_GEMMLOWP) + + nnfw_include(ExternalSourceTools) + nnfw_include(OptionTools) + + # NOTE TensorFlow 1.9 uses the following URL + envoption(GEMMLOWP_URL https://github.com/google/gemmlowp/archive/38ebac7b059e84692f53e5938f97a9943c120d98.zip) + + ExternalSource_Download("gemmlowp" ${GEMMLOWP_URL}) + + set(GEMMLowpSource_DIR ${gemmlowp_SOURCE_DIR} PARENT_SCOPE) + set(GEMMLowpSource_FOUND TRUE PARENT_SCOPE) +endfunction(_GEMMLowpSource_import) + +_GEMMLowpSource_import() diff --git a/cmake/packages/GTestConfig.cmake b/cmake/packages/GTestConfig.cmake new file mode 100644 index 000000000..a96a64ac2 --- /dev/null +++ b/cmake/packages/GTestConfig.cmake @@ -0,0 +1,49 @@ +if(OBS_BUILD) + enable_testing() + find_package(GTest REQUIRED) + include_directories(${GTEST_INCLUDE_DIR}) + set(GTest_FOUND TRUE) + return() +endif(OBS_BUILD) + +if(${BUILD_GTEST}) + nnfw_include(ExternalSourceTools) + nnfw_include(ExternalProjectTools) + nnfw_include(OptionTools) + + envoption(GTEST_URL https://github.com/google/googletest/archive/release-1.8.0.zip) + + ExternalSource_Download("gtest" ${GTEST_URL}) + + # gtest_SOURCE_DIR is used in gtest subdirectorty's cmake + set(sourcedir_gtest ${gtest_SOURCE_DIR}) + unset(gtest_SOURCE_DIR) + + if(NOT TARGET gtest_main) + add_extdirectory(${sourcedir_gtest} gtest) + endif(NOT TARGET gtest_main) + + set(GTest_FOUND TRUE) + return() +endif(${BUILD_GTEST}) + +### Find and use pre-installed Google Test +find_package(GTest) +find_package(Threads) + +if(${GTEST_FOUND} AND TARGET Threads::Threads) + if(NOT TARGET gtest) + add_library(gtest INTERFACE) + target_include_directories(gtest INTERFACE ${GTEST_INCLUDE_DIRS}) + target_link_libraries(gtest INTERFACE ${GTEST_LIBRARIES} Threads::Threads) + endif(NOT TARGET gtest) + + if(NOT TARGET gtest_main) + add_library(gtest_main INTERFACE) + target_include_directories(gtest_main INTERFACE ${GTEST_INCLUDE_DIRS}) + target_link_libraries(gtest_main INTERFACE gtest) + target_link_libraries(gtest_main INTERFACE ${GTEST_MAIN_LIBRARIES}) + endif(NOT TARGET gtest_main) + + set(GTest_FOUND TRUE) +endif(${GTEST_FOUND} AND TARGET Threads::Threads) diff --git a/cmake/packages/NEON2SSESourceConfig.cmake b/cmake/packages/NEON2SSESourceConfig.cmake new file mode 100644 index 000000000..9b703ec16 --- /dev/null +++ b/cmake/packages/NEON2SSESourceConfig.cmake @@ -0,0 +1,19 @@ +function(_NEON2SSESource_import) + if(NOT DOWNLOAD_NEON2SSE) + set(NEON2SSESource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_NEON2SSE) + + nnfw_include(ExternalSourceTools) + nnfw_include(OptionTools) + + # NOTE TensorFlow 1.9 downloads NEON2SSE from the following URL + envoption(NEON2SSE_URL https://github.com/intel/ARM_NEON_2_x86_SSE/archive/0f77d9d182265259b135dad949230ecbf1a2633d.zip) + + ExternalSource_Download("neon_2_sse" ${NEON2SSE_URL}) + + set(NEON2SSESource_DIR ${neon_2_sse_SOURCE_DIR} PARENT_SCOPE) + set(NEON2SSESource_FOUND TRUE PARENT_SCOPE) +endfunction(_NEON2SSESource_import) + +_NEON2SSESource_import() diff --git a/cmake/packages/TensorFlowSourceConfig.cmake b/cmake/packages/TensorFlowSourceConfig.cmake new file mode 100644 index 000000000..b9c34b0a7 --- /dev/null +++ b/cmake/packages/TensorFlowSourceConfig.cmake @@ -0,0 +1,18 @@ +function(_TensorFlowSource_import) + if(NOT DOWNLOAD_TENSORFLOW) + set(TensorFlowSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_TENSORFLOW) + + nnfw_include(ExternalSourceTools) + nnfw_include(OptionTools) + + envoption(TENSORFLOW_URL https://github.com/tensorflow/tensorflow/archive/v1.9.0.zip) + + ExternalSource_Download("tensorflow" ${TENSORFLOW_URL}) + + set(TensorFlowSource_DIR ${tensorflow_SOURCE_DIR} PARENT_SCOPE) + set(TensorFlowSource_FOUND TRUE PARENT_SCOPE) +endfunction(_TensorFlowSource_import) + +_TensorFlowSource_import() diff --git a/cmake/packages/TensorflowConfig.cmake b/cmake/packages/TensorflowConfig.cmake new file mode 100644 index 000000000..ab4e2715e --- /dev/null +++ b/cmake/packages/TensorflowConfig.cmake @@ -0,0 +1,44 @@ +function(_Tensorflow_Import) + if(NOT DEFINED TENSORFLOW_DIR) + set(TENSORFLOW_DIR ${CMAKE_SOURCE_DIR}/externals/tensorflow) + endif(NOT DEFINED TENSORFLOW_DIR) + + if(NOT DEFINED NSYNC_ARCH) + set(NSYNC_ARCH "default") + endif(NOT DEFINED NSYNC_ARCH) + + set(TENSROFLOW_MAKEFILE_DIR "${TENSORFLOW_DIR}/tensorflow/contrib/makefile") + set(TENSORFLOW_GEN_DIR "${TENSROFLOW_MAKEFILE_DIR}/gen") + set(TENSORFLOW_DOWNLOADS_DIR "${TENSROFLOW_MAKEFILE_DIR}/downloads") + + if(NOT EXISTS "${TENSORFLOW_GEN_DIR}/lib/libtensorflow-core.a") + set(Tensorflow_FOUND FALSE PARENT_SCOPE) + return() + endif() + + if(NOT EXISTS "${TENSORFLOW_DOWNLOADS_DIR}/nsync/builds/${NSYNC_ARCH}.linux.c++11/libnsync.a") + set(Tensorflow_FOUND FALSE PARENT_SCOPE) + return() + endif() + + if(NOT TARGET tensorflow-core) + add_library(tensorflow-core INTERFACE) + + target_include_directories(tensorflow-core INTERFACE "${TENSORFLOW_DIR}") + target_include_directories(tensorflow-core INTERFACE "${TENSORFLOW_GEN_DIR}/proto") + target_include_directories(tensorflow-core INTERFACE "${TENSORFLOW_GEN_DIR}/protobuf/include") + target_include_directories(tensorflow-core INTERFACE "${TENSORFLOW_DOWNLOADS_DIR}/eigen") + target_include_directories(tensorflow-core INTERFACE "${TENSORFLOW_DOWNLOADS_DIR}/nsync/public") + + target_link_libraries(tensorflow-core INTERFACE -Wl,--whole-archive "${TENSORFLOW_GEN_DIR}/lib/libtensorflow-core.a" -Wl,--no-whole-archive) + target_link_libraries(tensorflow-core INTERFACE "${TENSORFLOW_GEN_DIR}/protobuf/lib/libprotobuf.a") + target_link_libraries(tensorflow-core INTERFACE "${TENSORFLOW_DOWNLOADS_DIR}/nsync/builds/${NSYNC_ARCH}.linux.c++11/libnsync.a") + target_link_libraries(tensorflow-core INTERFACE ${LIB_PTHREAD} dl) + + message(STATUS "Found Tensorflow (lib: ${TENSORFLOW_GEN_DIR}/lib/libtensorflow-core.a") + endif() + + set(Tensorflow_FOUND TRUE PARENT_SCOPE) +endfunction(_Tensorflow_Import) + +_Tensorflow_Import() diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt new file mode 100644 index 000000000..78417eacb --- /dev/null +++ b/contrib/CMakeLists.txt @@ -0,0 +1,6 @@ +file(GLOB CONTRIB_CMAKE_FILES "*/CMakeLists.txt") + +foreach(CONTRIB_CMAKE_FILE ${CONTRIB_CMAKE_FILES}) + get_filename_component(CONTRIB_BASE ${CONTRIB_CMAKE_FILE} DIRECTORY) + add_subdirectory(${CONTRIB_BASE}) +endforeach(CONTRIB_CMAKE_FILE ${CONTRIB_CMAKE_FILES}) diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 000000000..2f8b709eb --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,10 @@ +# nnfw contrib + +The `contrib` directory is basically a contribution channel where contributors can create a project +and start the code development. The projects in the `contrib` directory may not be directly related +to `nnfw` but should have its own purpose that could augment the nnfw project. + +If you are interested in proposing a new project, please create a pull request (PR) with a new +project directory under `contrib` including the description of proposing project. The PR will be +reviewed by reviewers in `nnfw`, and the acceptance of new project will be determined based on the +PR reviews. diff --git a/contrib/TFLiteSharp/README.md b/contrib/TFLiteSharp/README.md new file mode 100644 index 000000000..8e43be618 --- /dev/null +++ b/contrib/TFLiteSharp/README.md @@ -0,0 +1,92 @@ +# C-Sharp TFLite API Directory structure +``` +. +├── packaging +│   ├── TFLiteSharp.manifest +│   └── TFLiteSharp.spec +├── README.md +├── TFLiteNative +│   ├── CMakeLists.txt +│   ├── include +│   │   ├── tflite_log.h +│   │   └── tflite_nativewrapper.h +│   ├── src +│   │   └── tflite_nativewrapper.cpp +│   └── tflite-native.pc.in +├── TFLiteSharp +│   ├── TFLiteSharp +│   │   ├── src +│   │   │   └── Interpreter.cs +│   │   └── TFLiteSharp.csproj +│   └── TFLiteSharp.sln +└── TFLiteSharpTest + ├── TFLiteSharpTest + │   ├── Program.cs + │   └── TFLiteSharpTest.csproj + └── TFLiteSharpTest.sln +``` + +# Build C-Sharp TFLite +gbs should be used to build TFLiteSharp package. nnfw is also built by gbs. As in most cases when building nnfw we won't intend to build TFLiteSharp hence we have separated its build process, so in order to build TFLiteSharp below command is needed: +``` +nnfw$ gbs build --packaging-dir=contrib/TFLiteSharp/packaging/ --spec=TFLiteSharp.spec -A armv7l +``` +This will first build the TFLiteNative package containing native c++ bindings between c# api and tflite api +and then it will build TFLiteSharp(c# api package). + +Please use gbs.conf file corresponding to tizen image version. In most cases gbs.conf file should be same as the one which is used to build nnfw. +# C-Sharp TFLite API list + +## Interpreter Class + +### Constructor + +The `Interpreter.cs` class drives model inference with TensorFlow Lite. + +#### Initializing an `Interpreter` With a Model File + +The `Interpreter` can be initialized with a model file using the constructor: + +```c# +public Interpreter(string modelFile); +``` + +Number of threads available to the interpereter can be set by using the following function: +```c# +public void SetNumThreads(int num_threads) +``` + +### Running a model + +If a model takes only one input and returns only one output, the following will trigger an inference run: + +```c# +interpreter.Run(input, output); +``` + +For models with multiple inputs, or multiple outputs, use: + +```c# +interpreter.RunForMultipleInputsOutputs(inputs, map_of_indices_to_outputs); +``` + +The C# api also provides functions for getting the model's input and output indices given the name of tensors as input: + +```c# +public int GetInputIndex(String tensorName) +public int GetOutputIndex(String tensorName) +``` + +Developer can also enable or disable the use of NN API based on hardware capabilites: +```c# +public void SetUseNNAPI(boolean useNNAPI) +``` + +### Releasing Resources After Use + +An `Interpreter` owns resources. To avoid memory leak, the resources must be +released after use by: + +```c# +interpreter.Dispose(); +``` diff --git a/contrib/TFLiteSharp/TFLiteNative/CMakeLists.txt b/contrib/TFLiteSharp/TFLiteNative/CMakeLists.txt new file mode 100644 index 000000000..8b58aac9c --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteNative/CMakeLists.txt @@ -0,0 +1,67 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +SET(fw_name "tflite-native") + +PROJECT(${fw_name}) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(LIB ${LIB_PATH}) +SET(LIBDIR ${PREFIX}/${LIB_PATH}) + +SET(INC_DIR include) +INCLUDE_DIRECTORIES(${INC_DIR}) + +INCLUDE(FindPkgConfig) + +SET(COMMON_DEPS "tensorflow-lite") +SET(PC_DEPS "capi-base-common") + +IF (TIZEN) + MESSAGE("Building for Tizen") + SET(TIZEN_DEPS "dlog") + PKG_CHECK_MODULES(${fw_name} REQUIRED ${COMMON_DEPS} ${TIZEN_DEPS}) + ADD_DEFINITIONS("-D__TIZEN__") +ELSE () + MESSAGE("Building for Linux") + PKG_CHECK_MODULES(${fw_name} REQUIRED ${COMMON_DEPS}) +ENDIF () + +FOREACH(flag ${${fw_name}_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") + +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}") + +aux_source_directory(src SOURCES) +ADD_LIBRARY(${fw_name} SHARED ${SOURCES}) + +TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS}) + +SET_TARGET_PROPERTIES(${fw_name} + PROPERTIES + VERSION ${FULLVER} + SOVERSION ${MAJORVER} + CLEAN_DIRECT_OUTPUT 1 +) + +INSTALL(TARGETS ${fw_name} DESTINATION ${LIB}) +INSTALL( + DIRECTORY ${INC_DIR}/ DESTINATION include/ + FILES_MATCHING + PATTERN "${INC_DIR}/*.h" + ) + +SET(PC_NAME ${fw_name}) +SET(PC_REQUIRED ${pc_dependents}) +SET(PC_LDFLAGS -l${fw_name}) + +CONFIGURE_FILE( + ${fw_name}.pc.in + ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc + @ONLY +) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB}/pkgconfig) diff --git a/contrib/TFLiteSharp/TFLiteNative/include/tflite_log.h b/contrib/TFLiteSharp/TFLiteNative/include/tflite_log.h new file mode 100644 index 000000000..cf51219fd --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteNative/include/tflite_log.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 _TFLITE_LOG_H_ +#define _TFLITE_LOG_H_ + +#ifdef __cplusplus +extern "C" { +#endif /*__cplusplus*/ + +#define ERROR 1 +#define WARNING 2 +#define INFO 3 +#define DEBUG 4 + +#ifdef __TIZEN__ +#include +#ifdef LOG_TAG +#undef LOG_TAG +#endif // LOG_TAG +#define LOG_TAG "TFLITE_NATIVE" + +#define TFLITE_NATIVE_LOG(log_level, format, args...) \ + do { \ + switch (log_level) { \ + case ERROR: \ + LOGE(format, ## args); \ + case WARNING: \ + LOGE(format, ## args); \ + default: \ + LOGI(format, ## args); \ + } \ + } while (0) +#else // __TIZEN__ +#define LEVEL_TO_STR(level) (\ + ((level) == ERROR) ? "ERROR" : \ + ((level) == WARNING) ? "WARNING" : \ + ((level) == INFO) ? "INFO": \ + ((level) == DEBUG) ? "DEBUG" : "DEFAULT") +#define TFLITE_NATIVE_LOG(log_level, format, args...) \ + do { \ + printf("%s: %s: ", LEVEL_TO_STR(log_level), __FILE__); \ + printf(format, ## args); \ + printf("\n"); \ + }while (0) +#endif // __TIZEN__ + +#ifdef __cplusplus +} +#endif /*__cplusplus*/ + +#endif /*_TFLITE_LOG_H*/ diff --git a/contrib/TFLiteSharp/TFLiteNative/include/tflite_nativewrapper.h b/contrib/TFLiteSharp/TFLiteNative/include/tflite_nativewrapper.h new file mode 100644 index 000000000..7fddb5400 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteNative/include/tflite_nativewrapper.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 _TFLITE_NATIVEWRAPPER_H_ +#define _TFLITE_NATIVEWRAPPER_H_ + +#include "tensorflow/contrib/lite/kernels/register.h" +#include "tensorflow/contrib/lite/model.h" +#include "tensorflow/contrib/lite/string_util.h" +#include "tensorflow/contrib/lite/tools/mutable_op_resolver.h" + +#ifdef __cplusplus +extern "C" { +#endif /*__cplusplus*/ + +typedef enum +{ + /** 32-bit signed integer. */ + INT32 = 1, + + /** 32-bit single precision floating point. */ + FLOAT32 = 2, + + /** 8-bit unsigned integer. */ + UINT8 = 3, + + /** 64-bit signed integer. */ + INT64 = 4 +} TFLiteNativeType; + +void tflite_interpreter_setNumThreads(long* interpreterHandle, int numThreads); + +long long tflite_flatbuffermodel_BuildFromFile(char* modelPath); + +long long tflite_builder_interpreterBuilder(long* modelHandle); + +void* tflite_interpreter_run(long* interpreterHandle, void* values, int inputLength, int dataType); + +#ifdef __cplusplus +} +#endif /*__cplusplus*/ + +#endif /*_TFLITE_NATIVEWRAPPER_H_*/ diff --git a/contrib/TFLiteSharp/TFLiteNative/src/tflite_nativewrapper.cpp b/contrib/TFLiteSharp/TFLiteNative/src/tflite_nativewrapper.cpp new file mode 100644 index 000000000..413304637 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteNative/src/tflite_nativewrapper.cpp @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 +#include "tflite_nativewrapper.h" +#include "tflite_log.h" +#include +#include +#include +#include + +int getNumBytes(TFLiteNativeType dataType) +{ + switch (dataType) { + case INT32: + return 4; + case FLOAT32: + return 4; + case UINT8: + return 1; + case INT64: + return 8; + default: + return 1; + } +} + +/// +/// Set the number of threads available to the interpreter. +/// +/// Handle of the interpreter instance. +/// Number of threads. +void tflite_interpreter_setNumThreads(long* interpreterHandle, int numThreads) +{ + assert(interpreterHandle != nullptr); + tflite::Interpreter* interpreter = reinterpret_cast(*interpreterHandle); + + interpreter->SetNumThreads(numThreads); + + TFLITE_NATIVE_LOG(DEBUG, "Number of threads: %d", numThreads); + return; +} + +/// +/// Creates a Flat Buffer Model from the given .tflite model. +/// +/// Path of the model. +long long +tflite_flatbuffermodel_BuildFromFile(char* modelPath) +{ + if (modelPath == nullptr) { + TFLITE_NATIVE_LOG(ERROR, "Invalid parameter"); + return 0; + } + TFLITE_NATIVE_LOG(ERROR, "Model Path: %s", modelPath); + + if (access(modelPath, F_OK) == -1) { + TFLITE_NATIVE_LOG(ERROR, "Failed to access model [%s]", + strerror(errno)); + return 0; + } + + auto model = tflite::FlatBufferModel::BuildFromFile(modelPath); + + TFLITE_NATIVE_LOG(DEBUG, "Successfully loaded model"); + return reinterpret_cast(model.release()); +} + +/// +/// Creates an interpreter instance taking the flatbuffer model as input. +/// +/// Address of the flatbuffer model. +long long +tflite_builder_interpreterBuilder(long* modelHandle) +{ + assert(modelHandle != nullptr); + tflite::FlatBufferModel* model = reinterpret_cast(*modelHandle); + + tflite::ops::builtin::BuiltinOpResolver resolver; + std::unique_ptr interpreter; + + TfLiteStatus status = tflite::InterpreterBuilder (*model, resolver)(&interpreter); + + if (status != kTfLiteOk) { + TFLITE_NATIVE_LOG(DEBUG, "Cannot create interpreter"); + return 0; + } + TFLITE_NATIVE_LOG(DEBUG, "CheckPoint interpreter"); + return reinterpret_cast(interpreter.release()); +} + +/// +/// Runs the inference given the inputs. +/// +/// Address of the interpreter instance. +/// Input values for the model. +/// Length of the input. +/// Data type key of the input. +void* tflite_interpreter_run(long* interpreterHandle, void* values, int inputLength, + int dataType) +{ + assert(interpreterHandle != nullptr); + tflite::Interpreter* interpreter = reinterpret_cast(*interpreterHandle); + + int inputTensorIndex = interpreter->inputs()[0]; + + //TODO:: input tensor size will be passed as a parameter. It is hardcoded for now. + interpreter->ResizeInputTensor(inputTensorIndex, + { 1, 224, 224, 3 }); + + if (interpreter->AllocateTensors() != kTfLiteOk) { + TFLITE_NATIVE_LOG(ERROR, "Failed to allocate tensors!"); + return nullptr; + } + + float* inputTensorPointer = interpreter->typed_tensor(inputTensorIndex); + + int numBytes = getNumBytes((TFLiteNativeType) dataType); + + memcpy(inputTensorPointer, values, inputLength * numBytes); + + if (interpreter->Invoke() != kTfLiteOk) { + TFLITE_NATIVE_LOG(ERROR, "Failed to invoke"); + } + + float* output = interpreter->typed_output_tensor(0); + return output; +} + diff --git a/contrib/TFLiteSharp/TFLiteNative/tflite-native.pc.in b/contrib/TFLiteSharp/TFLiteNative/tflite-native.pc.in new file mode 100644 index 000000000..eec103acc --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteNative/tflite-native.pc.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=@PREFIX@ +exec_prefix=/usr +libdir=@LIB_INSTALL_DIR@ +includedir=@INCLUDE_INSTALL_DIR@/ + +Name: @PC_NAME@ +Description: @PACKAGE_DESCRIPTION@ +Version: @VERSION@ +Requires: @PC_REQUIRED@ tensorflow-lite +Libs: -L${libdir} @PC_LDFLAGS@ +Cflags: -I${includedir} diff --git a/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp.sln b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp.sln new file mode 100644 index 000000000..985466cef --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.16 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TFLiteSharp", "TFLiteSharp\TFLiteSharp.csproj", "{22D47176-D5AD-4AD4-8867-8788139DF71C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {22D47176-D5AD-4AD4-8867-8788139DF71C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22D47176-D5AD-4AD4-8867-8788139DF71C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22D47176-D5AD-4AD4-8867-8788139DF71C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22D47176-D5AD-4AD4-8867-8788139DF71C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1B276F69-8E79-4501-AF04-6D340690762B} + EndGlobalSection +EndGlobal diff --git a/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.Libraries.cs b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.Libraries.cs new file mode 100644 index 000000000..db8d9f612 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.Libraries.cs @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +internal static partial class Interop +{ + internal static partial class Libraries + { + public const string TFLite = "libtflite-native.so"; + } +} diff --git a/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.TFLite.cs b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.TFLite.cs new file mode 100644 index 000000000..c7c7b24aa --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/Interop/Interop.TFLite.cs @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class TFLite + { + [DllImport(Libraries.TFLite, EntryPoint = "tflite_flatbuffermodel_BuildFromFile")] + internal static extern IntPtr TFLiteFlatBufferModelBuildFromFile(string path); + + [DllImport(Libraries.TFLite, EntryPoint = "tflite_builder_interpreterBuilder")] + internal static extern IntPtr TFLiteBuilderInterpreterBuilder(ref IntPtr modelHandle); + + [DllImport(Libraries.TFLite, EntryPoint = "tflite_interpreter_setNumThreads")] + internal static extern void TFLiteInterpreterSetNumThreads(int numThreads); + + [DllImport(Libraries.TFLite, EntryPoint = "tflite_interpreter_run")] + internal static extern IntPtr TFLiteInterpreterRun(ref IntPtr interpreterHandle, IntPtr values, int inpLen, int dataType); + + } +} diff --git a/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/TFLiteSharp.csproj b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/TFLiteSharp.csproj new file mode 100644 index 000000000..e0490bfb8 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/TFLiteSharp.csproj @@ -0,0 +1,52 @@ + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + Library + netstandard2.0 + + + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Datatype.cs b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Datatype.cs new file mode 100644 index 000000000..404d1663e --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Datatype.cs @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +/** Type of elements in a {@link TfLiteTensor}. */ +enum DataType +{ + /** 32-bit signed integer. */ + INT32 = 1, + + /** 32-bit single precision floating point. */ + FLOAT32 = 2, + + /** 8-bit unsigned integer. */ + UINT8 = 3, + + /** 64-bit signed integer. */ + INT64 = 4 +} diff --git a/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Interpreter.cs b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Interpreter.cs new file mode 100644 index 000000000..f1b4a8e07 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharp/TFLiteSharp/src/Interpreter.cs @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace TFLite +{ + + /// + /// Driver class to drive model inference with TensorFlow Lite. Interpreter + /// encapsulates a pre-trained model file in whihc the operations are performed + /// @class Interpreter + /// + public class Interpreter : IDisposable + { + // Handle to hold the model instance + private IntPtr m_modelHandle; + // Handle to hold the interpreter instance + private IntPtr m_interpreterHandle; + + /// + /// Interpreter Constructor. Inititalizes an interpreter. + /// + ///a File of a pre-trained TF Lite model. + public Interpreter(string modelPath) + { + //Constructor to initialize the interpreter with a model file + m_modelHandle = Interop.TFLite.TFLiteFlatBufferModelBuildFromFile(modelPath); + if(m_modelHandle == IntPtr.Zero) + { + //TODO: routine for handling null pointer. + } + m_interpreterHandle = Interop.TFLite.TFLiteBuilderInterpreterBuilder(ref m_modelHandle); + if (m_interpreterHandle == IntPtr.Zero) + { + //TODO: routine for handling null pointer. + } + } + + /// + /// Set the number of threads available to the interpreter. + /// + /// Number of threads. + public void SetNumThreads(int numThreads) + { + Interop.TFLite.TFLiteInterpreterSetNumThreads(numThreads); + return; + } + + /// + /// Runs model inference if the model takes only one input, and provides only + /// one output. + /// + /// input an array or multidimensional array. + /// outputs a multidimensional array of output data. + public void Run(Array input, ref Array output) + { + Array[] inputs = { input }; + Dictionary outputs = new Dictionary(); + + RunForMultipleInputsOutputs(inputs, ref outputs); + output = outputs[0]; + + return; + } + + /// + /// Runs model inference if the model takes multiple inputs, or returns multiple + /// outputs. + /// + /// input an array of input data. + /// outputs a map mapping output indices to multidimensional + /// arrays of output data. + public void RunForMultipleInputsOutputs(Array[] inputs, ref Dictionary outputs) + { + if(m_interpreterHandle == IntPtr.Zero) + { + //TODO:: exception handling + } + + if (inputs == null || inputs.Length == 0) + { + //TODO::throw new IllegalArgumentException("Input error: Inputs should not be null or empty."); + } + + DataType[] dataTypes = new DataType[inputs.Length];//To be used in multi-dimensional case + + for (int i = 0; i < inputs.Length; ++i) + { + dataTypes[i] = DataTypeOf(inputs[i]); + } + + //TODO:: Support for multi dimesional array to be added. + IntPtr pnt = Marshal.AllocHGlobal(inputs[0].Length); + + switch (dataTypes[0]) + { + case DataType.INT32: + Marshal.Copy((int[])inputs[0], 0, pnt, inputs[0].Length); + break; + case DataType.FLOAT32: + Marshal.Copy((float[])inputs[0], 0, pnt, inputs[0].Length); + break; + case DataType.UINT8: + Marshal.Copy((byte[])inputs[0], 0, pnt, inputs[0].Length); + break; + case DataType.INT64: + Marshal.Copy((long[])inputs[0], 0, pnt, inputs[0].Length); + break; + default: + Marshal.Copy((byte[])inputs[0], 0, pnt, inputs[0].Length); + break; + } + + //Currently this handles only single input with single dimension. + IntPtr outputsHandles = Interop.TFLite.TFLiteInterpreterRun(ref m_interpreterHandle, pnt, inputs[0].Length, (int)dataTypes[0]); + + if (outputsHandles == null) + { + //throw new IllegalStateException("Internal error: Interpreter has no outputs."); + } + + switch (dataTypes[0]) + { + case DataType.INT32: + int[] managedArrayInt = new int[inputs[0].Length]; + Marshal.Copy(outputsHandles, managedArrayInt, 0, inputs[0].Length); + outputs.Add(0, managedArrayInt); + break; + case DataType.FLOAT32: + float[] managedArrayFloat = new float[inputs[0].Length]; + Marshal.Copy(outputsHandles, managedArrayFloat, 0, inputs[0].Length); + outputs.Add(0, managedArrayFloat); + break; + case DataType.UINT8: + byte[] managedArrayByte = new byte[inputs[0].Length]; + Marshal.Copy(outputsHandles, managedArrayByte, 0, inputs[0].Length); + outputs.Add(0, managedArrayByte); + break; + case DataType.INT64: + long[] managedArrayLong = new long[inputs[0].Length]; + Marshal.Copy(outputsHandles, managedArrayLong, 0, inputs[0].Length); + outputs.Add(0, managedArrayLong); + break; + default: + byte[] managedArrayDefault = new byte[inputs[0].Length]; + Marshal.Copy(outputsHandles, managedArrayDefault, 0, inputs[0].Length); + outputs.Add(0, managedArrayDefault); + break; + } + return; + } + + static DataType DataTypeOf(Array a) + { + if (a.GetValue(0).GetType()==typeof(int)) + { + return DataType.INT32; + } + else if (a.GetValue(0).GetType() == typeof(float)) + { + return DataType.FLOAT32; + } + else if (a.GetValue(0).GetType() == typeof(byte)) + { + return DataType.UINT8; + } + else if(a.GetValue(0).GetType() == typeof(long)) + { + return DataType.INT64; + } + else + { + return DataType.UINT8; + //TODO: throw exception + } + + } + + /// + /// Resizes idx-th input of the native model to the given dims. + /// + /// index of the input. + /// Dimensions to which input needs to be resized. + public void ResizeInput(int idx, int[] dims) + { + return; + } + + /// + /// Gets index of an input given the tensor name of the input. + /// + /// Name of the tensor. + public int GetInputIndex(string tensorName) + { + return 0; + } + + /// + /// Gets index of output given the tensor name of the input. + /// + /// Name of the tensor. + public int GetOutputIndex(string tensorName) + { + return 0; + } + + /// + /// Turns on/off Android NNAPI for hardware acceleration when it is available. + /// + /// set the boolean value to turn on/off nnapi. + public void SetUseNNAPI(bool useNNAPI) + { + return; + } + + /// + /// Release resources associated with the Interpreter. + /// + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool bDisposing) + { + if (m_interpreterHandle != IntPtr.Zero) + { + // Call the function to dispose this class + m_interpreterHandle = IntPtr.Zero; + } + + if (bDisposing) + { + // No need to call the finalizer since we've now cleaned + // up the unmanaged memory + GC.SuppressFinalize(this); + } + } + + // This finalizer is called when Garbage collection occurs, but only if + // the IDisposable.Dispose method wasn't already called. + ~Interpreter() + { + Dispose(false); + } + } +} diff --git a/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest.sln b/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest.sln new file mode 100644 index 000000000..e260a72c7 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.16 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TFLiteSharpTest", "TFLiteSharpTest\TFLiteSharpTest.csproj", "{D35A178F-9EF3-4B07-9E53-A91AA7A030B3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TFLiteSharp", "..\TFLiteSharp\TFLiteSharp\TFLiteSharp.csproj", "{C06BC425-9BC3-43C7-A9D3-E12849E0C129}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D35A178F-9EF3-4B07-9E53-A91AA7A030B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D35A178F-9EF3-4B07-9E53-A91AA7A030B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D35A178F-9EF3-4B07-9E53-A91AA7A030B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D35A178F-9EF3-4B07-9E53-A91AA7A030B3}.Release|Any CPU.Build.0 = Release|Any CPU + {C06BC425-9BC3-43C7-A9D3-E12849E0C129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C06BC425-9BC3-43C7-A9D3-E12849E0C129}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C06BC425-9BC3-43C7-A9D3-E12849E0C129}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C06BC425-9BC3-43C7-A9D3-E12849E0C129}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8F946511-2BE4-40A5-A48C-A5684C62755D} + EndGlobalSection +EndGlobal diff --git a/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/Program.cs b/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/Program.cs new file mode 100644 index 000000000..e559bec36 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/Program.cs @@ -0,0 +1,38 @@ +using System; + +namespace TFLiteSharpTest +{ + class Program + { + static void Main(string[] args) + { + //Constructing a new interpreter instance from the modelfile + TFLite.Interpreter interpreter = new TFLite.Interpreter("modelpath/modelfile.tflite"); + Console.WriteLine("Interpreter Built Successfully"); + + //Setting the number of threads of the interpreter + interpreter.SetNumThreads(1); + + //Declaring input and output variables; + Array input = new int[5] { 1, 2, 3, 4, 5 }; + Array output = new int[5]; + + //Call to invoke the interpreter and run the inference to populate output + interpreter.Run(input, out output); + Console.WriteLine("Output generated Successfully"); + + //get input, output indices + Console.WriteLine("Input index for tensorname: " + interpreter.GetInputIndex("tensorname")); + Console.WriteLine("Output index for tensorname: " + interpreter.GetOutputIndex("tensorname")); + + //Resizing the dimensions + int[] dims = new int[3] { 1, 2, 3 }; + interpreter.ResizeInput(1, dims); + + //Disposing the interpreter to free resources at the end + interpreter.Dispose(); + + Console.WriteLine("Run Complete"); + } + } +} diff --git a/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/TFLiteSharpTest.csproj b/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/TFLiteSharpTest.csproj new file mode 100644 index 000000000..b143ee598 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteSharpTest/TFLiteSharpTest/TFLiteSharpTest.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp2.0 + + + + + + + diff --git a/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp.csproj b/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp.csproj new file mode 100644 index 000000000..1c9ed6037 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp.csproj @@ -0,0 +1,54 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netstandard2.0 + + + + + true + $(PackageTargetFallback);portable-net45+wp80+win81+wpa81 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_App.cs b/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_App.cs new file mode 100644 index 000000000..49a08604d --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_App.cs @@ -0,0 +1,65 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Xamarin.Forms; + +namespace TFLiteTestApp +{ + public class App : Application + { + public App() + { + TFLite.Interpreter interpreter = null; + try + { + interpreter = new TFLite.Interpreter(Tizen.Applications.Application.Current.DirectoryInfo.Resource + "mobilenet_v1_1.0_224.tflite"); + } + catch(Exception e) + { + Tizen.Log.Debug("tflite", "Error: " + e); + } + + Tizen.Log.Debug("tflite", "Interpreter Initialised"); + Array Output = new byte[1000]; + + Array input = new byte[150582]; + input = File.ReadAllBytes(Tizen.Applications.Application.Current.DirectoryInfo.Resource + "mouse_224.bmp"); + + interpreter.Run(input, ref Output); + //val variable to check if the Output array is being populated or not. + byte val = ((byte[])Output)[0]; + // The root page of your application + MainPage = new ContentPage + { + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Welcome to Xamarin Forms!" + } + } + } + }; + } + + protected override void OnStart() + { + // Handle when your app starts + } + + protected override void OnSleep() + { + // Handle when your app sleeps + } + + protected override void OnResume() + { + // Handle when your app resumes + } + } +} diff --git a/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_Main.cs b/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_Main.cs new file mode 100644 index 000000000..2a8f747a4 --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteTestApp/TFLiteTestApp_Main.cs @@ -0,0 +1,20 @@ +using System; + +namespace TFLiteTestApp +{ + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + protected override void OnCreate() + { + base.OnCreate(); + LoadApplication(new App()); + } + + static void Main(string[] args) + { + var app = new Program(); + global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/contrib/TFLiteSharp/TFLiteTestApp/res/mobilenet_v1_1.0_224.tflite b/contrib/TFLiteSharp/TFLiteTestApp/res/mobilenet_v1_1.0_224.tflite new file mode 100644 index 000000000..d34691eb6 Binary files /dev/null and b/contrib/TFLiteSharp/TFLiteTestApp/res/mobilenet_v1_1.0_224.tflite differ diff --git a/contrib/TFLiteSharp/TFLiteTestApp/res/mouse1.bmp b/contrib/TFLiteSharp/TFLiteTestApp/res/mouse1.bmp new file mode 100644 index 000000000..1734ca318 Binary files /dev/null and b/contrib/TFLiteSharp/TFLiteTestApp/res/mouse1.bmp differ diff --git a/contrib/TFLiteSharp/TFLiteTestApp/res/mouse_224.bmp b/contrib/TFLiteSharp/TFLiteTestApp/res/mouse_224.bmp new file mode 100644 index 000000000..ccfed6ad3 Binary files /dev/null and b/contrib/TFLiteSharp/TFLiteTestApp/res/mouse_224.bmp differ diff --git a/contrib/TFLiteSharp/TFLiteTestApp/shared/res/TFLiteTestApp.png b/contrib/TFLiteSharp/TFLiteTestApp/shared/res/TFLiteTestApp.png new file mode 100644 index 000000000..9f3cb9860 Binary files /dev/null and b/contrib/TFLiteSharp/TFLiteTestApp/shared/res/TFLiteTestApp.png differ diff --git a/contrib/TFLiteSharp/TFLiteTestApp/tizen-manifest.xml b/contrib/TFLiteSharp/TFLiteTestApp/tizen-manifest.xml new file mode 100644 index 000000000..62a8d4c7c --- /dev/null +++ b/contrib/TFLiteSharp/TFLiteTestApp/tizen-manifest.xml @@ -0,0 +1,14 @@ + + + + + + TFLiteTestApp.png + + diff --git a/contrib/TFLiteSharp/packaging/TFLiteSharp.manifest b/contrib/TFLiteSharp/packaging/TFLiteSharp.manifest new file mode 100644 index 000000000..75b0fa5e3 --- /dev/null +++ b/contrib/TFLiteSharp/packaging/TFLiteSharp.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/contrib/TFLiteSharp/packaging/TFLiteSharp.spec b/contrib/TFLiteSharp/packaging/TFLiteSharp.spec new file mode 100644 index 000000000..dcb65a864 --- /dev/null +++ b/contrib/TFLiteSharp/packaging/TFLiteSharp.spec @@ -0,0 +1,103 @@ +Name: TFLiteSharp +Summary: Tensorflow lite native cpp wrapper and C# API +Version: 1.0.0 +Release: 1 +Group: Development/Libraries +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source1: %{name}.manifest +Source2: tflite-native.manifest + +%description +%{summary} + +%package TFLiteNative +Summary: Tensorflow lite native cpp wrapper +Group: Development/Libraries +BuildRequires: cmake +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(tensorflow-lite) +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig + +%description TFLiteNative +Native CPP Wrapper for Tensorflow lite + +%package TFLiteNative-devel +Summary: Tensorflow lite native cpp wrapper (Development) +Requires: %{name} = %{version}-%{release} + +%description TFLiteNative-devel +Tensorflow lite native cpp wrapper (Development) + +%package TFLiteSharp +Summary: Tensorflow lite API for C# +Group: Development/Libraries +AutoReqProv: no +ExcludeArch: aarch64 + +BuildRequires: dotnet-build-tools + +%define Assemblies TFLiteSharp + +%description TFLiteSharp +Tensorflow lite API for C# + +%dotnet_import_sub_packages + +%prep +%setup -q +cp %{SOURCE1} . +cp %{SOURCE2} . +%if 0%{?tizen:1} +%define TARGET_OS tizen +%else +%define TARGET_OS linux +%endif + +%build +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +%if "%{TARGET_OS}" == "tizen" +cmake VERBOSE=1 -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ + -DLIB_INSTALL_DIR=%{_libdir} -DINCLUDE_INSTALL_DIR=%{_includedir} \ + -DLIB_PATH=%{_lib} -DTIZEN=1 contrib/TFLiteSharp/TFLiteNative +%else +cmake VERBOSE=1 -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ + -DLIB_INSTALL_DIR=%{_libdir} -DINCLUDE_INSTALL_DIR=%{_includedir} \ + -DLIB_PATH=%{_lib} contrib/TFLiteSharp/TFLiteNative +%endif + +make %{?_smp_mflags} + +cd contrib/TFLiteSharp/ +for ASM in %{Assemblies}; do +%dotnet_build $ASM +%dotnet_pack $ASM +done + +%install +%make_install +cd contrib/TFLiteSharp/TFLiteSharp +for ASM in %{Assemblies}; do +%dotnet_install $ASM +done + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest %{name}.manifest +%license LICENSE + +%files TFLiteNative +%manifest tflite-native.manifest +%{_libdir}/libtflite-native.so* + +%files TFLiteNative-devel +%{_includedir}/* +%{_libdir}/pkgconfig/tflite-native.pc +%{_libdir}/libtflite-native.so* + +%files TFLiteSharp +%attr(644,root,root) %{dotnet_assembly_files} diff --git a/contrib/TFLiteSharp/packaging/tflite-native.manifest b/contrib/TFLiteSharp/packaging/tflite-native.manifest new file mode 100644 index 000000000..75b0fa5e3 --- /dev/null +++ b/contrib/TFLiteSharp/packaging/tflite-native.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/contrib/bindacl/CMakeLists.txt b/contrib/bindacl/CMakeLists.txt new file mode 100644 index 000000000..75e77a53e --- /dev/null +++ b/contrib/bindacl/CMakeLists.txt @@ -0,0 +1,20 @@ +if(NOT BUILD_LABS) + return() +endif(NOT BUILD_LABS) + +if(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + return() +endif(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + +nnfw_find_package(ARMCompute REQUIRED) + +file(GLOB_RECURSE NNAPI_BINDACL_SRCS "src/*.cc") + +link_directories(${CMAKE_INSTALL_PREFIX}/lib) + +add_library(exp_bindacl SHARED ${NNAPI_BINDACL_SRCS}) +target_include_directories(exp_bindacl PUBLIC ${NNFW_INCLUDE_DIR}) +target_link_libraries(exp_bindacl nnfw_util arm_compute_graph) + +# we need the library name to be 'neuralnetworks' and this will do the trick +set_target_properties(exp_bindacl PROPERTIES OUTPUT_NAME neuralnetworks) diff --git a/contrib/bindacl/README.md b/contrib/bindacl/README.md new file mode 100644 index 000000000..2c9f03670 --- /dev/null +++ b/contrib/bindacl/README.md @@ -0,0 +1,13 @@ +Build +``` +CROSS_BUILD=1 TARGET_ARCH=armv7l make +CROSS_BUILD=1 TARGET_ARCH=armv7l make install +``` + +Test +``` +USE_NNAPI=1 \ +LD_LIBRARY_PATH="$(pwd)/Product/out/lib:$(pwd)/Product/obj/contrib/bindacl" \ +Product/out/bin/tflite_run \ +[T/F Lite Flatbuffer Model Path] +``` diff --git a/contrib/bindacl/src/nnapi_acl.cc b/contrib/bindacl/src/nnapi_acl.cc new file mode 100644 index 000000000..d9432465a --- /dev/null +++ b/contrib/bindacl/src/nnapi_acl.cc @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +// ACL Headers +#include +#include + +#include "util/environment.h" + +// +// Asynchronous Event +// +struct ANeuralNetworksEvent +{ +}; + +int ANeuralNetworksEvent_wait(ANeuralNetworksEvent* event) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksEvent_free(ANeuralNetworksEvent* event) +{ + delete event; +} + +// +// Memory +// +struct ANeuralNetworksMemory +{ + // 1st approach - Store all the data inside ANeuralNetworksMemory object + // 2nd approach - Store metadata only, and defer data loading as much as possible +}; + +int ANeuralNetworksMemory_createFromFd(size_t size, int protect, int fd, size_t offset, ANeuralNetworksMemory** memory) +{ + *memory = new ANeuralNetworksMemory; + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksMemory_free(ANeuralNetworksMemory* memory) +{ + delete memory; +} + +// +// Model +// +struct ANeuralNetworksModel +{ + // ANeuralNetworksModel should be a factory for Graph IR (a.k.a ISA Frontend) + // TODO Record # of operands + uint32_t numOperands; + + ANeuralNetworksModel() : numOperands(0) + { + // DO NOTHING + } +}; + +int ANeuralNetworksModel_create(ANeuralNetworksModel** model) +{ + *model = new ANeuralNetworksModel; + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksModel_free(ANeuralNetworksModel* model) +{ + delete model; +} + +int ANeuralNetworksModel_addOperand(ANeuralNetworksModel* model, const ANeuralNetworksOperandType *type) +{ + model->numOperands += 1; + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel* model, int32_t index, const void* buffer, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel* model, int32_t index, const ANeuralNetworksMemory* memory, size_t offset, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_addOperation(ANeuralNetworksModel* model, ANeuralNetworksOperationType type, uint32_t inputCount, const uint32_t* inputs, uint32_t outputCount, const uint32_t* outputs) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel* model, uint32_t inputCount, const uint32_t* inputs, uint32_t outputCount, const uint32_t* outputs) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_finish(ANeuralNetworksModel* model) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +// +// Compilation +// +struct ANeuralNetworksCompilation +{ + // ANeuralNetworksCompilation should hold a compiled IR +}; + +int ANeuralNetworksCompilation_create(ANeuralNetworksModel* model, ANeuralNetworksCompilation** compilation) +{ + *compilation = new ANeuralNetworksCompilation; + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +// +// Execution +// +struct ANeuralNetworksExecution +{ + // ANeuralNetworksExecution corresponds to NPU::Interp::Session + + arm_compute::graph::frontend::Stream graph{0, "BIND_ACL"}; +}; + +class DummyInputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + DummyInputAccessor() = default; + DummyInputAccessor(DummyInputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; +}; + +bool DummyInputAccessor::access_tensor(arm_compute::ITensor&) +{ + return true; +} + +class DummyOutputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + DummyOutputAccessor() = default; + DummyOutputAccessor(DummyOutputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; +}; + +bool DummyOutputAccessor::access_tensor(arm_compute::ITensor&) +{ + return false; +} + +int ANeuralNetworksExecution_create(ANeuralNetworksCompilation* compilation, ANeuralNetworksExecution** execution) +{ + std::cout << __FUNCTION__ << " +++" << std::endl; + *execution = new ANeuralNetworksExecution; + + using arm_compute::DataType; + using arm_compute::graph::Target; + using arm_compute::graph::TensorDescriptor; + using arm_compute::TensorShape; + using arm_compute::graph::frontend::InputLayer; + using arm_compute::graph::frontend::OutputLayer; + + ANeuralNetworksExecution* execlocal = *execution; + arm_compute::graph::frontend::Stream& graph = execlocal->graph; + + Target target_hint = nnfw::util::get_env_int("NNFW_ACL_USENEON") + ? Target::NEON : Target::CL; + + graph << target_hint + << InputLayer(TensorDescriptor(TensorShape(224U, 224U, 3U, 1U), DataType::F32), + std::unique_ptr(new DummyInputAccessor())) + << arm_compute::graph::frontend::SoftmaxLayer() + << OutputLayer((std::unique_ptr(new DummyOutputAccessor()))); + + std::cout << __FUNCTION__ << " ---" << std::endl; + return ANEURALNETWORKS_NO_ERROR; +} + +// ANeuralNetworksExecution_setInput and ANeuralNetworksExecution_setOutput specify HOST buffer for input/output +int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const void* buffer, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksExecution_setOutput(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const void* buffer, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution* execution, ANeuralNetworksEvent** event) +{ + std::cout << __FUNCTION__ << " +++" << std::endl; + *event = new ANeuralNetworksEvent; + + // graph.run() fails with segment fail when only target_hint is added. + // after fix adding 'Tensor' we may call graph.run() + arm_compute::graph::frontend::Stream& graph = execution->graph; + graph.run(); + + std::cout << __FUNCTION__ << " ---" << std::endl; + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksExecution_free(ANeuralNetworksExecution* execution) +{ + delete execution; +} diff --git a/contrib/convacl/CMakeLists.txt b/contrib/convacl/CMakeLists.txt new file mode 100644 index 000000000..ca6411211 --- /dev/null +++ b/contrib/convacl/CMakeLists.txt @@ -0,0 +1,20 @@ +if(NOT BUILD_LABS) + return() +endif(NOT BUILD_LABS) + +if(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + return() +endif(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + +nnfw_find_package(ARMCompute REQUIRED) + +file(GLOB_RECURSE NNAPI_CONVACL_SRCS "src/*.cc") + +link_directories(${CMAKE_INSTALL_PREFIX}/lib) + +add_library(exp_convacl SHARED ${NNAPI_CONVACL_SRCS}) +target_include_directories(exp_convacl PUBLIC ${NNFW_INCLUDE_DIR}) +target_link_libraries(exp_convacl nnfw_util arm_compute_graph) + +# we need the library name to be 'neuralnetworks' and this will do the trick +set_target_properties(exp_convacl PROPERTIES OUTPUT_NAME neuralnetworks) diff --git a/contrib/convacl/src/io_accessor.cc b/contrib/convacl/src/io_accessor.cc new file mode 100644 index 000000000..b7fdee721 --- /dev/null +++ b/contrib/convacl/src/io_accessor.cc @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "io_accessor.h" +#include +#include + +bool InputAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + *reinterpret_cast(tensor.ptr_to_element(id)) = _test_input; + _test_input += _inc ? 1.0 : 0.0; + + std::cout << "Input " << id.y() << "," << id.x() << " = "; + std::cout << *reinterpret_cast(tensor.ptr_to_element(id)); + std::cout << std::endl; + }); + return true; +} + +bool OutputAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + std::cout << "Output " << id.y() << "," << id.x() << " = "; + std::cout << *reinterpret_cast(tensor.ptr_to_element(id)); + std::cout << std::endl; + }); + return false; // end the network +} + +bool WeightAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + *reinterpret_cast(tensor.ptr_to_element(id)) = _test_weight; + _test_weight += _inc ? 1.0 : 0.0; + + std::cout << "Weight " << id.y() << "," << id.x() << " = "; + std::cout << *reinterpret_cast(tensor.ptr_to_element(id)); + std::cout << std::endl; + }); + return true; +} + +bool BiasAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + *reinterpret_cast(tensor.ptr_to_element(id)) = 0.0; + + std::cout << "Bias " << id.y() << "," << id.x() << " = "; + std::cout << *reinterpret_cast(tensor.ptr_to_element(id)); + std::cout << std::endl; + }); + return true; +} diff --git a/contrib/convacl/src/io_accessor.h b/contrib/convacl/src/io_accessor.h new file mode 100644 index 000000000..4033020e0 --- /dev/null +++ b/contrib/convacl/src/io_accessor.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __IO_ACCESSOR_H__ +#define __IO_ACCESSOR_H__ + +#include + +class InputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + InputAccessor(bool inc) : _inc(inc) { _test_input = 1.0; } + InputAccessor(InputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + bool _inc; + float _test_input; +}; + +class OutputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + OutputAccessor() = default; + OutputAccessor(OutputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; +}; + +class WeightAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + WeightAccessor(bool inc) : _inc(inc) { _test_weight = 1.0; } + WeightAccessor(WeightAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + bool _inc; + float _test_weight; +}; + +class BiasAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + BiasAccessor() = default; + BiasAccessor(BiasAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; +}; + +#endif // __IO_ACCESSOR_H__ diff --git a/contrib/convacl/src/nnapi_acl_conv.cc b/contrib/convacl/src/nnapi_acl_conv.cc new file mode 100644 index 000000000..091d19497 --- /dev/null +++ b/contrib/convacl/src/nnapi_acl_conv.cc @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include +#include +#include +#include +#include +#include +#include +#include +// ACL Headers +#include + +#include "util/environment.h" +#include "io_accessor.h" + +// +// Asynchronous Event +// +struct ANeuralNetworksEvent +{ +}; + +int ANeuralNetworksEvent_wait(ANeuralNetworksEvent* event) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksEvent_free(ANeuralNetworksEvent* event) +{ + delete event; +} + +// +// Memory +// +struct ANeuralNetworksMemory +{ + // 1st approach - Store all the data inside ANeuralNetworksMemory object + // 2nd approach - Store metadata only, and defer data loading as much as possible +}; + +int ANeuralNetworksMemory_createFromFd(size_t size, int protect, int fd, size_t offset, ANeuralNetworksMemory** memory) +{ + *memory = new ANeuralNetworksMemory; + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksMemory_free(ANeuralNetworksMemory* memory) +{ + delete memory; +} + +// +// Model +// +struct ANeuralNetworksModel +{ + // ANeuralNetworksModel should be a factory for Graph IR (a.k.a ISA Frontend) + // TODO Record # of operands + uint32_t numOperands; + + ANeuralNetworksModel() : numOperands(0) + { + // DO NOTHING + } +}; + +int ANeuralNetworksModel_create(ANeuralNetworksModel** model) +{ + *model = new ANeuralNetworksModel; + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksModel_free(ANeuralNetworksModel* model) +{ + delete model; +} + +int ANeuralNetworksModel_addOperand(ANeuralNetworksModel* model, const ANeuralNetworksOperandType *type) +{ + model->numOperands += 1; + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel* model, int32_t index, const void* buffer, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel* model, int32_t index, const ANeuralNetworksMemory* memory, size_t offset, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_addOperation(ANeuralNetworksModel* model, ANeuralNetworksOperationType type, uint32_t inputCount, const uint32_t* inputs, uint32_t outputCount, const uint32_t* outputs) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel* model, uint32_t inputCount, const uint32_t* inputs, uint32_t outputCount, const uint32_t* outputs) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksModel_finish(ANeuralNetworksModel* model) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +// +// Compilation +// +struct ANeuralNetworksCompilation +{ + // ANeuralNetworksCompilation should hold a compiled IR +}; + +int ANeuralNetworksCompilation_create(ANeuralNetworksModel* model, ANeuralNetworksCompilation** compilation) +{ + *compilation = new ANeuralNetworksCompilation; + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +// +// Execution +// +struct ANeuralNetworksExecution +{ + // ANeuralNetworksExecution corresponds to NPU::Interp::Session + + arm_compute::graph::frontend::Stream graph{0, "ACL_CONV"}; +}; + +int ANeuralNetworksExecution_create(ANeuralNetworksCompilation* compilation, ANeuralNetworksExecution** execution) +{ + std::cout << __FUNCTION__ << " +++" << std::endl; + *execution = new ANeuralNetworksExecution; + + using arm_compute::DataType; + using arm_compute::graph::Target; + using arm_compute::graph::TensorDescriptor; + using arm_compute::TensorShape; + using arm_compute::graph::frontend::InputLayer; + using arm_compute::graph::frontend::OutputLayer; + + ANeuralNetworksExecution* execlocal = *execution; + arm_compute::graph::frontend::Stream& graph = execlocal->graph; + + Target target_hint = nnfw::util::get_env_int("NNFW_ACL_USENEON") + ? Target::NEON : Target::CL; + bool autoinc = nnfw::util::get_env_bool("NNFW_TEST_AUTOINC"); + + graph << target_hint + << InputLayer(TensorDescriptor(TensorShape(3U, 3U, 1U, 1U), DataType::F32), + std::unique_ptr(new InputAccessor(autoinc))) + << arm_compute::graph::frontend::ConvolutionLayer( + 3U, 3U, 1U, + std::unique_ptr(new WeightAccessor(autoinc)), + std::unique_ptr(new BiasAccessor()), + arm_compute::PadStrideInfo(1, 1, 0, 0)) + << OutputLayer( + std::unique_ptr(new OutputAccessor())); + + std::cout << __FUNCTION__ << " ---" << std::endl; + return ANEURALNETWORKS_NO_ERROR; +} + +// ANeuralNetworksExecution_setInput and ANeuralNetworksExecution_setOutput specify HOST buffer for input/output +int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const void* buffer, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksExecution_setOutput(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const void* buffer, size_t length) +{ + return ANEURALNETWORKS_NO_ERROR; +} + +int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution* execution, ANeuralNetworksEvent** event) +{ + std::cout << __FUNCTION__ << " +++" << std::endl; + *event = new ANeuralNetworksEvent; + + // graph.run() fails with segment fail when only target_hint is added. + // after fix adding 'Tensor' we may call graph.run() + arm_compute::graph::frontend::Stream& graph = execution->graph; + graph.run(); + + std::cout << __FUNCTION__ << " ---" << std::endl; + return ANEURALNETWORKS_NO_ERROR; +} + +void ANeuralNetworksExecution_free(ANeuralNetworksExecution* execution) +{ + delete execution; +} diff --git a/contrib/detection/CMakeLists.txt b/contrib/detection/CMakeLists.txt new file mode 100644 index 000000000..23a529c1e --- /dev/null +++ b/contrib/detection/CMakeLists.txt @@ -0,0 +1,11 @@ +if(NOT BUILD_DETECTION_APP) + return() +endif(NOT BUILD_DETECTION_APP) + +nnfw_find_package(Tensorflow REQUIRED) + +list(APPEND SOURCES detection.cpp) + +add_executable(detection ${SOURCES}) +target_link_libraries(detection nnfw_util) +target_link_libraries(detection tensorflow-core) diff --git a/contrib/detection/detection.cpp b/contrib/detection/detection.cpp new file mode 100644 index 000000000..58beaad25 --- /dev/null +++ b/contrib/detection/detection.cpp @@ -0,0 +1,57 @@ +#include + +#include +#include + +#include +#include + +#include "util/benchmark.h" + +#define CHECK_TF(e) { \ + if(!(e).ok()) \ + { \ + throw std::runtime_error{"'" #e "' FAILED"}; \ + } \ +} + +int main(int argc, char **argv) +{ + if (argc < 2) + { + std::cerr << "USAGE: " << argv[0] << " [T/F model path] [output 0] [output 1] ..." << std::endl; + return 255; + } + + std::vector output_nodes; + + for (int argn = 2; argn < argc; ++argn) + { + output_nodes.emplace_back(argv[argn]); + } + + tensorflow::Session* sess; + + CHECK_TF(tensorflow::NewSession(tensorflow::SessionOptions(), &sess)); + + tensorflow::GraphDef graph_def; + + CHECK_TF(ReadBinaryProto(tensorflow::Env::Default(), argv[1], &graph_def)); + CHECK_TF(sess->Create(graph_def)); + + tensorflow::Tensor input(tensorflow::DT_FLOAT, tensorflow::TensorShape({1, 320, 320, 3})); + std::vector outputs; + + for (uint32_t n = 0; n < 5; ++n) + { + std::chrono::milliseconds elapsed(0); + + nnfw::util::benchmark::measure(elapsed) << [&] (void) { + CHECK_TF(sess->Run({{"input_node", input}}, output_nodes, {}, &outputs)); + }; + + std::cout << "Takes " << elapsed.count() << "ms" << std::endl; + } + + return 0; +} diff --git a/contrib/example/CMakeLists.txt b/contrib/example/CMakeLists.txt new file mode 100644 index 000000000..2d487d53f --- /dev/null +++ b/contrib/example/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(example example.cpp) diff --git a/contrib/example/example.cpp b/contrib/example/example.cpp new file mode 100644 index 000000000..f627e6bdf --- /dev/null +++ b/contrib/example/example.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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 + +int main(int argc, char **argv) +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} diff --git a/contrib/jniacl/CMakeLists.txt b/contrib/jniacl/CMakeLists.txt new file mode 100644 index 000000000..20c469c9d --- /dev/null +++ b/contrib/jniacl/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Simple Android JNI execution test of ACL +# + +if(NOT BUILD_LABS) + return() +endif(NOT BUILD_LABS) + +if(NOT "${TARGET_OS}" STREQUAL "android") + return() +endif(NOT "${TARGET_OS}" STREQUAL "android") + +nnfw_find_package(ARMCompute REQUIRED) + +link_directories(${CMAKE_INSTALL_PREFIX}/lib) + +set(JNIACL_SRCS src/jniacl_main.cc + src/io_accessor.cc) + +add_library(jniacl_jni SHARED ${JNIACL_SRCS}) +target_include_directories(jniacl_jni PUBLIC ${TFLITE_JNI_INCLUDES} src) +target_link_libraries(jniacl_jni arm_compute_graph log) diff --git a/contrib/jniacl/src/io_accessor.cc b/contrib/jniacl/src/io_accessor.cc new file mode 100644 index 000000000..103660716 --- /dev/null +++ b/contrib/jniacl/src/io_accessor.cc @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "io_accessor.h" +#include +#include + +bool InputAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + *reinterpret_cast(tensor.ptr_to_element(id)) = _test_input; + _test_input += _inc ? 1.0 : 0.0; + + __android_log_print(ANDROID_LOG_DEBUG, "LOG_TAG", "Input %d, %d = %lf\r\n", + id.y(), id.x(), *reinterpret_cast(tensor.ptr_to_element(id))); + }); + return true; +} + +bool OutputAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + __android_log_print(ANDROID_LOG_DEBUG, "Output", "Input %d, %d = %lf\r\n", + id.y(), id.x(), *reinterpret_cast(tensor.ptr_to_element(id))); + }); + return false; // end the network +} + +bool WeightAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + *reinterpret_cast(tensor.ptr_to_element(id)) = _test_weight; + _test_weight += _inc ? 1.0 : 0.0; + }); + return true; +} + +bool BiasAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + // Subtract the mean value from each channel + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + *reinterpret_cast(tensor.ptr_to_element(id)) = 0.0; + }); + return true; +} diff --git a/contrib/jniacl/src/io_accessor.h b/contrib/jniacl/src/io_accessor.h new file mode 100644 index 000000000..4033020e0 --- /dev/null +++ b/contrib/jniacl/src/io_accessor.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __IO_ACCESSOR_H__ +#define __IO_ACCESSOR_H__ + +#include + +class InputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + InputAccessor(bool inc) : _inc(inc) { _test_input = 1.0; } + InputAccessor(InputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + bool _inc; + float _test_input; +}; + +class OutputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + OutputAccessor() = default; + OutputAccessor(OutputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; +}; + +class WeightAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + WeightAccessor(bool inc) : _inc(inc) { _test_weight = 1.0; } + WeightAccessor(WeightAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + bool _inc; + float _test_weight; +}; + +class BiasAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + BiasAccessor() = default; + BiasAccessor(BiasAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; +}; + +#endif // __IO_ACCESSOR_H__ diff --git a/contrib/jniacl/src/jniacl_main.cc b/contrib/jniacl/src/jniacl_main.cc new file mode 100644 index 000000000..515f28732 --- /dev/null +++ b/contrib/jniacl/src/jniacl_main.cc @@ -0,0 +1,39 @@ +#include +#include + +#include +#include + +#include "io_accessor.h" + +extern "C" JNIEXPORT jstring JNICALL +Java_com_samsung_testaclexec_ActivityMain_RunACLJNI(JNIEnv *env, jobject) +{ + using arm_compute::DataType; + using arm_compute::graph::Tensor; + using arm_compute::graph::TargetHint; + using arm_compute::graph::Graph; + using arm_compute::TensorInfo; + using arm_compute::TensorShape; + + arm_compute::graph::Graph graph; + TargetHint target_hint = TargetHint::OPENCL; + bool autoinc = true; + + graph << target_hint + << Tensor(TensorInfo(TensorShape(3U, 3U, 1U, 1U), 1, DataType::F32), + std::unique_ptr(new InputAccessor(autoinc))) + << arm_compute::graph::ConvolutionLayer( + 3U, 3U, 1U, + std::unique_ptr(new WeightAccessor(autoinc)), + std::unique_ptr(new BiasAccessor()), + arm_compute::PadStrideInfo(1, 1, 0, 0)) + << Tensor(std::unique_ptr(new OutputAccessor())); + ; + + graph.run(); + + std::string hello = "SoftMax Run OK"; + + return env->NewStringUTF(hello.c_str()); +} diff --git a/contrib/kerneltesting/CMakeLists.txt b/contrib/kerneltesting/CMakeLists.txt new file mode 100644 index 000000000..ba0d808ce --- /dev/null +++ b/contrib/kerneltesting/CMakeLists.txt @@ -0,0 +1,23 @@ +if(NOT BUILD_LABS) + return() +endif(NOT BUILD_LABS) + +if(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + return() +endif(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + +nnfw_find_package(ARMCompute REQUIRED) + +function(add_kerneltesting TESTNAME SRC_FILES) + link_directories(${CMAKE_INSTALL_PREFIX}/lib) + add_executable(${TESTNAME} ${SRC_FILES}) + target_include_directories(${TESTNAME} PUBLIC + ${NNFW_INCLUDE_DIR}) + target_link_libraries(${TESTNAME} nnfw_util arm_compute_graph) + install(TARGETS ${TESTNAME} DESTINATION bin) +endfunction() + +# TODO: Enable conv2d on Tizen +if (NOT ${TARGET_OS} STREQUAL "tizen") + add_subdirectory(conv2d) +endif() diff --git a/contrib/kerneltesting/conv2d/CMakeLists.txt b/contrib/kerneltesting/conv2d/CMakeLists.txt new file mode 100644 index 000000000..25e01f584 --- /dev/null +++ b/contrib/kerneltesting/conv2d/CMakeLists.txt @@ -0,0 +1,15 @@ +set(KERNELTESTING_CONV2D kerneltesting_conv2d) + +set(KERNELTESTING_CONV2D_SRCS "nnfw_conv2d_test.cpp" + "io_accessor.cpp") + +set(GEMLOWP_INCUDE ${TFLITE_DEPEND_DIR}/gemmlowp/public) +set(EIGN_INCLUDE ${TFLITE_DEPEND_DIR}/eigen + ${TFLITE_DEPEND_DIR}/eigen/Eigen) + +add_kerneltesting(${KERNELTESTING_CONV2D} "${KERNELTESTING_CONV2D_SRCS}") + +target_include_directories(${KERNELTESTING_CONV2D} PUBLIC + ${GEMLOWP_INCUDE} + ${EIGN_INCLUDE} + ) diff --git a/contrib/kerneltesting/conv2d/OperationUtils.h b/contrib/kerneltesting/conv2d/OperationUtils.h new file mode 100644 index 000000000..0beac80a4 --- /dev/null +++ b/contrib/kerneltesting/conv2d/OperationUtils.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * 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 ANDROID_ML_NN_COMMON_OPERATIONS_UTILS_H +#define ANDROID_ML_NN_COMMON_OPERATIONS_UTILS_H + +#include +#include +#include + +#define LOG(ERROR) std::cerr + +// Macro to check if the input parameters for operation are valid or not. +#define NN_CHECK(v) \ + do { \ + if (!(v)) { \ + LOG(ERROR) << "NN_CHECK failed: " << #v << "'\n"; \ + return false; \ + } \ + } while(0); + +#define NN_CHECK_EQ(actual, expected) \ + NN_CHECK((actual) == (expected)) + +#define NN_OPS_CHECK NN_CHECK + +enum PaddingScheme { + kPaddingUnknown = 0, + kPaddingSame = 1, + kPaddingValid = 2, +}; + +enum class FusedActivationFunc : int32_t { + NONE = 0, + RELU = 1, + RELU1 = 2, + RELU6 = 3, +}; + + +#define ANDROID_NN_MACRO_DISPATCH(macro) \ + switch (activation) { \ + case (int32_t) FusedActivationFunc::NONE: \ + macro(kNone); \ + break; \ + case (int32_t) FusedActivationFunc::RELU: \ + macro(kRelu); \ + break; \ + case (int32_t) FusedActivationFunc::RELU1: \ + macro(kRelu1); \ + break; \ + case (int32_t) FusedActivationFunc::RELU6: \ + macro(kRelu6); \ + break; \ + default: \ + LOG(ERROR) << "Unsupported fused activation function type"; \ + return false; \ + } + + +#endif // ANDROID_ML_NN_COMMON_OPERATIONS_UTILS_H diff --git a/contrib/kerneltesting/conv2d/common.h b/contrib/kerneltesting/conv2d/common.h new file mode 100644 index 000000000..8e675e664 --- /dev/null +++ b/contrib/kerneltesting/conv2d/common.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * 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 ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_COMMON_H_ +#define ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_COMMON_H_ + +#ifndef USE_NEON +#if defined(__ARM_NEON__) || defined(__ARM_NEON) +#define USE_NEON +#include +#endif +#endif + +#include +#include "types.h" + +template +struct ActivationFunctionImpl {}; + +template <> +struct ActivationFunctionImpl { + static float Eval(float x) { return x; } +}; + +template <> +struct ActivationFunctionImpl { + static float Eval(float x) { return x < 0.f ? 0.f : x; } +}; + +template <> +struct ActivationFunctionImpl { + static float Eval(float x) { return x > 1.f ? 1.f : x < -1.f ? -1.f : x; } +}; + +template <> +struct ActivationFunctionImpl { + static float Eval(float x) { return x > 6.f ? 6.f : x < 0.f ? 0.f : x; } +}; + +template +float ActivationFunction(float x) { + return ActivationFunctionImpl::Eval(x); +} + +inline int32 MultiplyByQuantizedMultiplierSmallerThanOne( + int32 x, int32 quantized_multiplier, int right_shift) { + using gemmlowp::RoundingDivideByPOT; + using gemmlowp::SaturatingRoundingDoublingHighMul; + return RoundingDivideByPOT( + SaturatingRoundingDoublingHighMul(x, quantized_multiplier), right_shift); +} + +inline int32 MultiplyByQuantizedMultiplierGreaterThanOne( + int32 x, int32 quantized_multiplier, int left_shift) { + using gemmlowp::SaturatingRoundingDoublingHighMul; + return SaturatingRoundingDoublingHighMul(x * (1 << left_shift), + quantized_multiplier); +} + +#endif // ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_COMMON_H_ diff --git a/contrib/kerneltesting/conv2d/compatibility.h b/contrib/kerneltesting/conv2d/compatibility.h new file mode 100644 index 000000000..db8ba04bc --- /dev/null +++ b/contrib/kerneltesting/conv2d/compatibility.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * 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 ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_COMPATIBILITY_H_ +#define ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_COMPATIBILITY_H_ + +#ifndef ANDROID_ML_NN_COMPATIBILITY +#define ANDROID_ML_NN_COMPATIBILITY + +#include +#include + +#ifndef DCHECK +#define DCHECK(condition) (condition) ? (void)0 : assert(false) +#endif + +#ifndef DCHECK_EQ +#define DCHECK_EQ(x, y) ((x) == (y)) ? (void)0 : assert(false) +#endif + +#ifndef DCHECK_GE +#define DCHECK_GE(x, y) ((x) >= (y)) ? (void)0 : assert(false) +#endif + +#ifndef DCHECK_GT +#define DCHECK_GT(x, y) ((x) > (y)) ? (void)0 : assert(false) +#endif + +#ifndef DCHECK_LE +#define DCHECK_LE(x, y) ((x) <= (y)) ? (void)0 : assert(false) +#endif + +#ifndef DCHECK_LT +#define DCHECK_LT(x, y) ((x) < (y)) ? (void)0 : assert(false) +#endif + +#ifndef CHECK_EQ +#define CHECK_EQ(x, y) ((x) == (y)) ? (void)0 : assert(false) +#endif + +using uint8 = std::uint8_t; +using int16 = std::int16_t; +using uint16 = std::uint16_t; +using int32 = std::int32_t; +using uint32 = std::uint32_t; + +#endif + +#endif // ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_COMPATIBILITY_H_ diff --git a/contrib/kerneltesting/conv2d/io_accessor.cpp b/contrib/kerneltesting/conv2d/io_accessor.cpp new file mode 100644 index 000000000..6d3cd9d04 --- /dev/null +++ b/contrib/kerneltesting/conv2d/io_accessor.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "io_accessor.h" + +InputAccessor::InputAccessor(const float* inputData, const Shape& inputShape) + : _inputData(inputData) + , _inputShape(inputShape) +{ +} + +WeightAccessor::WeightAccessor(const float* filterData, const Shape& filterShape) + : _filterData(filterData) + , _filterShape(filterShape) +{ +} + +BiasAccessor::BiasAccessor(const float* biasData, const Shape& biasShape) + : _biasData(biasData) + , _biasShape(biasShape) +{ +} + +OutputAccessor::OutputAccessor(float* outputData, const Shape& outputShape) + : _outputData(outputData) + , _outputShape(outputShape) +{ +} + +bool InputAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + uint32_t width = getSizeOfDimension(_inputShape, 2); + uint32_t offset = id.y() * width + id.x(); + *reinterpret_cast(tensor.ptr_to_element(id)) = + *(_inputData + offset); + }); + return true; +} + +bool WeightAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + uint32_t width = getSizeOfDimension(_filterShape, 2); + uint32_t offset = id.y() * width + id.x(); + *reinterpret_cast(tensor.ptr_to_element(id)) = + *(_filterData + offset); + }); + return true; +} + +bool BiasAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + uint32_t width = getSizeOfDimension(_biasShape, 2); + uint32_t offset = id.y() * width + id.x(); + *reinterpret_cast(tensor.ptr_to_element(id)) = + *(_biasData + offset); + }); + return true; +} + +bool OutputAccessor::access_tensor(arm_compute::ITensor &tensor) +{ + arm_compute::Window window; + window.use_tensor_dimensions(tensor.info()->tensor_shape()); + + execute_window_loop(window, [&](const arm_compute::Coordinates& id) + { + uint32_t width = getSizeOfDimension(_outputShape, 2); + uint32_t offset = id.y() * width + id.x(); + *(_outputData + offset) = + *reinterpret_cast(tensor.ptr_to_element(id)); + }); + return false; // end the network +} diff --git a/contrib/kerneltesting/conv2d/io_accessor.h b/contrib/kerneltesting/conv2d/io_accessor.h new file mode 100644 index 000000000..0201f7242 --- /dev/null +++ b/contrib/kerneltesting/conv2d/io_accessor.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __CONV2D_IO_ACCESSOR_H__ +#define __CONV2D_IO_ACCESSOR_H__ + +#include +#include + +#include "types.h" + +class InputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + InputAccessor(const float* inputData, const Shape& inputShape); + InputAccessor(InputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + const float* _inputData; + const Shape& _inputShape; +}; + +class WeightAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + WeightAccessor(const float* filterData, const Shape& filterShape); + WeightAccessor(WeightAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + const float* _filterData; + const Shape& _filterShape; +}; + +class BiasAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + BiasAccessor(const float* biasData, const Shape& biasShape); + BiasAccessor(BiasAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + const float* _biasData; + const Shape& _biasShape; +}; + +class OutputAccessor : public arm_compute::graph::ITensorAccessor +{ +public: + OutputAccessor(float* outputData, const Shape& outputShape); + OutputAccessor(OutputAccessor&&) = default; + + // Inherited methods overriden: + bool access_tensor(arm_compute::ITensor& tensor) override; + +private: + float* _outputData; + const Shape& _outputShape; +}; + +#endif // __CONV2D_IO_ACCESSOR_H__ diff --git a/contrib/kerneltesting/conv2d/nnfw_conv2d_test.cpp b/contrib/kerneltesting/conv2d/nnfw_conv2d_test.cpp new file mode 100644 index 000000000..04b217595 --- /dev/null +++ b/contrib/kerneltesting/conv2d/nnfw_conv2d_test.cpp @@ -0,0 +1,607 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * Copyright (c) 2018 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include + +#include +#include + +#include "types.h" +#include "common.h" +#include "optimized_ops.h" +#include "OperationUtils.h" + +#include + +#include +#include + +#include "io_accessor.h" +#include "util/environment.h" + +static constexpr int kStaticBufferSize = 1605632; +static char static_scratch_buffer[kStaticBufferSize]; + +#define ANDROID_NN_CONV_PARAMETERS(Type) \ + uint32_t height = getSizeOfDimension(inputShape, 1); \ + uint32_t width = getSizeOfDimension(inputShape, 2); \ + uint32_t filterHeight = getSizeOfDimension(filterShape, 1); \ + uint32_t filterWidth = getSizeOfDimension(filterShape, 2); \ + uint32_t outHeight = getSizeOfDimension(outputShape, 1); \ + uint32_t outWidth = getSizeOfDimension(outputShape, 2); \ + uint32_t inDepth = getSizeOfDimension(inputShape, 3); \ + \ + uint32_t paddingHeight = (uint32_t)padding_top; \ + uint32_t paddingWidth = (uint32_t)padding_left; \ + \ + Dims<4> im2colDim; \ + im2colDim.sizes[3] = (int)getSizeOfDimension(outputShape, 0); \ + im2colDim.sizes[2] = (int)getSizeOfDimension(outputShape, 1); \ + im2colDim.sizes[1] = (int)getSizeOfDimension(outputShape, 2); \ + im2colDim.sizes[0] = (int)inDepth * filterHeight * filterWidth; \ + \ + im2colDim.strides[0] = 1; \ + for (int i=1; i<4; i++) { \ + im2colDim.strides[i] = im2colDim.strides[i-1] * im2colDim.sizes[i-1]; \ + } \ + \ + Type* im2colData = nullptr; \ + int im2colByteSize = sizeof(Type); \ + for (int i=0; i<4; i++) { \ + im2colByteSize *= im2colDim.sizes[i]; \ + } \ + if (im2colByteSize <= kStaticBufferSize) { \ + im2colData = reinterpret_cast(static_scratch_buffer); \ + } else { \ + im2colData = new (std::nothrow) Type[im2colByteSize / sizeof(Type)]; \ + } + + +bool convFloat32(const float* inputData, const Shape& inputShape, + const float* filterData, const Shape& filterShape, + const float* biasData, const Shape& biasShape, + int32_t padding_left, int32_t padding_right, + int32_t padding_top, int32_t padding_bottom, + int32_t stride_width, int32_t stride_height, + int32_t activation, + float* outputData, const Shape& outputShape) { + + ANDROID_NN_CONV_PARAMETERS(float) + + #define ANDROID_NN_CONV(activation) \ + Conv( \ + inputData, convertShapeToDims(inputShape), \ + filterData, convertShapeToDims(filterShape), \ + biasData, convertShapeToDims(biasShape), \ + stride_width, stride_height, paddingWidth, paddingHeight, \ + outputData, convertShapeToDims(outputShape), \ + im2colData, im2colDim) + + ANDROID_NN_MACRO_DISPATCH(ANDROID_NN_CONV) + + #undef ANDROID_NN_CONV + + if (im2colByteSize > kStaticBufferSize) { + delete[] im2colData; + } + return true; +} + +//----------------------------------------------------------------------------- + +using arm_compute::DataType; +using arm_compute::graph::Target; +using arm_compute::graph::TensorDescriptor; +using arm_compute::TensorShape; +using arm_compute::graph::frontend::InputLayer; +using arm_compute::graph::frontend::OutputLayer; + +namespace acl_graph { + +bool convFloat32(const float* inputData, const Shape& inputShape, + const float* filterData, const Shape& filterShape, + const float* biasData, const Shape& biasShape, + int32_t padding_left, int32_t padding_right, + int32_t padding_top, int32_t padding_bottom, + int32_t stride_width, int32_t stride_height, + int32_t activation, + float* outputData, const Shape& outputShape) +{ + // Try with simple build-run with ACL Layer + arm_compute::graph::frontend::Stream graph{0, "ACL_CONV2D_TEST"}; + + Target target_hint = nnfw::util::get_env_int("NNFW_ACL_USENEON") + ? Target::NEON : Target::CL; + + // Not sure about which index is which value + uint32_t tsi_c = getSizeOfDimension(inputShape, 0); + uint32_t tsi_h = getSizeOfDimension(inputShape, 1); + uint32_t tsi_w = getSizeOfDimension(inputShape, 2); + uint32_t tsi_n = getSizeOfDimension(inputShape, 3); + + uint32_t tsk_h = getSizeOfDimension(filterShape, 1); + uint32_t tsk_w = getSizeOfDimension(filterShape, 2); + uint32_t tsk_n = getSizeOfDimension(filterShape, 3); + + graph << target_hint + << InputLayer(TensorDescriptor(TensorShape(tsi_w, tsi_h, tsi_c, tsi_n), DataType::F32), + std::unique_ptr(new InputAccessor(inputData, inputShape))) + << arm_compute::graph::frontend::ConvolutionLayer( + tsk_w, tsk_h, tsk_n, + std::unique_ptr(new WeightAccessor(filterData, filterShape)), + std::unique_ptr(new BiasAccessor(biasData, biasShape)), + arm_compute::PadStrideInfo(stride_width, stride_height, padding_top, padding_bottom)) + ; + if (activation != static_cast(FusedActivationFunc::NONE)) { + arm_compute::ActivationLayerInfo::ActivationFunction actFunc = + arm_compute::ActivationLayerInfo::ActivationFunction::RELU; + + graph << arm_compute::graph::frontend::ActivationLayer(arm_compute::ActivationLayerInfo(actFunc)); + // Activation does not provide output Tensor and makes next layer fail to add to graph + // when it's the last(output) layer. To solve this, need to add a dummy layer. + uint32_t tso_c = getSizeOfDimension(outputShape, 0); + uint32_t tso_h = getSizeOfDimension(outputShape, 1); + uint32_t tso_w = getSizeOfDimension(outputShape, 2); + uint32_t tso_n = getSizeOfDimension(outputShape, 3); + graph << arm_compute::graph::frontend::ReshapeLayer(TensorShape(tso_w, tso_h, tso_c, tso_n)); + } + graph << OutputLayer(std::unique_ptr(new OutputAccessor(outputData, outputShape))) + ; + + graph.run(); + + return true; +} + +} // namespace acl_graph + +//----------------------------------------------------------------------------- + +using arm_compute::TensorInfo; + +namespace acl_runtime { + +TensorShape calculate_convolution_layer_output_shape( + const arm_compute::TensorShape &input_shape, + const arm_compute::TensorShape &weights_shape, + const arm_compute::PadStrideInfo &conv_info) +{ + unsigned int output_width = 0; + unsigned int output_height = 0; + + // Get output width and height + std::tie(output_width, output_height) = + arm_compute::scaled_dimensions( + input_shape.x(), input_shape.y(), + weights_shape.x(), weights_shape.y(), + conv_info); + + // Create output shape + TensorShape output_shape = input_shape; + output_shape.set(0, output_width); + output_shape.set(1, output_height); + output_shape.set(2, weights_shape[3]); + + return output_shape; +} + +bool convFloat32(const float* inputData, const Shape& inputShape, + const float* filterData, const Shape& filterShape, + const float* biasData, const Shape& biasShape, + int32_t padding_left, int32_t padding_right, + int32_t padding_top, int32_t padding_bottom, + int32_t stride_width, int32_t stride_height, + int32_t activation, + float* outputData, const Shape& outputShape) +{ + arm_compute::CLScheduler::get().default_init(); + + uint32_t tsi_c = getSizeOfDimension(inputShape, 0); + uint32_t tsi_h = getSizeOfDimension(inputShape, 1); + uint32_t tsi_w = getSizeOfDimension(inputShape, 2); + uint32_t tsi_n = getSizeOfDimension(inputShape, 3); + + uint32_t tsk_h = getSizeOfDimension(filterShape, 1); + uint32_t tsk_w = getSizeOfDimension(filterShape, 2); + uint32_t tsk_n = getSizeOfDimension(filterShape, 3); + + TensorShape input_shape = TensorShape(tsi_w, tsi_h, tsi_c, tsi_n); + TensorShape filter_shape = TensorShape(tsi_w, tsi_h, tsi_c, tsi_n); + arm_compute::PadStrideInfo conv_info = + arm_compute::PadStrideInfo(stride_width, stride_height, padding_top, padding_bottom); + + TensorShape output_shape = calculate_convolution_layer_output_shape( + input_shape, filter_shape, conv_info); + + uint32_t tso_c = output_shape[0]; + uint32_t tso_w = output_shape[1]; + uint32_t tso_h = output_shape[2]; + uint32_t tso_n = output_shape[3]; + + arm_compute::CLTensor input, output, bias, filter; + + input.allocator()->init(TensorInfo(tsi_w, tsi_h, arm_compute::Format::F32)); + output.allocator()->init(TensorInfo(tso_w, tso_h, arm_compute::Format::F32)); + bias.allocator()->init(TensorInfo(tso_w, tso_h, arm_compute::Format::F32)); + filter.allocator()->init(TensorInfo(tsk_w, tsk_h, arm_compute::Format::F32)); + + input.allocator()->allocate(); + output.allocator()->allocate(); + bias.allocator()->allocate(); + filter.allocator()->allocate(); + + input.map(); + InputAccessor ia(inputData, inputShape); + ia.access_tensor(input); + input.unmap(); + + bias.map(); + BiasAccessor ba(biasData, biasShape); + ba.access_tensor(bias); + bias.unmap(); + + filter.map(); + WeightAccessor fa(filterData, filterShape); + fa.access_tensor(filter); + filter.unmap(); + + arm_compute::CLConvolutionLayer conv_f; + conv_f.configure(&input, &filter, &bias, &output, conv_info); + + arm_compute::CLScheduler::get().sync(); + + conv_f.run(); + + output.map(); + OutputAccessor oa(outputData, outputShape); + oa.access_tensor(output); + output.unmap(); + + return true; +} + +} // namespace acl_runtime + +//----------------------------------------------------------------------------- + +enum COMPUTE_TYPE { + COMPUTE_DEFAULT = 0, + COMPUTE_ACLGRAPH, + COMPUTE_ACLRT +}; + +bool convFloat32(const float* inputData, const Shape& inputShape, + const float* filterData, const Shape& filterShape, + const float* biasData, const Shape& biasShape, + int32_t padding_left, int32_t padding_right, + int32_t padding_top, int32_t padding_bottom, + int32_t stride_width, int32_t stride_height, + int32_t activation, + float* outputData, const Shape& outputShape, + COMPUTE_TYPE compType) { + + switch (compType) + { + case COMPUTE_DEFAULT : + return convFloat32(inputData, inputShape, filterData, filterShape, + biasData, biasShape, padding_left, padding_right, + padding_top, padding_bottom, stride_width, stride_height, + activation, outputData, outputShape); + + case COMPUTE_ACLGRAPH : + return acl_graph::convFloat32(inputData, inputShape, filterData, filterShape, + biasData, biasShape, padding_left, padding_right, + padding_top, padding_bottom, stride_width, stride_height, + activation, outputData, outputShape); + + case COMPUTE_ACLRT : + return acl_runtime::convFloat32(inputData, inputShape, filterData, filterShape, + biasData, biasShape, padding_left, padding_right, + padding_top, padding_bottom, stride_width, stride_height, + activation, outputData, outputShape); + } + return false; +} + +//----------------------------------------------------------------------------- + +void dumpData(const char* name, const float* data, const Shape& shape) +{ + uint32_t height = getSizeOfDimension(shape, 1); + uint32_t width = getSizeOfDimension(shape, 2); + + std::cout << "---" << name << "---" << std::endl; + for (int h = 0; h < height; h++) { + std::cout << "H=" << h << " | "; + for (int w = 0; w < width; w++) { + std::cout << data[h * width + w] << ","; + } + std::cout << std::endl; + } +} + +void initData(float* outputData, int num, float value) +{ + for (int i = 0; i < num; i++) { + *(outputData + i) = value; + } +} + +void initDataSeq(float* outputData, int num, float value) +{ + for (int i = 0; i < num; i++) { + *(outputData + i) = value; + value += 1.0; + } +} + +// compareData +// return true if result == expected with the shape info, +// otherwise false +bool compareData(const float* result, const float* expected, const Shape& shape) +{ + NN_CHECK_EQ(shape.dimensions.size(), 4); + + uint32_t height = getSizeOfDimension(shape, 1); + uint32_t width = getSizeOfDimension(shape, 2); + uint32_t numitems = height * width; + for (int item = 0; item < numitems; item++) { + if (*(result + item) != *(expected + item)) { + LOG(ERROR) << "compareData failed: result " << *(result + item) + << ", expected " << *(expected + item) << std::endl; + return false; + } + } + return true; +} + +int test_3x3_1x1_one(COMPUTE_TYPE comptype) +{ + float inputData[9]; + const Shape inputShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float filterData[9]; + const Shape filterShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float biasData[1] = { 1.0 }; + const Shape biasShape = { OperandType::FLOAT32, {1,1,1,1}, 1.0, 0 }; + int32_t padding_left = 0; + int32_t padding_right = 0; + int32_t padding_top = 0; + int32_t padding_bottom = 0; + int32_t stride_width = 1; + int32_t stride_height = 1; + int32_t activation = static_cast(FusedActivationFunc::RELU); + float* outputData = new float[9]; + const Shape outputShape = { OperandType::FLOAT32, {1,1,1,1}, 1.0, 0 }; + float* expectData = new float[9]; + bool bret; + + initData(inputData, sizeof(inputData) / sizeof(inputData[0]), 1.0); + initData(filterData, sizeof(filterData) / sizeof(filterData[0]), 1.0); + initData(outputData, sizeof(outputData) / sizeof(outputData[0]), 0.0); + initData(expectData, sizeof(expectData) / sizeof(expectData[0]), 0.0); + + bret = convFloat32(inputData, inputShape, + filterData, filterShape, + biasData, biasShape, + padding_left, padding_right, + padding_top, padding_bottom, + stride_width, stride_height, + activation, + expectData, outputShape, + COMPUTE_DEFAULT); + + bret = convFloat32(inputData, inputShape, + filterData, filterShape, + biasData, biasShape, + padding_left, padding_right, + padding_top, padding_bottom, + stride_width, stride_height, + activation, + outputData, outputShape, + comptype); + + dumpData("Input ", inputData, inputShape); + dumpData("Filter ", filterData, filterShape); + dumpData("Bias ", biasData, biasShape); + dumpData("Output ", outputData, outputShape); + std::cout << std::endl; + + bret = compareData(outputData, expectData, outputShape); + + delete outputData; + delete expectData; + + if (!bret) + { + LOG(ERROR) << "TEST FAILED " << __FUNCTION__ << std::endl; + return -1; + } + return 0; +} + +int test_3x3_3x3_one(void) +{ + float inputData[9]; + const Shape inputShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float filterData[9]; + const Shape filterShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float biasData[1] = { 1.0 }; + const Shape biasShape = { OperandType::FLOAT32, {1,1,1,1}, 1.0, 0 }; + int32_t padding_left = 1; + int32_t padding_right = 1; + int32_t padding_top = 1; + int32_t padding_bottom = 1; + int32_t stride_width = 1; + int32_t stride_height = 1; + int32_t activation = static_cast(FusedActivationFunc::RELU); + float* outputData = new float[9]; + const Shape outputShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float* expectData = new float[9]; + bool bret; + + initData(inputData, sizeof(inputData) / sizeof(inputData[0]), 1.0); + initData(filterData, sizeof(filterData) / sizeof(filterData[0]), 1.0); + initData(outputData, sizeof(outputData) / sizeof(outputData[0]), 0.0); + initData(expectData, sizeof(expectData) / sizeof(expectData[0]), 0.0); + + bret = convFloat32(inputData, inputShape, + filterData, filterShape, + biasData, biasShape, + padding_left, padding_right, + padding_top, padding_bottom, + stride_width, stride_height, + activation, + expectData, outputShape, + COMPUTE_DEFAULT); + + bret = convFloat32(inputData, inputShape, + filterData, filterShape, + biasData, biasShape, + padding_left, padding_right, + padding_top, padding_bottom, + stride_width, stride_height, + activation, + outputData, outputShape, + COMPUTE_ACLGRAPH); + + dumpData("Input ", inputData, inputShape); + dumpData("Filter ", filterData, filterShape); + dumpData("Bias ", biasData, biasShape); + dumpData("Output ", outputData, outputShape); + std::cout << std::endl; + + bret = compareData(outputData, expectData, outputShape); + + delete outputData; + delete expectData; + + if (!bret) + { + LOG(ERROR) << "TEST FAILED " << __FUNCTION__ << std::endl; + return -1; + } + return 0; +} + +int test_3x3_3x3_seq(void) +{ + float inputData[9]; + const Shape inputShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float filterData[9]; + const Shape filterShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float biasData[1] = { 1.0 }; + const Shape biasShape = { OperandType::FLOAT32, {1,1,1,1}, 1.0, 0 }; + int32_t padding_left = 1; + int32_t padding_right = 1; + int32_t padding_top = 1; + int32_t padding_bottom = 1; + int32_t stride_width = 1; + int32_t stride_height = 1; + int32_t activation = static_cast(FusedActivationFunc::RELU); + float* outputData = new float[9]; + const Shape outputShape = { OperandType::FLOAT32, {1,3,3,1}, 1.0, 0 }; + float* expectData = new float[9]; + bool bret; + + initDataSeq(inputData, sizeof(inputData) / sizeof(inputData[0]), 1.0); + initDataSeq(filterData, sizeof(filterData) / sizeof(filterData[0]), 1.0); + initDataSeq(outputData, sizeof(outputData) / sizeof(outputData[0]), 0.0); + initData(expectData, sizeof(expectData) / sizeof(expectData[0]), 0.0); + + bret = convFloat32(inputData, inputShape, + filterData, filterShape, + biasData, biasShape, + padding_left, padding_right, + padding_top, padding_bottom, + stride_width, stride_height, + activation, + expectData, outputShape, + COMPUTE_DEFAULT); + + bret = convFloat32(inputData, inputShape, + filterData, filterShape, + biasData, biasShape, + padding_left, padding_right, + padding_top, padding_bottom, + stride_width, stride_height, + activation, + outputData, outputShape, + COMPUTE_ACLGRAPH); + + dumpData("Input ", inputData, inputShape); + dumpData("Filter ", filterData, filterShape); + dumpData("Bias ", biasData, biasShape); + dumpData("Output ", outputData, outputShape); + std::cout << std::endl; + + bret = compareData(outputData, expectData, outputShape); + + delete outputData; + delete expectData; + + if (!bret) + { + LOG(ERROR) << "TEST FAILED " << __FUNCTION__ << std::endl; + return -1; + } + return 0; +} + +int main(int argc, char* argv[]) +{ + int result; + + // input 3x3, output 1x1, all data 1.0 + result = test_3x3_1x1_one(COMPUTE_ACLGRAPH); + if (result) return result; + result = test_3x3_1x1_one(COMPUTE_ACLRT); + if (result) return result; + + // input 3x3, output 3x3, all data 1.0 + result = test_3x3_3x3_one(); + if (result) return result; + + result = test_3x3_3x3_seq(); + if (result) return result; + + return result; +} diff --git a/contrib/kerneltesting/conv2d/optimized_ops.h b/contrib/kerneltesting/conv2d/optimized_ops.h new file mode 100644 index 000000000..1d8c4ff28 --- /dev/null +++ b/contrib/kerneltesting/conv2d/optimized_ops.h @@ -0,0 +1,339 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * 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 ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_OPS_H_ +#define ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_OPS_H_ + +// Make a local VectorMap typedef allowing to map a float array +// as a Eigen matrix expression. The same explanation as for VectorMap +// above also applies here. +template +using MatrixMap = typename std::conditional< + std::is_const::value, + Eigen::Map::type, + Eigen::Dynamic, Eigen::Dynamic>>, + Eigen::Map>>::type; + +template +MatrixMap MapAsMatrixWithFirstDimAsRows(Scalar* data, + const Dims& dims) { + const int rows = dims.sizes[0]; + int cols = 1; + for (int d = 1; d < N; d++) { + cols *= dims.sizes[d]; + } + return MatrixMap(data, rows, cols); +} + +template +MatrixMap MapAsMatrixWithLastDimAsCols(Scalar* data, + const Dims& dims) { + const int cols = dims.sizes[N - 1]; + int rows = 1; + for (int d = 0; d < N - 1; d++) { + rows *= dims.sizes[d]; + } + return MatrixMap(data, rows, cols); +} + +template +inline void ExtractPatchIntoBufferColumn( + const Dims<4>& input_dims, int w, int h, int b, int kheight, int kwidth, + int stride_width, int stride_height, int pad_width, int pad_height, + int in_width, int in_height, int in_depth, int single_buffer_length, + int buffer_id, const T* in_data, T* conv_buffer_data, uint8 byte_zero) { + gemmlowp::ScopedProfilingLabel label("ExtractPatchIntoBufferColumn"); + // This chunk of code reshapes all the inputs corresponding to + // output (b, h, w) to a column vector in conv_buffer(:, buffer_id). + const int kwidth_times_indepth = kwidth * in_depth; + const int inwidth_times_indepth = in_width * in_depth; + const int ih_ungated_start = h * stride_height - pad_height; + const int ih_ungated_end = (ih_ungated_start + kheight); + const int ih_end = std::min(ih_ungated_end, in_height); + const int iw_ungated_start = w * stride_width - pad_width; + const int iw_ungated_end = (iw_ungated_start + kwidth); + const int iw_end = std::min(iw_ungated_end, in_width); + // If the patch is off the edge of the input image, skip writing those rows + // and columns from the patch into the output array. + const int h_offset = std::max(0, -ih_ungated_start); + const int w_offset = std::max(0, -iw_ungated_start); + const int ih_start = std::max(0, ih_ungated_start); + const int iw_start = std::max(0, iw_ungated_start); + const int single_row_num = + std::min(kwidth - w_offset, in_width - iw_start) * in_depth; + const int output_row_offset = (buffer_id * single_buffer_length); + int out_offset = + output_row_offset + (h_offset * kwidth + w_offset) * in_depth; + int in_offset = Offset(input_dims, 0, iw_start, ih_start, b); + + // Express all of the calculations as padding around the input patch. + const int top_padding = h_offset; + const int bottom_padding = (ih_ungated_end - ih_end); + const int left_padding = w_offset; + const int right_padding = (iw_ungated_end - iw_end); + assert(single_row_num == + ((kwidth - (left_padding + right_padding)) * in_depth)); + + // Write out zeroes to the elements representing the top rows of the input + // patch that are off the edge of the input image. + if (top_padding > 0) { + const int top_row_elements = (top_padding * kwidth * in_depth); + memset(conv_buffer_data + output_row_offset, byte_zero, + (top_row_elements * sizeof(T))); + } + + // If the patch is on the interior of the input image horizontally, just copy + // over the rows sequentially, otherwise add zero padding at the start or end. + if ((left_padding == 0) && (right_padding == 0)) { + for (int ih = ih_start; ih < ih_end; ++ih) { + memcpy(conv_buffer_data + out_offset, in_data + in_offset, + single_row_num * sizeof(T)); + out_offset += kwidth_times_indepth; + in_offset += inwidth_times_indepth; + } + } else { + for (int ih = ih_start; ih < ih_end; ++ih) { + if (left_padding > 0) { + const int left_start = (out_offset - (left_padding * in_depth)); + memset(conv_buffer_data + left_start, byte_zero, + (left_padding * in_depth * sizeof(T))); + } + memcpy(conv_buffer_data + out_offset, in_data + in_offset, + single_row_num * sizeof(T)); + if (right_padding > 0) { + const int right_start = (out_offset + single_row_num); + memset(conv_buffer_data + right_start, byte_zero, + (right_padding * in_depth * sizeof(T))); + } + out_offset += kwidth_times_indepth; + in_offset += inwidth_times_indepth; + } + } + + // If the bottom of the patch falls off the input image, pad the values + // representing those input rows with zeroes. + if (bottom_padding > 0) { + const int bottom_row_elements = (bottom_padding * kwidth * in_depth); + const int bottom_start = + output_row_offset + + ((top_padding + (ih_end - ih_start)) * kwidth * in_depth); + memset(conv_buffer_data + bottom_start, byte_zero, + (bottom_row_elements * sizeof(T))); + } +} + +#ifdef USE_NEON +template +void AddBiasAndEvalActivationFunction(const float* bias_data, + const Dims<4>& bias_dims, + float* array_data, + const Dims<4>& array_dims) { + gemmlowp::ScopedProfilingLabel label("AddBiasAndEvalActivationFunction"); + const int bias_size = bias_dims.sizes[3] * bias_dims.strides[3]; + const int array_size = array_dims.sizes[3] * array_dims.strides[3]; + DCHECK_EQ((array_size % bias_size), 0); + float* array_ptr = array_data; + float* array_end_ptr = array_ptr + array_size; + const auto zero = vdupq_n_f32(0); + const auto six = vdupq_n_f32(6); + const auto neg_one = vdupq_n_f32(-1); + const auto one = vdupq_n_f32(1); + for (; array_ptr != array_end_ptr; array_ptr += bias_size) { + int i = 0; + for (; i <= bias_size - 16; i += 16) { + auto b0 = vld1q_f32(bias_data + i); + auto b1 = vld1q_f32(bias_data + i + 4); + auto b2 = vld1q_f32(bias_data + i + 8); + auto b3 = vld1q_f32(bias_data + i + 12); + auto a0 = vld1q_f32(array_ptr + i); + auto a1 = vld1q_f32(array_ptr + i + 4); + auto a2 = vld1q_f32(array_ptr + i + 8); + auto a3 = vld1q_f32(array_ptr + i + 12); + auto x0 = vaddq_f32(a0, b0); + auto x1 = vaddq_f32(a1, b1); + auto x2 = vaddq_f32(a2, b2); + auto x3 = vaddq_f32(a3, b3); + if (Ac == FusedActivationFunctionType::kRelu || + Ac == FusedActivationFunctionType::kRelu6) { + x0 = vmaxq_f32(zero, x0); + x1 = vmaxq_f32(zero, x1); + x2 = vmaxq_f32(zero, x2); + x3 = vmaxq_f32(zero, x3); + if (Ac == FusedActivationFunctionType::kRelu6) { + x0 = vminq_f32(six, x0); + x1 = vminq_f32(six, x1); + x2 = vminq_f32(six, x2); + x3 = vminq_f32(six, x3); + } + } else if (Ac == FusedActivationFunctionType::kRelu1) { + x0 = vmaxq_f32(neg_one, x0); + x1 = vmaxq_f32(neg_one, x1); + x2 = vmaxq_f32(neg_one, x2); + x3 = vmaxq_f32(neg_one, x3); + x0 = vminq_f32(one, x0); + x1 = vminq_f32(one, x1); + x2 = vminq_f32(one, x2); + x3 = vminq_f32(one, x3); + } + vst1q_f32(array_ptr + i, x0); + vst1q_f32(array_ptr + i + 4, x1); + vst1q_f32(array_ptr + i + 8, x2); + vst1q_f32(array_ptr + i + 12, x3); + } + for (; i <= bias_size - 4; i += 4) { + auto b = vld1q_f32(bias_data + i); + auto a = vld1q_f32(array_ptr + i); + auto x = vaddq_f32(a, b); + if (Ac == FusedActivationFunctionType::kRelu || + Ac == FusedActivationFunctionType::kRelu6) { + x = vmaxq_f32(zero, x); + if (Ac == FusedActivationFunctionType::kRelu6) { + x = vminq_f32(six, x); + } + } else if (Ac == FusedActivationFunctionType::kRelu1) { + x = vmaxq_f32(neg_one, x); + x = vminq_f32(one, x); + } + vst1q_f32(array_ptr + i, x); + } + for (; i < bias_size; i++) { + array_ptr[i] = ActivationFunction(array_ptr[i] + bias_data[i]); + } + } +} +#else // not NEON +template +void AddBiasAndEvalActivationFunction(const float* bias_data, + const Dims<4>& bias_dims, + float* array_data, + const Dims<4>& array_dims) { + gemmlowp::ScopedProfilingLabel label("AddBiasAndEvalActivationFunction"); + const int bias_size = bias_dims.sizes[3] * bias_dims.strides[3]; + const int array_size = array_dims.sizes[3] * array_dims.strides[3]; + DCHECK_EQ((array_size % bias_size), 0); + for (int array_offset = 0; array_offset < array_size; + array_offset += bias_size) { + for (int i = 0; i < bias_size; i++) { + array_data[array_offset + i] = + ActivationFunction(array_data[array_offset + i] + bias_data[i]); + } + } +} +#endif + +template +void Gemm(const Eigen::MatrixBase& lhs, const Eigen::MatrixBase& rhs, + Eigen::MatrixBase* result) { + if (rhs.cols() == 1) { + gemmlowp::ScopedProfilingLabel label("GEMV"); + result->col(0).noalias() = lhs * rhs.col(0); + } else { + gemmlowp::ScopedProfilingLabel label("GEMM"); + result->noalias() = lhs * rhs; + } +} + +template +void Im2col(const T* input_data, const Dims<4>& input_dims, int stride_width, + int stride_height, int pad_width, int pad_height, int kheight, + int kwidth, uint8 byte_zero, T* output_data, + const Dims<4>& output_dims) { + gemmlowp::ScopedProfilingLabel label("Im2col"); + DCHECK(IsPackedWithoutStrides(input_dims)); + DCHECK(IsPackedWithoutStrides(output_dims)); + const int batches = MatchingArraySize(input_dims, 3, output_dims, 3); + const int input_depth = ArraySize(input_dims, 0); + const int input_width = ArraySize(input_dims, 1); + const int input_height = ArraySize(input_dims, 2); + const int output_depth = ArraySize(output_dims, 0); + const int output_width = ArraySize(output_dims, 1); + const int output_height = ArraySize(output_dims, 2); + + int buffer_id = 0; + // Loop over the output nodes. + for (int b = 0; b < batches; ++b) { + for (int h = 0; h < output_height; ++h) { + for (int w = 0; w < output_width; ++w) { + ExtractPatchIntoBufferColumn( + input_dims, w, h, b, kheight, kwidth, stride_width, stride_height, + pad_width, pad_height, input_width, input_height, input_depth, + output_depth, buffer_id, input_data, output_data, byte_zero); + ++buffer_id; + } + } + } +} + +template +void Conv(const float* input_data, const Dims<4>& input_dims, + const float* filter_data, const Dims<4>& filter_dims, + const float* bias_data, const Dims<4>& bias_dims, int stride_width, + int stride_height, int pad_width, int pad_height, float* output_data, + const Dims<4>& output_dims, float* im2col_data, + const Dims<4>& im2col_dims) { + (void)im2col_data; + (void)im2col_dims; + gemmlowp::ScopedProfilingLabel label("Conv"); + + const float* gemm_input_data = nullptr; + const Dims<4>* gemm_input_dims = nullptr; + const int filter_width = ArraySize(filter_dims, 1); + const int filter_height = ArraySize(filter_dims, 2); + const bool need_im2col = stride_width != 1 || stride_height != 1 || + filter_width != 1 || filter_height != 1; + if (need_im2col) { + DCHECK(im2col_data); + Im2col(input_data, input_dims, stride_width, stride_height, pad_width, + pad_height, filter_height, filter_width, 0, im2col_data, + im2col_dims); + gemm_input_data = im2col_data; + gemm_input_dims = &im2col_dims; + } else { + DCHECK(!im2col_data); + gemm_input_data = input_data; + gemm_input_dims = &input_dims; + } + + const auto im2col_matrix_map = + MapAsMatrixWithFirstDimAsRows(gemm_input_data, *gemm_input_dims); + const auto filter_matrix_map = + MapAsMatrixWithLastDimAsCols(filter_data, filter_dims); + auto output_matrix_map = + MapAsMatrixWithFirstDimAsRows(output_data, output_dims); + + Gemm(filter_matrix_map.transpose(), im2col_matrix_map, &output_matrix_map); + + AddBiasAndEvalActivationFunction(bias_data, bias_dims, output_data, + output_dims); +} + +#endif // ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_OPS_H_ diff --git a/contrib/kerneltesting/conv2d/types.h b/contrib/kerneltesting/conv2d/types.h new file mode 100644 index 000000000..3d09457c7 --- /dev/null +++ b/contrib/kerneltesting/conv2d/types.h @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/* + * 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 ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_TYPES_H_ +#define ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_TYPES_H_ + +enum class OperandType : int32_t { + FLOAT32 = 0, + INT32 = 1, + UINT32 = 2, + TENSOR_FLOAT32 = 3, + TENSOR_INT32 = 4, + TENSOR_QUANT8_ASYMM = 5, + OEM = 10000, + TENSOR_OEM_BYTE = 10001, +}; + +#include "compatibility.h" + +enum class FusedActivationFunctionType { kNone, kRelu6, kRelu1, kRelu }; + +template +struct Dims { + int sizes[N]; + int strides[N]; +}; + +// The type and dimensions of an operand. +struct Shape { + OperandType type; + std::vector dimensions; + float scale; + int32_t offset; +}; + +inline uint32_t getSizeOfDimension(const Shape& shape, uint32_t dimensionIdx) { + if (dimensionIdx >= shape.dimensions.size()) { + // TODO, log the error + return 0; + } + return shape.dimensions[dimensionIdx]; +} + +inline Dims<4> convertShapeToDims(const Shape& shape) { + Dims<4> dims; + for (int i=0; i<4; i++) { + dims.sizes[i] = 1; + } + + if (shape.dimensions.size() == 1) { + dims.sizes[0] = (int)getSizeOfDimension(shape, 0); + } else { + for (int i=0; i<4; i++) { + int src = (int)shape.dimensions.size()-i-1; + if (src >= 0) { + dims.sizes[i] = (int)getSizeOfDimension(shape, src); + } + } + } + + dims.strides[0] = 1; + for (int i = 1; i<4; i++) { + dims.strides[i] = dims.strides[i-1] * dims.sizes[i-1]; + } + return dims; +} + +inline int Offset(const Dims<4>& dims, int i0, int i1, int i2, int i3) { + DCHECK(i0 >= 0 && i0 < dims.sizes[0]); + DCHECK(i1 >= 0 && i1 < dims.sizes[1]); + DCHECK(i2 >= 0 && i2 < dims.sizes[2]); + DCHECK(i3 >= 0 && i3 < dims.sizes[3]); + return i0 * dims.strides[0] + i1 * dims.strides[1] + i2 * dims.strides[2] + + i3 * dims.strides[3]; +} + +// Get array size, DCHECKing that the dim index is in range. +template +int ArraySize(const Dims& array, int index) { + DCHECK(index >= 0 && index < N); + return array.sizes[index]; +} + +// Get common array size, DCHECKing that they all agree. +template +int MatchingArraySize(const ArrayType1& array1, int index1, + const ArrayType2& array2, int index2) { + DCHECK_EQ(ArraySize(array1, index1), ArraySize(array2, index2)); + return ArraySize(array1, index1); +} + +template +int MatchingArraySize(const ArrayType1& array1, int index1, + const ArrayType2& array2, int index2, Args... args) { + DCHECK_EQ(ArraySize(array1, index1), ArraySize(array2, index2)); + return MatchingArraySize(array1, index1, args...); +} + +inline int RequiredBufferSizeForDims(const Dims<4>& dims) { + int max_offset = 0; + for (int i = 0; i < 4; i++) { + max_offset += (dims.sizes[i] - 1) * dims.strides[i]; + } + return max_offset + 1; +} + +template +bool IsPackedWithoutStrides(const Dims& dims) { + int expected_stride = 1; + for (int d = 0; d < N; d++) { + if (dims.strides[d] != expected_stride) return false; + expected_stride *= dims.sizes[d]; + } + return true; +} + +#endif // ANDROID_ML_NN_COMMON_OPERATIONS_INTERNAL_TYPES_H_ diff --git a/contrib/opencl_test/CMakeLists.txt b/contrib/opencl_test/CMakeLists.txt new file mode 100644 index 000000000..45b07e181 --- /dev/null +++ b/contrib/opencl_test/CMakeLists.txt @@ -0,0 +1,11 @@ +if(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + return() +endif(NOT ${TARGET_ARCH_BASE} STREQUAL "arm") + +list(APPEND OPENCL_INFO_SOURCE "src/opencl_test.cc") + +add_executable(opencl_test ${OPENCL_INFO_SOURCE}) +target_include_directories(opencl_test PUBLIC ${CMAKE_SOURCE_DIR}/externals/acl) +target_include_directories(opencl_test PUBLIC ${CMAKE_SOURCE_DIR}/externals/acl/include) +target_link_libraries(opencl_test arm_compute) + diff --git a/contrib/opencl_test/README.md b/contrib/opencl_test/README.md new file mode 100644 index 000000000..950528f81 --- /dev/null +++ b/contrib/opencl_test/README.md @@ -0,0 +1,8 @@ +This directory contains experients of OpenCL code. + +How to run: +``` +LD_LIBRARY_PATH=Product/out/lib Product/obj/contrib/opencl_test/opencl_test [option] +``` + - `[option]` + - `-g`: prints devices inside GPU and check if they use same memory address diff --git a/contrib/opencl_test/src/opencl_test.cc b/contrib/opencl_test/src/opencl_test.cc new file mode 100644 index 000000000..5364e55d8 --- /dev/null +++ b/contrib/opencl_test/src/opencl_test.cc @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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. + */ + +/******************************************************************************* + * Copyright (c) 2008-2015 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + ******************************************************************************/ + +#include "arm_compute/core/CL/OpenCL.h" + +#include +#include + +void printDeviceInfo(int n, cl::Device &device, cl::Device &default_device) +{ + bool is_default = (device() == default_device()); + std::cout << "\t\t\t#" << n << " Device: (id: " << device() << ") " + << (is_default ? " -> default" : "") << "\n"; + + const auto name = device.getInfo(); + std::cout << "\t\t\t\tName: " << name << "\n"; + + const auto compute_unit = device.getInfo(); + std::cout << "\t\t\t\tMax Compute Unit: " << compute_unit << "\n"; + + const auto max_work_item_size = device.getInfo(); + std::cout << "\t\t\t\tMax Work Item Size: ["; + for (auto size : max_work_item_size) + std::cout << size << ","; + std::cout << "]\n"; + + const auto max_work_group_size = device.getInfo(); + std::cout << "\t\t\t\tMax Work Grpup Size: " << max_work_group_size << "\n"; + + const auto max_clock_frequency = device.getInfo(); + std::cout << "\t\t\t\tMax Clock Frequency: " << max_clock_frequency << "\n"; + + std::cout << "\n"; +} + +void checkContextMem() +{ + // get context, devices + // + std::cout << "\nChecking if devices in GPU shares the same memory address:\n\n"; + + cl_int cl_error; + + cl::Platform platform = cl::Platform::getDefault(); + cl::Context context; + try + { + cl_context_properties properties[3] = { + CL_CONTEXT_PLATFORM, (cl_context_properties)platform(), 0 + }; + + context = cl::Context(CL_DEVICE_TYPE_GPU, properties, NULL, NULL, &cl_error); + } + catch (cl::Error &err) // thrown when there is no Context for this platform + { + std::cout << "\t\t No Context Found\n"; + return; + } + + std::cout << "\nDevices in GPU:\n\n"; + + auto devices = context.getInfo(); + auto default_device = cl::Device::getDefault(); + + int d = 0; + for (auto device : devices) + printDeviceInfo(++d, device, default_device); + + if (d < 2) + { + std::cout << "\t\t This options works when there are n (>= 2) devices.\n"; + return; + } + + // allocate and map memory + + typedef cl_int T; + const int items_per_device = 128; + const int length = items_per_device * devices.size(); + + std::vector input(length); + std::vector output(length, 0); + + for (int i = 0; i < length; i++) + input[i] = i; + + cl::Buffer input_buf(context, (cl_mem_flags)CL_MEM_USE_HOST_PTR, length*sizeof(T), input.data(), &cl_error); + cl::Buffer output_buf(context, (cl_mem_flags)CL_MEM_USE_HOST_PTR, length*sizeof(T), input.data(), &cl_error); + + // compile test cl code + + std::string kernel_source { + "typedef int T; \n" \ + "kernel void memory_test( \n" \ + " const int dev_id, \n" \ + " global T* input, \n" \ + " global T* output, \n" \ + " const int start_idx, \n" \ + " const int count) \n" \ + "{ \n" \ + " int input_idx = get_global_id(0); \n" \ + " if(input_idx < count) \n" \ + " { \n" \ + " int output_idx = start_idx + input_idx; \n" \ + " output[output_idx] = input[input_idx] + dev_id; \n" \ + " } \n" \ + "} \n" + }; + + std::vector programStrings {kernel_source}; + + cl::Program program(context, programStrings); + + try + { + program.build("-cl-std=CL1.2"); + } + catch (cl::Error &err) + { + cl_int buildErr = CL_SUCCESS; + auto buildInfo = program.getBuildInfo(&buildErr); + for (auto &pair : buildInfo) { + std::cerr << pair.second << std::endl << std::endl; + } + } + + try + { + auto kernel_functor = cl::KernelFunctor + (program, "memory_test"); // name should be same as cl function name + + // create a queue per device and queue a kernel job + + std::vector queues; + + for (int dev_id = 0; dev_id < devices.size(); dev_id++) + { + cl::CommandQueue* que = new cl::CommandQueue(context, devices[dev_id]); + queues.emplace_back(que); + + kernel_functor( + cl::EnqueueArgs( + *que, + cl::NDRange(items_per_device)), + (cl_int)dev_id, // dev id + input_buf, + output_buf, + (cl_int)(items_per_device * dev_id), // start index + (cl_int)(items_per_device), // count + cl_error + ); + } + + // sync + + for (d = 0; d < devices.size(); d++) + (queues.at(d))->finish(); + + // check if memory state changed by all devices + + cl::copy(*(queues.at(0)), output_buf, begin(output), end(output)); + + bool use_same_memory = true; + + for (int dev_id = 0; dev_id < devices.size(); dev_id++) + { + for (int i = 0; i < items_per_device; ++i) + { + int output_idx = items_per_device * dev_id + i; + if (output[output_idx] != input[i] + dev_id) + { + std::cout << "Output[" << output_idx << "] : " + << "expected = " << input[i] + dev_id + << "; actual = " << output[output_idx] << "\n"; + use_same_memory = false; + break; + } + } + } + + if (use_same_memory) + std::cout << "\n=> Mapped memory addresses used by devices in GPU are same.\n\n"; + else + std::cout << "\n=> Mapped memory addresses used by devices in GPU are different.\n\n"; + + for (auto q : queues) + delete q; + } + catch (cl::Error &err) + { + std::cerr << "error: code: " << err.err() << ", what: " << err.what() << std::endl; + } +} + +void printHelp() +{ + std::cout << "opencl information: \n\n"; + std::cout << "\t -h : help\n"; + std::cout << "\t -g : print if memory map is shared among devices in GPU (in default platform)\n\n"; +} + +int main(const int argc, char **argv) +{ + if (argc < 2) + printHelp(); + else + { + std::string option = argv[1]; + + if (option == "-h") + printHelp(); + else if (option == "-g") + checkContextMem(); + } + return 0; +} diff --git a/contrib/tf_test/CMakeLists.txt b/contrib/tf_test/CMakeLists.txt new file mode 100644 index 000000000..91616cc21 --- /dev/null +++ b/contrib/tf_test/CMakeLists.txt @@ -0,0 +1,12 @@ +nnfw_find_package(Tensorflow QUIET) + +if(NOT Tensorflow_FOUND) + return() +endif(NOT Tensorflow_FOUND) + +list(APPEND SOURCES tf_test.cpp) + +add_executable(tf_test ${SOURCES}) +target_link_libraries(tf_test PRIVATE nnfw_support_tflite) +target_link_libraries(tf_test PRIVATE tensorflow-lite) +target_link_libraries(tf_test PRIVATE tensorflow-core) diff --git a/contrib/tf_test/tf_test.cpp b/contrib/tf_test/tf_test.cpp new file mode 100644 index 000000000..7597a9aea --- /dev/null +++ b/contrib/tf_test/tf_test.cpp @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved + * + * 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 +#include + +#include "support/tflite/Assert.h" +#include "support/tflite/Session.h" +#include "support/tflite/InterpreterSession.h" +#include "support/tflite/NNAPISession.h" +#include "support/tflite/kernels/register.h" + +#include "util/fp32.h" + +#include + +#include +#include + +#define TF_ENSURE(e) { \ + if(!(e).ok()) \ + { \ + throw std::runtime_error{"'" #e "' FAILED"}; \ + } \ +} + +using namespace tflite; +using namespace tflite::ops::builtin; + +std::unique_ptr BuildModelFromFile(const std::string &path) +{ + static StderrReporter reporter; + return FlatBufferModel::BuildFromFile(path.c_str(), &reporter); +} + +std::unique_ptr BuildInterpFromModel(const std::unique_ptr &model) +{ + std::unique_ptr interp; + + BuiltinOpResolver resolver; + InterpreterBuilder builder(*model, resolver); + + TFLITE_ENSURE(builder(&interp)); + + return std::move(interp); +} + +tensorflow::TensorShape asTensorflowShape(const TfLiteTensor *tensor) +{ + tensorflow::TensorShape shape; + + const int rank = tensor->dims->size; + + for (int axis = 0; axis < rank; ++axis) + { + shape.AddDim(tensor->dims->data[axis]); + } + + return shape; +} + +uint32_t count_elements(const TfLiteTensor *tensor) +{ + const int rank = tensor->dims->size; + + if (rank == 0) + { + return 0; + } + + uint32_t res = 1; + + for (int axis = 0; axis < rank; ++axis) + { + res *= tensor->dims->data[axis]; + } + + return res; +} + +int main(int argc, char **argv) +{ + bool use_nnapi = false; + + if (std::getenv("USE_NNAPI") != nullptr) + { + use_nnapi = true; + } + + if (argc < 3) + { + std::cerr << "USAGE: " << argv[0] << " [T/F lite model] [T/F model]" << std::endl; + return 255; + } + + // + // Prepare Tensorflow Lite session + // + const std::string lite_model_path{argv[1]}; + + auto lite_model = BuildModelFromFile(lite_model_path); + auto lite_interp = BuildInterpFromModel(lite_model); + + std::shared_ptr lite_sess; + + if (use_nnapi) + { + lite_sess = std::make_shared(lite_interp.get()); + } + else + { + lite_sess = std::make_shared(lite_interp.get()); + } + + // + // Prepare Tensorflow session + // + const std::string full_model_path{argv[2]}; + + tensorflow::Session* full_sess; + tensorflow::GraphDef full_model; + + TF_ENSURE(tensorflow::NewSession(tensorflow::SessionOptions(), &full_sess)); + TF_ENSURE(ReadBinaryProto(tensorflow::Env::Default(), full_model_path, &full_model)); + TF_ENSURE(full_sess->Create(full_model)); + + // + // + // + std::vector input_nodes; + std::vector input_names; + + for (uint32_t n = 0; n < lite_interp->inputs().size(); ++n) + { + const TfLiteTensor *tensor = lite_interp->tensor(lite_interp->inputs().at(n)); + + input_nodes.emplace_back(tensorflow::DT_FLOAT, asTensorflowShape(tensor)); + input_names.emplace_back(tensor->name); + } + + assert(input_nodes.size() == input_names.size()); + assert(input_nodes.size() == lite_interp->inputs().size()); + + std::vector output_names; + std::vector output_nodes; + + for (uint32_t n = 0; n < lite_interp->outputs().size(); ++n) + { + const TfLiteTensor *tensor = lite_interp->tensor(lite_interp->outputs().at(n)); + + output_names.emplace_back(tensor->name); + } + + assert(output_names.size() == lite_interp->outputs().size()); + // output_nodes will be initialized after Tensorflow Session run + assert(output_nodes.size() == 0); + + // + // Prepare inference + // + lite_sess->prepare(); + + // TODO Feed Inputs (for both Tensorflow and Tensorflow Lite) + std::vector> inputs; + + for (uint32_t n = 0; n < input_nodes.size(); ++n) + { + inputs.emplace_back(input_names.at(0), input_nodes.at(0)); + } + + // + // Run inference + // + TF_ENSURE(full_sess->Run(inputs, output_names, {}, &output_nodes)); + + lite_sess->run(); + + // + // Compare Output + // + auto equals = [] (float lhs, float rhs) { + // TODO Allow users to set tolerance + if (nnfw::util::fp32::absolute_epsilon_equal(lhs, rhs)) + { + return true; + } + + return nnfw::util::fp32::epsilon_equal(lhs, rhs); + }; + + const uint32_t output_count = output_names.size(); + + bool matched = true; + + for (uint32_t n = 0; n < output_count; ++n) + { + const TfLiteTensor *tensor = lite_interp->tensor(lite_interp->outputs().at(n)); + + // TODO Compare shape + + const auto element_count = count_elements(tensor); + + std::cout << "Compare output #" << n << "(" << tensor->name << ", " << element_count << " elements)" << std::endl; + for (uint32_t index = 0; index < element_count; ++index) + { + const auto full_value = output_nodes.at(n).flat().data()[index]; + const auto lite_value = lite_sess->interp()->typed_output_tensor(n)[index]; + + if (!equals(full_value, lite_value)) + { + std::cerr << full_value << " is expected, but " << lite_value << " is obtaeind (at " << n << ":" << index << ")" << std::endl; + matched = false; + } + } + } + + // + // Cleanup + // + lite_sess->teardown(); + + return matched ? 0 : 255; +} diff --git a/docs/HowToContribute.md b/docs/HowToContribute.md new file mode 100644 index 000000000..e62666998 --- /dev/null +++ b/docs/HowToContribute.md @@ -0,0 +1,72 @@ +_nnfw_ always welcomes your contribution, but there are basic guidelines that you should follow in +order to make your contribution be accepted. + +This document explains such guidelines for beginners. + +# General contribution guidelines + +If you are not familiar with git or github, please visit +[here](https://guides.github.com/activities/hello-world/) for basic understanding of git and github. + +For general rules and information in STAR regarding contribution, please see the guidelines in the +[STAR-DeveloperGuide](https://github.sec.samsung.net/STAR/STAR-DeveloperGuide) repo. + + +# HOWTO +## How to create a Pull Request + +This section explains the steps to create a pull request (PR). + +1. Create an issue + + Maintainers will accept your contribution only when it is well aligned with the [roadmap and + design principles](./roadmap.md) of _nnfw_. So, it is optional, but recommended for contributors + to create an issue and have a discussion with maintainers before writing code. + +1. Create a draft PR + + Maintainers will accept your pull request only when it is **reasonably small** and **focused**. + Sometimes, your contribution may require huge and loosely-coupled changes. You **should** split + your contribution into multiple small, but focused pull requests in this case. Unfortunately, it + is possible that maintainers reject your pull request as it is hard for them to understand the + intuition behind these changes. So, it is optional, but recommended for contributors to present + the full draft of your contribution and have a discussion with maintainers before creating PR(s). + +1. Create a commit + + It is time to create a commit for submission once you are convinced that your contribution is + ready to go. Please include signed-off message at the end of commit message. If not, your pull + request will be **rejected** by CI. + +1. Check code format locally + + _nnfw_ has its code formatting rules, and any pull request that violates these rules will be + **rejected** by CI. So, it is optional, but recommended for contributor to check code format + locally before submission. + +1. Create a PR + + It is time to send a pull request. Please explain your intention via description. Maintainers + will review your pull request based on that description. Each pull request needs approval from at + least two reviewers to be accepted. Note that **description should include at least four words**. + If not, your pull request will be **rejected** by CI. + +1. Request review + + Please assign reviewers if you need review from them. Maintainers will honor your review request, + and accept your pull request only when all the reviewer approve your pull request. Note that this + does **NOT** mean that you should assign reviewers. Maintainers (or reviewers) will review your + pull request even without explicit review request. + +1. Update per feedback + + Sometimes, maintainers (or reviewers) will request changes on your pull request. Please update + your pull request upon such feedbacks. These update commits will be squashed into the first + commit of your pull request later. Please do **NOT** include a sign-off message or write a full + description for update commits. + + +# Note + +This document is originated from the [contribution guide in +nncc](https://github.sec.samsung.net/STAR/nncc/blob/master/doc/contribution_guide.md). diff --git a/docs/HowToImplementOperatorKernel.md b/docs/HowToImplementOperatorKernel.md new file mode 100644 index 000000000..715575a5f --- /dev/null +++ b/docs/HowToImplementOperatorKernel.md @@ -0,0 +1 @@ +Under preparation. Coming soon! diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile new file mode 100644 index 000000000..632282770 --- /dev/null +++ b/docs/doxygen/Doxyfile @@ -0,0 +1,2500 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = nnfw + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = ../../../nnfw + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 2 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../../../nnfw + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = ../../../nnfw/Product \ + ../../../nnfw/tools/cross/rootfs \ + ../../../nnfw/externals \ + ../../../nnfw/externals/acl \ + ../../../nnfw/externals/tensorflow \ + ../../../nnfw/tests/framework/cache \ + ../../../nnfw/runtimes/tests/neural_networks_test/generated/models \ + .caffemodel \ + .bin + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = roadmap.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /