xmos-ai-tools 1.3.2.dev80__py3-none-macosx_10_15_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xmos_ai_tools/__init__.py +7 -0
- xmos_ai_tools/io_server/__init__.py +151 -0
- xmos_ai_tools/runtime/__init__.py +0 -0
- xmos_ai_tools/runtime/buildfiles/aitoolslib.cmake +13 -0
- xmos_ai_tools/runtime/buildfiles/aitoolslib.make +8 -0
- xmos_ai_tools/runtime/include/flash_server.h +74 -0
- xmos_ai_tools/runtime/include/flatbuffers/allocator.h +68 -0
- xmos_ai_tools/runtime/include/flatbuffers/array.h +243 -0
- xmos_ai_tools/runtime/include/flatbuffers/base.h +474 -0
- xmos_ai_tools/runtime/include/flatbuffers/bfbs_generator.h +43 -0
- xmos_ai_tools/runtime/include/flatbuffers/buffer.h +142 -0
- xmos_ai_tools/runtime/include/flatbuffers/buffer_ref.h +53 -0
- xmos_ai_tools/runtime/include/flatbuffers/code_generators.h +235 -0
- xmos_ai_tools/runtime/include/flatbuffers/default_allocator.h +64 -0
- xmos_ai_tools/runtime/include/flatbuffers/detached_buffer.h +114 -0
- xmos_ai_tools/runtime/include/flatbuffers/flatbuffer_builder.h +1197 -0
- xmos_ai_tools/runtime/include/flatbuffers/flatbuffers.h +270 -0
- xmos_ai_tools/runtime/include/flatbuffers/flatc.h +111 -0
- xmos_ai_tools/runtime/include/flatbuffers/flexbuffers.h +1897 -0
- xmos_ai_tools/runtime/include/flatbuffers/grpc.h +300 -0
- xmos_ai_tools/runtime/include/flatbuffers/hash.h +127 -0
- xmos_ai_tools/runtime/include/flatbuffers/idl.h +1232 -0
- xmos_ai_tools/runtime/include/flatbuffers/minireflect.h +419 -0
- xmos_ai_tools/runtime/include/flatbuffers/pch/flatc_pch.h +39 -0
- xmos_ai_tools/runtime/include/flatbuffers/pch/pch.h +38 -0
- xmos_ai_tools/runtime/include/flatbuffers/reflection.h +502 -0
- xmos_ai_tools/runtime/include/flatbuffers/reflection_generated.h +1449 -0
- xmos_ai_tools/runtime/include/flatbuffers/registry.h +128 -0
- xmos_ai_tools/runtime/include/flatbuffers/stl_emulation.h +509 -0
- xmos_ai_tools/runtime/include/flatbuffers/string.h +64 -0
- xmos_ai_tools/runtime/include/flatbuffers/struct.h +53 -0
- xmos_ai_tools/runtime/include/flatbuffers/table.h +168 -0
- xmos_ai_tools/runtime/include/flatbuffers/util.h +690 -0
- xmos_ai_tools/runtime/include/flatbuffers/vector.h +370 -0
- xmos_ai_tools/runtime/include/flatbuffers/vector_downward.h +271 -0
- xmos_ai_tools/runtime/include/flatbuffers/verifier.h +283 -0
- xmos_ai_tools/runtime/include/ioserver.h +44 -0
- xmos_ai_tools/runtime/include/lib_nn/api/TransposeConv.h +24 -0
- xmos_ai_tools/runtime/include/lib_nn/api/add_int16.h +27 -0
- xmos_ai_tools/runtime/include/lib_nn/api/add_int16_transform.h +42 -0
- xmos_ai_tools/runtime/include/lib_nn/api/dequantize_int16.h +22 -0
- xmos_ai_tools/runtime/include/lib_nn/api/dequantize_int16_transform.h +34 -0
- xmos_ai_tools/runtime/include/lib_nn/api/expand_8_to_16.h +8 -0
- xmos_ai_tools/runtime/include/lib_nn/api/multiply_int16.h +42 -0
- xmos_ai_tools/runtime/include/lib_nn/api/multiply_int16_transform.h +71 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_api.h +15 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_bin_types.h +14 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_config.h +287 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_conv2d_structs.h +72 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_image.h +26 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h +303 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_op_helper.h +132 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_op_utils.h +150 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_operator.h +18 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_pooling.h +551 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_types.h +83 -0
- xmos_ai_tools/runtime/include/lib_nn/api/nn_window_params.h +55 -0
- xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16.h +54 -0
- xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16_kernel_transform.h +37 -0
- xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16_mappings.h +13 -0
- xmos_ai_tools/runtime/include/lib_nn/api/quadratic_approximation.h +82 -0
- xmos_ai_tools/runtime/include/lib_nn/api/quadratic_interpolation.h +23 -0
- xmos_ai_tools/runtime/include/lib_nn/api/quantize_int16.h +22 -0
- xmos_ai_tools/runtime/include/lib_nn/api/quantize_int16_transform.h +33 -0
- xmos_ai_tools/runtime/include/lib_nn/api/version.h +13 -0
- xmos_ai_tools/runtime/include/lib_nn/api/vpu_memmove_word_aligned.h +15 -0
- xmos_ai_tools/runtime/include/lib_nn/api/vpu_memset_256.h +55 -0
- xmos_ai_tools/runtime/include/lib_nn/api/vpu_sim.h +118 -0
- xmos_ai_tools/runtime/include/lib_nn/api/xs3_vpu.h +216 -0
- xmos_ai_tools/runtime/include/lib_nn/api/xs3a_registers.h +2869 -0
- xmos_ai_tools/runtime/include/lib_nn/src/asm/asm_constants.h +41 -0
- xmos_ai_tools/runtime/include/lib_nn/src/asm/window_op_plan.h +25 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/fast_flash.h +47 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/inference_engine.h +218 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/memory_parallel_transport.h +52 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h +13 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h +17 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_device_memory.h +62 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_shared_config.h +31 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_float.h +155 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_common.h +19 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h +28 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h +32 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_interpreter.h +49 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h +71 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_profiler.h +49 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_utils.h +160 -0
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/thread_call.h +119 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_defs.h +4 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_device.h +4 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_std_descriptors.h +4 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_std_requests.h +4 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud.h +518 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_conf_default.h +11 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_device.h +87 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_std_descriptors.h +191 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_std_requests.h +120 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/XUD_USB_Defines.h +70 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/hid.h +23 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudio10.h +30 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudio20.h +357 -0
- xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudiocommon.h +168 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/delay_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/energy_flexbuffers_generated_data.h +28 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/fft_flexbuffers_generated_data.h +37 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_log_flexbuffers_generated_data.h +27 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_spectral_subtraction_flexbuffers_generated_data.h +26 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/framer_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/irfft.h +31 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/overlap_add_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/pcan_flexbuffers_generated_data.h +7 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/rfft.h +31 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/stacker_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/signal/micro/kernels/window_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/signal/src/circular_buffer.h +118 -0
- xmos_ai_tools/runtime/include/signal/src/complex.h +29 -0
- xmos_ai_tools/runtime/include/signal/src/energy.h +38 -0
- xmos_ai_tools/runtime/include/signal/src/fft_auto_scale.h +35 -0
- xmos_ai_tools/runtime/include/signal/src/filter_bank.h +69 -0
- xmos_ai_tools/runtime/include/signal/src/filter_bank_log.h +38 -0
- xmos_ai_tools/runtime/include/signal/src/filter_bank_spectral_subtraction.h +73 -0
- xmos_ai_tools/runtime/include/signal/src/filter_bank_square_root.h +34 -0
- xmos_ai_tools/runtime/include/signal/src/irfft.h +84 -0
- xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_common.h +49 -0
- xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_float.h +31 -0
- xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int16.h +30 -0
- xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int32.h +31 -0
- xmos_ai_tools/runtime/include/signal/src/log.h +30 -0
- xmos_ai_tools/runtime/include/signal/src/max_abs.h +31 -0
- xmos_ai_tools/runtime/include/signal/src/msb.h +32 -0
- xmos_ai_tools/runtime/include/signal/src/overlap_add.h +46 -0
- xmos_ai_tools/runtime/include/signal/src/pcan_argc_fixed.h +41 -0
- xmos_ai_tools/runtime/include/signal/src/rfft.h +85 -0
- xmos_ai_tools/runtime/include/signal/src/square_root.h +32 -0
- xmos_ai_tools/runtime/include/signal/src/window.h +31 -0
- xmos_ai_tools/runtime/include/signal/testdata/fft_test_data.h +48 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/array.h +156 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/builtin_op_data.h +22 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/builtin_ops.h +241 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/c/builtin_op_data.h +20 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/c/c_api_types.h +26 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/c/common.h +30 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/context_util.h +54 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/api/error_reporter.h +72 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/api/flatbuffer_conversions.h +440 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/api/tensor_utils.h +28 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/c/builtin_op_data.h +626 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/c/c_api_types.h +178 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/c/common.h +1496 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/core/macros.h +78 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/bits.h +102 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft.h +50 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft_io.h +34 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft_util.h +34 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank.h +63 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank_io.h +35 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.h +50 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend.h +64 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend_io.h +31 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend_util.h +52 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/kiss_fft_common.h +48 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/kiss_fft_int16.h +33 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_lut.h +40 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale.h +39 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale_io.h +33 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale_util.h +45 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction.h +46 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction_io.h +36 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction_util.h +50 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control.h +47 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control_util.h +57 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window.h +49 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window_io.h +34 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window_util.h +45 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/common.h +1358 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/compatibility.h +122 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/cppmath.h +40 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/max.h +35 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/min.h +35 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/optimized/neon_check.h +20 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor.h +141 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor_utils.h +623 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/quantization_util.h +292 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add.h +561 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add_n.h +86 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/arg_min_max.h +88 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/batch_matmul.h +275 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/batch_to_space_nd.h +101 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/binary_function.h +91 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/broadcast_args.h +56 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/broadcast_to.h +97 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/ceil.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/comparisons.h +271 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/concatenation.h +141 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/conv.h +289 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/cumsum.h +175 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depth_to_space.h +79 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depthwiseconv_float.h +100 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depthwiseconv_uint8.h +319 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/dequantize.h +78 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/div.h +247 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/elu.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/exp.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/fill.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor.h +39 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor_div.h +35 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor_mod.h +44 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/fully_connected.h +323 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/hard_swish.h +168 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/add.h +250 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/conv.h +241 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/depthwise_conv.h +291 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/fully_connected.h +126 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h +67 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h +121 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h +18 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mul.h +194 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/pooling.h +264 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h +117 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/transpose_conv.h +224 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/l2normalization.h +90 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/leaky_relu.h +69 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/log_softmax.h +256 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/logistic.h +132 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/lstm_cell.h +422 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/maximum_minimum.h +64 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/mul.h +267 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/neg.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/pad.h +169 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/pooling.h +303 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/portable_tensor_utils.h +333 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/portable_tensor_utils_impl.h +244 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/prelu.h +111 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/process_broadcast_shapes.h +140 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/quantize.h +89 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/reduce.h +491 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/requantize.h +70 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_bilinear.h +233 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_nearest_neighbor.h +102 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/round.h +51 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/select.h +151 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/slice.h +80 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/softmax.h +233 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/space_to_batch_nd.h +109 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/space_to_depth.h +80 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/strided_slice.h +147 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/sub.h +465 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/tanh.h +129 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/transpose.h +203 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/transpose_conv.h +225 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/runtime_shape.h +168 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/strided_slice_logic.h +278 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/tensor_ctypes.h +42 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/types.h +1096 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/kernel_util.h +341 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/op_macros.h +49 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/kernels/padding.h +115 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/ibuffer_allocator.h +100 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/non_persistent_arena_buffer_allocator.h +104 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/persistent_arena_buffer_allocator.h +58 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/recording_single_arena_buffer_allocator.h +63 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/single_arena_buffer_allocator.h +144 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/benchmarks/micro_benchmark.h +95 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/compatibility.h +32 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/cortex_m_generic/debug_log_callback.h +49 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/debug_log.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_model_settings.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/expected_output_data.h +47 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/input_data.h +108 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/network_model.h +166 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/detection_responder.h +32 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/image_provider.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/main_functions.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/model_settings.h +35 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/fake_micro_context.h +70 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/flatbuffer_utils.h +65 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/activation_utils.h +57 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/activations.h +64 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/add.h +78 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_function_specializations.h +141 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_interface.h +75 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_slicers.h +56 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_tf_utils.h +310 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/scratch_buf_mgr.h +145 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/scratch_buffers.h +78 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/ceva_common.h +24 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/ceva_tflm_lib.h +613 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/mcps_macros.h +115 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/types.h +1286 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer.h +45 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h +22 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv.h +117 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv_test.h +94 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/depthwise_conv.h +80 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/dequantize.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/detection_postprocess_flexbuffers_generated_data.h +25 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ethosu.h +28 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/fully_connected.h +112 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/hard_swish.h +30 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_runner.h +86 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_util.h +150 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/leaky_relu.h +43 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/logical.h +35 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/logistic.h +42 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_eval.h +541 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_eval_test.h +817 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_shared.h +150 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_ops.h +158 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_tensor_utils.h +56 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/mul.h +74 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pad.h +27 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pooling.h +142 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/prelu.h +39 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/quantize.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reduce.h +65 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reshape.h +26 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/softmax.h +67 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/strided_slice.h +40 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/sub.h +60 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/svdf.h +100 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/testdata/conv_test_data.h +37 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/testdata/lstm_test_data.h +579 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/unidirectional_sequence_lstm.h +47 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/hifimini/fixedpoint_utils.h +139 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/lstm_eval.h +216 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/lstm_shared.h +78 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_add.h +48 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_conv.h +89 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_depthwise_conv.h +74 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_fully_connected.h +78 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_pad.h +49 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_pooling.h +76 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reduce.h +47 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reshape.h +44 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_softmax.h +58 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_svdf.h +39 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_helpers.h +64 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/greedy_memory_planner.h +170 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/linear_memory_planner.h +53 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/memory_plan_struct.h +73 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/micro_memory_planner.h +95 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.h +133 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocation_info.h +138 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocator.h +351 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_arena_constants.h +28 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_common.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_context.h +176 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_graph.h +79 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter.h +189 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_context.h +125 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_graph.h +110 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_log.h +42 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_mutable_op_resolver.h +708 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_op_resolver.h +62 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler.h +140 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler_interface.h +38 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_resource_variable.h +89 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_time.h +36 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_utils.h +162 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/mock_micro_graph.h +60 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/python_ops_resolver.h +21 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/tflite_size/src/flatbuffer_size.h +30 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/tflite_size/src/flatbuffer_size_wrapper.h +33 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/recording_micro_allocator.h +125 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/recording_micro_interpreter.h +69 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/system_setup.h +27 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helper_custom_ops.h +49 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helpers.h +334 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/micro_test.h +267 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/test_conv_model.h +23 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/tflite_bridge/flatbuffer_conversions_bridge.h +45 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h +36 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/log_utils.h +273 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h +41 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h +127 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/portable_type_to_tflitetype.h +75 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h +24644 -0
- xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_utils.h +33 -0
- xmos_ai_tools/runtime/include/tile_ram_server.h +38 -0
- xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a +0 -0
- xmos_ai_tools/runtime/lib/libxtflitemicro.a +0 -0
- xmos_ai_tools/xformer/__init__.py +60 -0
- xmos_ai_tools/xformer/flash.py +190 -0
- xmos_ai_tools/xinterpreters/__init__.py +1 -0
- xmos_ai_tools/xinterpreters/exceptions.py +38 -0
- xmos_ai_tools/xinterpreters/host_interpreter.py +652 -0
- xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib +0 -0
- xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib +0 -0
- xmos_ai_tools-1.3.2.dev80.data/data/bin/xcore-opt +0 -0
- xmos_ai_tools-1.3.2.dev80.dist-info/METADATA +33 -0
- xmos_ai_tools-1.3.2.dev80.dist-info/RECORD +395 -0
- xmos_ai_tools-1.3.2.dev80.dist-info/WHEEL +5 -0
- xmos_ai_tools-1.3.2.dev80.dist-info/top_level.txt +1 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
#ifndef XCORE_COMMON_H_
|
2
|
+
#define XCORE_COMMON_H_
|
3
|
+
|
4
|
+
#include <cassert>
|
5
|
+
#include <cstdint>
|
6
|
+
|
7
|
+
namespace tflite_micro {
|
8
|
+
namespace ops {
|
9
|
+
namespace micro {
|
10
|
+
namespace xcore {
|
11
|
+
|
12
|
+
void calculateThreadSplit(int &tc, int split_size, int split_start[], int split_end[]);
|
13
|
+
|
14
|
+
} // namespace xcore
|
15
|
+
} // namespace micro
|
16
|
+
} // namespace ops
|
17
|
+
} // namespace tflite_micro
|
18
|
+
|
19
|
+
#endif // XCORE_COMMON_H_
|
xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#ifndef XCORE_CUSTOM_OPTIONS_H_
|
2
|
+
#define XCORE_CUSTOM_OPTIONS_H_
|
3
|
+
|
4
|
+
#include "flatbuffers/flexbuffers.h"
|
5
|
+
#include "xcore_ops.h"
|
6
|
+
|
7
|
+
namespace tflite_micro {
|
8
|
+
namespace ops {
|
9
|
+
namespace micro {
|
10
|
+
namespace xcore {
|
11
|
+
|
12
|
+
class CustomOptionParser {
|
13
|
+
private:
|
14
|
+
flexbuffers::TypedVector keys_;
|
15
|
+
flexbuffers::Vector values_;
|
16
|
+
|
17
|
+
public:
|
18
|
+
CustomOptionParser(const flexbuffers::Map &map);
|
19
|
+
CustomOptionParser(const char *buffer, size_t buffer_length);
|
20
|
+
flexbuffers::Reference parseNamedCustomOption(const char *name) const;
|
21
|
+
};
|
22
|
+
|
23
|
+
} // namespace xcore
|
24
|
+
} // namespace micro
|
25
|
+
} // namespace ops
|
26
|
+
} // namespace tflite_micro
|
27
|
+
|
28
|
+
#endif // XCORE_CUSTOM_OPTIONS_H_
|
xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
// Copyright (c) 2019, XMOS Ltd, All rights reserved
|
2
|
+
|
3
|
+
#ifndef XCORE_ERROR_REPORTER_H_
|
4
|
+
#define XCORE_ERROR_REPORTER_H_
|
5
|
+
|
6
|
+
#include "tensorflow/lite/micro/compatibility.h"
|
7
|
+
#include "tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h"
|
8
|
+
|
9
|
+
namespace tflite_micro {
|
10
|
+
namespace micro {
|
11
|
+
namespace xcore {
|
12
|
+
|
13
|
+
class XCoreErrorReporter : public tflite_micro::MicroErrorReporter {
|
14
|
+
public:
|
15
|
+
explicit XCoreErrorReporter(){};
|
16
|
+
~XCoreErrorReporter() override = default;
|
17
|
+
void Init(char *debugBuffer, int debugBufferLength);
|
18
|
+
void Log(const char *format, va_list args);
|
19
|
+
int Report(const char *format, va_list args) override;
|
20
|
+
|
21
|
+
private:
|
22
|
+
char *buffer;
|
23
|
+
int max_len;
|
24
|
+
int len = 0;
|
25
|
+
TF_LITE_REMOVE_VIRTUAL_DELETE
|
26
|
+
};
|
27
|
+
|
28
|
+
} // namespace xcore
|
29
|
+
} // namespace micro
|
30
|
+
} // namespace tflite_micro
|
31
|
+
|
32
|
+
#endif // XCORE_ERROR_REPORTER_H_
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Copyright (c) 2020, XMOS Ltd, All rights reserved
|
2
|
+
#ifndef XCORE_INTERPRETER_H_
|
3
|
+
#define XCORE_INTERPRETER_H_
|
4
|
+
|
5
|
+
#include "tensorflow/lite/micro/memory_planner/greedy_memory_planner.h"
|
6
|
+
#include "tensorflow/lite/micro/memory_planner/micro_memory_planner.h"
|
7
|
+
#include "tensorflow/lite/micro/micro_allocator.h"
|
8
|
+
#include "tensorflow/lite/micro/micro_interpreter.h"
|
9
|
+
#include "xcore_profiler.h"
|
10
|
+
|
11
|
+
namespace tflite_micro {
|
12
|
+
namespace micro {
|
13
|
+
namespace xcore {
|
14
|
+
|
15
|
+
class XCoreInterpreter : public tflite_micro::MicroInterpreter {
|
16
|
+
public:
|
17
|
+
XCoreInterpreter(const tflite_micro::Model *model,
|
18
|
+
const tflite_micro::MicroOpResolver &resolver,
|
19
|
+
tflite_micro::MicroAllocator *allocator,
|
20
|
+
bool use_curent_thread = true,
|
21
|
+
XCoreProfiler *profiler = nullptr);
|
22
|
+
|
23
|
+
static XCoreInterpreter *
|
24
|
+
Create(uint8_t interpreter_buffer[], const tflite_micro::Model *model,
|
25
|
+
const tflite_micro::MicroOpResolver &resolver, uint8_t *arena,
|
26
|
+
size_t arena_size, bool use_current_thread, XCoreProfiler *profiler);
|
27
|
+
|
28
|
+
void PrintMemoryPlan();
|
29
|
+
TfLiteTensor *tensor(size_t tensor_index);
|
30
|
+
const char *node_name(int sub_idx, int i);
|
31
|
+
|
32
|
+
TfLiteStatus GetTensorDetails(size_t tensor_index, char *name, int name_len,
|
33
|
+
int *shape, int *type, float *scale,
|
34
|
+
int32_t *zero_point);
|
35
|
+
|
36
|
+
TfLiteStatus GetTensorDetailsBufferSizes(size_t tensor_index, size_t *dims,
|
37
|
+
size_t *scales, size_t *zero_points);
|
38
|
+
|
39
|
+
size_t input_tensor_index(size_t input_index);
|
40
|
+
size_t output_tensor_index(size_t output_index);
|
41
|
+
const Model *model__;
|
42
|
+
MicroAllocator *allocator_;
|
43
|
+
};
|
44
|
+
|
45
|
+
} // namespace xcore
|
46
|
+
} // namespace micro
|
47
|
+
} // namespace tflite_micro
|
48
|
+
|
49
|
+
#endif // XCORE_INTERPRETER_H_
|
@@ -0,0 +1,71 @@
|
|
1
|
+
#ifndef XCORE_OPS_H_
|
2
|
+
#define XCORE_OPS_H_
|
3
|
+
|
4
|
+
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
|
5
|
+
|
6
|
+
namespace tflite_micro {
|
7
|
+
namespace ops {
|
8
|
+
namespace micro {
|
9
|
+
namespace xcore {
|
10
|
+
|
11
|
+
constexpr const char *XC_beta_activationf32_OpCode = "XC_beta_activationf32";
|
12
|
+
constexpr const char *XC_beta_concatf32_OpCode = "XC_beta_concatf32";
|
13
|
+
constexpr const char *XC_beta_convf32_OpCode = "XC_beta_convf32";
|
14
|
+
constexpr const char *XC_beta_transposeconvf32_OpCode =
|
15
|
+
"XC_beta_transposeconvf32";
|
16
|
+
constexpr const char *XC_beta_fcf32_OpCode = "XC_beta_fcf32";
|
17
|
+
|
18
|
+
constexpr const char *XC_binaryi16_OpCode = "XC_binaryi16";
|
19
|
+
constexpr const char *XC_unaryi16_OpCode = "XC_unaryi16";
|
20
|
+
|
21
|
+
constexpr const char *XC_conv2d_v2_OpCode = "XC_conv2d_v2";
|
22
|
+
constexpr const char *XC_maxpool2d_OpCode = "XC_maxpool2d";
|
23
|
+
constexpr const char *XC_softmax_OpCode = "XC_softmax";
|
24
|
+
constexpr const char *XC_batched_softmax_OpCode = "XC_batched_softmax";
|
25
|
+
constexpr const char *XC_ld_weights_OpCode = "XC_ld_weights";
|
26
|
+
constexpr const char *XC_add_OpCode = "XC_add";
|
27
|
+
constexpr const char *XC_slice_OpCode = "XC_slice";
|
28
|
+
constexpr const char *XC_broadcast_OpCode = "XC_broadcast";
|
29
|
+
constexpr const char *XC_lookup_OpCode = "XC_lookup";
|
30
|
+
constexpr const char *XC_pad_OpCode = "XC_pad";
|
31
|
+
constexpr const char *XC_concat_OpCode = "XC_concat";
|
32
|
+
constexpr const char *XC_pad_3_to_4_OpCode = "XC_pad_3_to_4";
|
33
|
+
constexpr const char *XC_mul_OpCode = "XC_mul";
|
34
|
+
constexpr const char *XC_mean_OpCode = "XC_mean";
|
35
|
+
// Binarized ops
|
36
|
+
constexpr const char *XC_bsign_8_OpCode = "XC_bsign_8";
|
37
|
+
|
38
|
+
TFLMRegistration *Register_XC_beta_activationf32();
|
39
|
+
TFLMRegistration *Register_XC_beta_concatf32();
|
40
|
+
TFLMRegistration *Register_XC_beta_convf32();
|
41
|
+
TFLMRegistration *Register_XC_beta_transposeconvf32();
|
42
|
+
TFLMRegistration *Register_XC_beta_fcf32();
|
43
|
+
|
44
|
+
TFLMRegistration *Register_XC_binaryi16();
|
45
|
+
TFLMRegistration *Register_XC_unaryi16();
|
46
|
+
|
47
|
+
TFLMRegistration *Register_XC_conv2d_v2();
|
48
|
+
TFLMRegistration *Register_XC_maxpool2d();
|
49
|
+
TFLMRegistration *Register_XC_softmax();
|
50
|
+
TFLMRegistration *Register_XC_batched_softmax();
|
51
|
+
TFLMRegistration *Register_XC_ld_weights();
|
52
|
+
TFLMRegistration *Register_XC_add();
|
53
|
+
TFLMRegistration *Register_XC_slice();
|
54
|
+
TFLMRegistration *Register_XC_broadcast();
|
55
|
+
TFLMRegistration *Register_XC_lookup();
|
56
|
+
TFLMRegistration *Register_XC_pad();
|
57
|
+
TFLMRegistration *Register_XC_concat();
|
58
|
+
TFLMRegistration *Register_XC_pad_3_to_4();
|
59
|
+
TFLMRegistration *Register_XC_mul();
|
60
|
+
TFLMRegistration *Register_XC_mean();
|
61
|
+
// Binarized ops
|
62
|
+
TFLMRegistration *Register_XC_bsign_8();
|
63
|
+
|
64
|
+
void RegisterXCOps(tflite_micro::MicroOpResolver *res);
|
65
|
+
|
66
|
+
} // namespace xcore
|
67
|
+
} // namespace micro
|
68
|
+
} // namespace ops
|
69
|
+
} // namespace tflite_micro
|
70
|
+
|
71
|
+
#endif // XCORE_OPS_H_
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Copyright (c) 2019, XMOS Ltd, All rights reserved
|
2
|
+
|
3
|
+
#ifndef XCORE_PROFILER_H_
|
4
|
+
#define XCORE_PROFILER_H_
|
5
|
+
|
6
|
+
#include "tensorflow/lite/micro/compatibility.h"
|
7
|
+
#include "tensorflow/lite/micro/micro_allocator.h"
|
8
|
+
#include "tensorflow/lite/micro/micro_profiler.h"
|
9
|
+
|
10
|
+
#if !defined(XCORE_PROFILER_DEFAULT_MAX_LEVELS)
|
11
|
+
#define XCORE_PROFILER_DEFAULT_MAX_LEVELS (64)
|
12
|
+
#endif
|
13
|
+
|
14
|
+
namespace tflite_micro {
|
15
|
+
namespace micro {
|
16
|
+
namespace xcore {
|
17
|
+
|
18
|
+
class XCoreProfiler : public tflite_micro::MicroProfiler {
|
19
|
+
public:
|
20
|
+
explicit XCoreProfiler(){};
|
21
|
+
~XCoreProfiler() override = default;
|
22
|
+
|
23
|
+
void Init(tflite_micro::MicroAllocator *allocator,
|
24
|
+
size_t max_event_count = XCORE_PROFILER_DEFAULT_MAX_LEVELS);
|
25
|
+
|
26
|
+
void ClearEvents();
|
27
|
+
|
28
|
+
uint32_t BeginEvent(const char *tag) override;
|
29
|
+
|
30
|
+
// Event_handle is ignored since TFLu does not support concurrent events.
|
31
|
+
void EndEvent(uint32_t event_handle) override;
|
32
|
+
|
33
|
+
uint32_t const *GetEventDurations();
|
34
|
+
size_t GetNumEvents();
|
35
|
+
|
36
|
+
private:
|
37
|
+
const char *event_tag_;
|
38
|
+
uint32_t event_start_time_;
|
39
|
+
size_t event_count_ = 0;
|
40
|
+
size_t max_event_count_ = 0;
|
41
|
+
uint32_t *event_durations_;
|
42
|
+
TF_LITE_REMOVE_VIRTUAL_DELETE
|
43
|
+
};
|
44
|
+
|
45
|
+
} // namespace xcore
|
46
|
+
} // namespace micro
|
47
|
+
} // namespace tflite_micro
|
48
|
+
|
49
|
+
#endif // XCORE_PROFILER_H_
|
@@ -0,0 +1,160 @@
|
|
1
|
+
#ifndef XCORE_UTILS_H_
|
2
|
+
#define XCORE_UTILS_H_
|
3
|
+
|
4
|
+
#include <cassert>
|
5
|
+
#include <cstdint>
|
6
|
+
#include <utility>
|
7
|
+
|
8
|
+
#include "tensorflow/lite/c/common.h"
|
9
|
+
#include "tensorflow/lite/micro/kernels/kernel_util.h"
|
10
|
+
#include "tensorflow/lite/micro/memory_helpers.h"
|
11
|
+
|
12
|
+
namespace tflite_micro {
|
13
|
+
namespace ops {
|
14
|
+
namespace micro {
|
15
|
+
|
16
|
+
struct XCoreOpData {
|
17
|
+
const char *name;
|
18
|
+
};
|
19
|
+
|
20
|
+
namespace xcore {
|
21
|
+
/* Unpack an integer data type from a byte array
|
22
|
+
* T data type to unpack
|
23
|
+
*
|
24
|
+
* Example usage:
|
25
|
+
* int32_t t0 = unpack<int32_t>(&my_buffer[23]);
|
26
|
+
* int32_t t1 = unpack<int32_t>(&my_buffer[27]);
|
27
|
+
*/
|
28
|
+
template <class T> T unpack(const uint8_t *buffer) {
|
29
|
+
T retval = 0;
|
30
|
+
for (int i = 0; i < sizeof(T); ++i)
|
31
|
+
retval |= buffer[i] << (8 * i);
|
32
|
+
return retval;
|
33
|
+
}
|
34
|
+
|
35
|
+
template <typename T>
|
36
|
+
static inline T *construct_persistent_object(TfLiteContext *context) {
|
37
|
+
return new (context->AllocatePersistentBuffer(context, sizeof(T))) T;
|
38
|
+
}
|
39
|
+
|
40
|
+
static inline bool is_ram_address(uintptr_t a) {
|
41
|
+
#ifdef XCORE
|
42
|
+
return ((a >= 0x80000) && (a <= 0x100000));
|
43
|
+
#else
|
44
|
+
return true;
|
45
|
+
#endif
|
46
|
+
}
|
47
|
+
|
48
|
+
static inline TfLiteStatus request_scratch_if_needed(TfLiteContext *context,
|
49
|
+
const void *source_address,
|
50
|
+
const size_t size,
|
51
|
+
int &scratch_idx) {
|
52
|
+
if (source_address && !is_ram_address((uintptr_t)source_address)) {
|
53
|
+
return context->RequestScratchBufferInArena(context, size, &scratch_idx);
|
54
|
+
}
|
55
|
+
return kTfLiteOk;
|
56
|
+
}
|
57
|
+
|
58
|
+
static inline TfLiteStatus request_scratch_if_needed(TfLiteContext *context,
|
59
|
+
const TfLiteTensor *tensor,
|
60
|
+
int &scratch_idx) {
|
61
|
+
return request_scratch_if_needed(context, tensor->data.data, tensor->bytes,
|
62
|
+
scratch_idx);
|
63
|
+
}
|
64
|
+
|
65
|
+
extern "C" {
|
66
|
+
static inline void memload(void *dest, void *src, size_t size) {
|
67
|
+
// printf("memload dest=%d src=%d size=%d\n", (long)dest, (long)src,
|
68
|
+
// size);
|
69
|
+
memcpy(dest, src, size);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
size_t FetchBuffer(int8_t **dest, int8_t const *src, size_t size);
|
74
|
+
|
75
|
+
template <typename T>
|
76
|
+
static inline TfLiteStatus
|
77
|
+
fetch_scratch_if_needed(TfLiteContext *context, T *&array,
|
78
|
+
const TfLiteEvalTensor *tensor, int scratch_idx) {
|
79
|
+
if (scratch_idx >= 0) {
|
80
|
+
array =
|
81
|
+
static_cast<const T *>(context->GetScratchBuffer(context, scratch_idx));
|
82
|
+
const RuntimeShape shape = tflite_micro::micro::GetTensorShape(tensor);
|
83
|
+
|
84
|
+
size_t sizeof_tensor_type;
|
85
|
+
TfLiteTypeSizeOf(tensor->type, &sizeof_tensor_type);
|
86
|
+
FetchBuffer((int8_t **)&array, tflite_micro::micro::GetTensorData<int8_t>(tensor),
|
87
|
+
shape.FlatSize() * sizeof_tensor_type);
|
88
|
+
} else {
|
89
|
+
array = tflite_micro::micro::GetTensorData<T>(tensor);
|
90
|
+
}
|
91
|
+
TF_LITE_ENSURE(context, array);
|
92
|
+
return kTfLiteOk;
|
93
|
+
}
|
94
|
+
|
95
|
+
template <typename T> class PersistentArray {
|
96
|
+
private:
|
97
|
+
size_t max_size_ = 0;
|
98
|
+
size_t size_ = 0;
|
99
|
+
T *data_ = nullptr;
|
100
|
+
|
101
|
+
public:
|
102
|
+
// call this only in the Init phase of operators
|
103
|
+
PersistentArray<T> &allocate(TfLiteContext *context,
|
104
|
+
size_t max_size) noexcept {
|
105
|
+
assert(data_ == nullptr);
|
106
|
+
assert(max_size > 0);
|
107
|
+
|
108
|
+
max_size_ = max_size;
|
109
|
+
data_ = reinterpret_cast<T *>(
|
110
|
+
context->AllocatePersistentBuffer(context, sizeof(T) * max_size));
|
111
|
+
|
112
|
+
return *this;
|
113
|
+
};
|
114
|
+
PersistentArray<T> &initialize() noexcept {
|
115
|
+
assert(size_ == 0);
|
116
|
+
while (size_ < max_size_) {
|
117
|
+
this->append(T());
|
118
|
+
}
|
119
|
+
|
120
|
+
return *this;
|
121
|
+
};
|
122
|
+
// TODO: begin and end would be better if returned an iterator object
|
123
|
+
inline T *begin() noexcept {
|
124
|
+
assert(size_ > 0);
|
125
|
+
return &data_[0];
|
126
|
+
}
|
127
|
+
inline T *end() noexcept {
|
128
|
+
assert(size_ > 0);
|
129
|
+
return &data_[size_];
|
130
|
+
}
|
131
|
+
inline T &operator[](int i) noexcept {
|
132
|
+
assert(i < size_);
|
133
|
+
return data_[i];
|
134
|
+
}
|
135
|
+
inline void append(const T &element) noexcept {
|
136
|
+
assert(size_ < max_size_);
|
137
|
+
data_[size_++] = element;
|
138
|
+
}
|
139
|
+
inline void append(T &&element) noexcept {
|
140
|
+
assert(size_ < max_size_);
|
141
|
+
data_[size_++] = std::move(element);
|
142
|
+
}
|
143
|
+
inline size_t size() noexcept { return size_; }
|
144
|
+
inline size_t max_size() noexcept { return max_size_; }
|
145
|
+
};
|
146
|
+
|
147
|
+
#ifndef UNSUPPORTED_KERNEL_TYPE
|
148
|
+
#define UNSUPPORTED_KERNEL_TYPE(T) \
|
149
|
+
{ \
|
150
|
+
DebugLog("Unsupported " #T " value"); \
|
151
|
+
TFLITE_ABORT; \
|
152
|
+
}
|
153
|
+
#endif /*UNSUPPORTED_KERNEL_TYPE*/
|
154
|
+
|
155
|
+
} // namespace xcore
|
156
|
+
} // namespace micro
|
157
|
+
} // namespace ops
|
158
|
+
} // namespace tflite_micro
|
159
|
+
|
160
|
+
#endif // XCORE_UTILS_H_
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#if !defined(__micro_thread_library_h__)
|
2
|
+
#define __micro_thread_library_h__
|
3
|
+
|
4
|
+
#include <stdint.h>
|
5
|
+
|
6
|
+
#ifdef __cplusplus
|
7
|
+
extern "C" {
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#define XCORE_MAX_NUM_THREADS 5
|
11
|
+
|
12
|
+
#ifdef __XC__
|
13
|
+
#define UNSAFE unsafe
|
14
|
+
#else
|
15
|
+
#define UNSAFE /**/
|
16
|
+
#endif
|
17
|
+
|
18
|
+
typedef struct { // THIS STRUCT MUST BE IN SYNC WITH ASSEMBLY CODE.
|
19
|
+
union {
|
20
|
+
uint64_t id_aligned[2]; // Guarantee 64-bit alignment.
|
21
|
+
uint32_t id[4]; // Actual IDs
|
22
|
+
} thread_ids; // ids of at most 4 threads - live during invoke
|
23
|
+
uint32_t synchroniser; // synchroniser for threads - live during invoke
|
24
|
+
uint32_t nstackwords; // nstackwords per stack - live after load model
|
25
|
+
void *UNSAFE stacks; // pointer to top of stack - live after load model
|
26
|
+
} thread_info_t;
|
27
|
+
|
28
|
+
|
29
|
+
#ifndef __XC__
|
30
|
+
|
31
|
+
typedef void (*thread_function_pointer_t)(void * arg0, void * arg1, void * arg2);
|
32
|
+
struct inference_engine;
|
33
|
+
|
34
|
+
/** Function that creates threads, then calls a interp_invoke_internal,
|
35
|
+
* then destroys threads
|
36
|
+
* This function creates four threads for a total of five threads.
|
37
|
+
* other versions of the functions create 3, 2, 1, or 0 threads.
|
38
|
+
*
|
39
|
+
* \param ie Pointer to the inference object to be passed to
|
40
|
+
* interp_invoke_internal
|
41
|
+
* \param ptr Pointer to a thread_info block. The thread-ids will
|
42
|
+
* be stored in this block, and a stack pointer is expected
|
43
|
+
* in this block:
|
44
|
+
* ptr[0] [out] thread-id-0 (versions with fewer threads
|
45
|
+
* ptr[1] [out] thread-id-1 will only use the first few
|
46
|
+
* ptr[2] [out] thread-id-2 slots)
|
47
|
+
* ptr[3] [out] thread-id-3
|
48
|
+
* ptr[4] [out] synchroniser-id
|
49
|
+
* ptr[5] [in] top of stacks
|
50
|
+
* ptr[6] [in] number of words per stack
|
51
|
+
*/
|
52
|
+
int thread_invoke_5(struct inference_engine *ie, thread_info_t *ptr);
|
53
|
+
int thread_invoke_4(struct inference_engine *ie, thread_info_t *ptr);
|
54
|
+
int thread_invoke_3(struct inference_engine *ie, thread_info_t *ptr);
|
55
|
+
int thread_invoke_2(struct inference_engine *ie, thread_info_t *ptr);
|
56
|
+
int thread_invoke_1(struct inference_engine *ie, thread_info_t *ptr);
|
57
|
+
|
58
|
+
/** Function that creates threads.
|
59
|
+
* This function creates four threads for a total of five threads.
|
60
|
+
* other versions of the functions create 3, 2, 1, or 0 threads.
|
61
|
+
*
|
62
|
+
* \param ptr Pointer to a thread_info block. The thread-ids will
|
63
|
+
* be stored in this block, and a stack pointer is expected
|
64
|
+
* in this block:
|
65
|
+
* ptr[0] [out] thread-id-0 (versions with fewer threads
|
66
|
+
* ptr[1] [out] thread-id-1 will only use the first few
|
67
|
+
* ptr[2] [out] thread-id-2 slots)
|
68
|
+
* ptr[3] [out] thread-id-3
|
69
|
+
* ptr[4] [out] synchroniser-id
|
70
|
+
* ptr[5] [in] top of stacks
|
71
|
+
* ptr[6] [in] number of words per stack
|
72
|
+
*/
|
73
|
+
void thread_init_5(thread_info_t *ptr);
|
74
|
+
void thread_init_4(thread_info_t *ptr);
|
75
|
+
void thread_init_3(thread_info_t *ptr);
|
76
|
+
void thread_init_2(thread_info_t *ptr);
|
77
|
+
void thread_init_1(thread_info_t *ptr);
|
78
|
+
/** Function that destroys threads. Must be called from the same function that
|
79
|
+
* called an _init_ above.
|
80
|
+
*
|
81
|
+
* \param ptr Pointer to a thread_info block.
|
82
|
+
*/
|
83
|
+
void thread_destroy(thread_info_t *ptr);
|
84
|
+
|
85
|
+
/** Function that sets up parameters for one of the client threads
|
86
|
+
* This particular one passes the second and third arguments to the thread.
|
87
|
+
* When the thread function is actually called (through thread_call)
|
88
|
+
* the thread function will be called with those two arguments,
|
89
|
+
* and the first shared argument provided by thread_call.
|
90
|
+
* Note - we can make versions with more or fewer parameters.
|
91
|
+
* Note - we could pass this function the thread-function itself
|
92
|
+
*
|
93
|
+
* \param arg1 Second argument for the thread function
|
94
|
+
* \param arg2 Third argument for the thread function
|
95
|
+
* \param thread_id The thread_id to initialise; one of ptr[0]..ptr[3] above
|
96
|
+
*/
|
97
|
+
void thread_variable_setup(void * arg1, void * arg2, uint32_t thread_id);
|
98
|
+
|
99
|
+
/** Function that starts all thread functions and runs them until completion.
|
100
|
+
* It is assumed that the variable parts have been set up per thread.
|
101
|
+
* by thread_variable_setup.
|
102
|
+
* This thread will also invoke the function with the given variable arguments.
|
103
|
+
*
|
104
|
+
* \param arg0 First argument shared among all threads (usually the output pointer)
|
105
|
+
* \param arg1 Second argument for the master thread function
|
106
|
+
* \param arg2 Third argument for the master thread function
|
107
|
+
* \param fp thread function to call on all threads.
|
108
|
+
* \param ptr Pointer to the thread info block held in the xcore
|
109
|
+
* interpreter.
|
110
|
+
*/
|
111
|
+
void thread_call(void * arg0, void * arg1, void * arg2,
|
112
|
+
thread_function_pointer_t fp, thread_info_t *ptr);
|
113
|
+
#ifdef __cplusplus
|
114
|
+
};
|
115
|
+
#endif
|
116
|
+
|
117
|
+
#endif // __XC__
|
118
|
+
|
119
|
+
#endif // __micro_thread_library_h__
|