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,41 @@
|
|
1
|
+
// Copyright 2020-2021 XMOS LIMITED.
|
2
|
+
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
3
|
+
#pragma once
|
4
|
+
|
5
|
+
#ifndef __ASSEMBLER__
|
6
|
+
|
7
|
+
#include <stdint.h>
|
8
|
+
|
9
|
+
#include "xs3_vpu.h"
|
10
|
+
|
11
|
+
typedef struct {
|
12
|
+
// Word offset = 0
|
13
|
+
int16_t vec_0x007F[VPU_INT8_ACC_PERIOD];
|
14
|
+
// Word offset = 8
|
15
|
+
int8_t vec_0x01[VPU_INT8_ACC_PERIOD];
|
16
|
+
// Word offset = 12
|
17
|
+
int16_t vec_0x0002[VPU_INT8_ACC_PERIOD];
|
18
|
+
// Word offset = 20
|
19
|
+
int8_t vec_0x80[VPU_INT8_EPV];
|
20
|
+
// Word offset = 28
|
21
|
+
|
22
|
+
} vpu_constants_t;
|
23
|
+
|
24
|
+
extern const vpu_constants_t vpu_vects;
|
25
|
+
|
26
|
+
extern const uint32_t vpu_vect_zero[VPU_INT32_EPV];
|
27
|
+
extern const int16_t vpu_vect_0x007F[VPU_INT16_EPV];
|
28
|
+
extern const int8_t vpu_vect_0x01[VPU_INT8_EPV];
|
29
|
+
extern const int8_t vpu_vect_0x02[VPU_INT8_EPV];
|
30
|
+
extern const int8_t vpu_vect_0x80[VPU_INT8_EPV];
|
31
|
+
|
32
|
+
#endif // __ASSEMBLER__
|
33
|
+
|
34
|
+
#define VPU_MODE_32BIT 0x0000
|
35
|
+
#define VPU_MODE_16BIT 0x0100
|
36
|
+
#define VPU_MODE_8BIT 0x0200
|
37
|
+
|
38
|
+
#define VPU_VEC_0x007F (0)
|
39
|
+
#define VPU_VEC_0x01 (8)
|
40
|
+
#define VPU_VEC_0x0002 (12)
|
41
|
+
#define VPU_VEC_0x80 (20)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// Copyright 2020-2021 XMOS LIMITED.
|
2
|
+
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
3
|
+
|
4
|
+
#ifndef WINDOW_OP_PLAN_H_
|
5
|
+
#define WINDOW_OP_PLAN_H_
|
6
|
+
|
7
|
+
#define WOP_OUTPUT_ROWS (0)
|
8
|
+
#define WOP_OUTPUT_COLS (1)
|
9
|
+
#define WOP_OUTPUT_CHANS (2)
|
10
|
+
#define WOP_WINDOW_ROWS (3)
|
11
|
+
#define WOP_WINDOW_COLS (4)
|
12
|
+
#define WOP_START_STRIDE_X (5)
|
13
|
+
#define WOP_START_STRIDE_Y (6)
|
14
|
+
#define WOP_INNER_STRIDE_VERT (7)
|
15
|
+
#define WOP_INNER_STRIDE_HORI (8)
|
16
|
+
#define WOP_OUTER_STRIDE_VERT_X (9)
|
17
|
+
#define WOP_OUTER_STRIDE_VERT_Y (10)
|
18
|
+
#define WOP_OUTER_STRIDE_HORI_X (11)
|
19
|
+
#define WOP_OUTER_STRIDE_HORI_Y (12)
|
20
|
+
#define WOP_CHAN_STRIDE_X (13)
|
21
|
+
#define WOP_CHAN_STRIDE_Y (14)
|
22
|
+
|
23
|
+
#define WOP_WORDS (15)
|
24
|
+
|
25
|
+
#endif // WINDOW_OP_PLAN_H_
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#ifndef _FAST_FLASH_H_
|
2
|
+
#define _FAST_FLASH_H_
|
3
|
+
|
4
|
+
#include <quadflash.h>
|
5
|
+
|
6
|
+
/** Fast flash library.
|
7
|
+
* Before calling any of the functions in here, lib_quad_flash must be initialised as normal by using
|
8
|
+
* fl_connectToDevice(qspi, flash_spec, n_flash_spec).
|
9
|
+
* After that, a call to fast_flash_init shall be made.
|
10
|
+
* After that, a sequence of calls to fast_flash_read can be made.
|
11
|
+
*
|
12
|
+
* The data partition must start with the following 32 bytes: **NOTE: REMOVE THE +4 in fast_flash_init**
|
13
|
+
*
|
14
|
+
* 0xff, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
|
15
|
+
* 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00,
|
16
|
+
* 0x31, 0xf7, 0xce, 0x08, 0x31, 0xf7, 0xce, 0x08,
|
17
|
+
* 0x9c, 0x63, 0x9c, 0x63, 0x9c, 0x63, 0x9c, 0x63
|
18
|
+
*
|
19
|
+
* This pattern is designed to create maximum difficulties electrically and is used
|
20
|
+
* to calibrate the electrical settings. Note that this pattern must be nibble reversed
|
21
|
+
* before being written to flash; just like all other data.
|
22
|
+
* The rest of the data partition can be used as normal
|
23
|
+
*/
|
24
|
+
|
25
|
+
/** Function that initialises the fast_flash library
|
26
|
+
*
|
27
|
+
* \param qspi ports that connect to flash
|
28
|
+
*
|
29
|
+
* \returns a negative value of -1..-5 if the window is too small (size 0..4)
|
30
|
+
* zero if successful
|
31
|
+
*/
|
32
|
+
int fast_flash_init(fl_QSPIPorts &qspi);
|
33
|
+
|
34
|
+
/** Function that reads a sequential set of bytes from memory.
|
35
|
+
* This function assumes that nibbles have been reversed ((x << 4) & 0xf0 | (x >> 4) & 0x0f)
|
36
|
+
* before the data was written to flash.
|
37
|
+
* Note that reading 32 bytes from offset 0 shall yield the special pattern above.
|
38
|
+
*
|
39
|
+
* \param qspi ports that connect to flash
|
40
|
+
* \param addr address in flash data segment
|
41
|
+
* \param word_count Number of words to read
|
42
|
+
* \param read_data array to store data in to.
|
43
|
+
* \param c_out_data optional channel end over which data is out() instead.
|
44
|
+
*/
|
45
|
+
void fast_flash_read(fl_QSPIPorts &qspi, unsigned addr, unsigned word_count, unsigned read_data[], chanend ?c_data_out);
|
46
|
+
|
47
|
+
#endif
|
@@ -0,0 +1,218 @@
|
|
1
|
+
// Copyright (c) 2020, XMOS Ltd, All rights reserved
|
2
|
+
#ifndef INFERENCE_ENGINE_H_
|
3
|
+
#define INFERENCE_ENGINE_H_
|
4
|
+
|
5
|
+
#ifndef __XC__
|
6
|
+
#define UNSAFE /**/
|
7
|
+
#else
|
8
|
+
#define UNSAFE unsafe
|
9
|
+
#endif
|
10
|
+
|
11
|
+
#if !defined(XTFLM_DISABLED)
|
12
|
+
|
13
|
+
#if defined(__xtflm_conf_h_exists__)
|
14
|
+
#include "xtflm_conf.h"
|
15
|
+
#else
|
16
|
+
|
17
|
+
#ifndef XTFLM_OPERATORS
|
18
|
+
#define XTFLM_OPERATORS 10
|
19
|
+
#endif
|
20
|
+
|
21
|
+
#endif
|
22
|
+
|
23
|
+
#include "tensorflow/lite/c/c_api_types.h"
|
24
|
+
#include "xcore_config.h"
|
25
|
+
|
26
|
+
#ifdef __cplusplus
|
27
|
+
|
28
|
+
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
|
29
|
+
#include "xcore_device_memory.h"
|
30
|
+
#include "xcore_error_reporter.h"
|
31
|
+
#include "xcore_interpreter.h"
|
32
|
+
#include "xcore_ops.h"
|
33
|
+
#include "xcore_profiler.h"
|
34
|
+
|
35
|
+
/** Structure that contains all the TensorFlowLite for Micro objects that must
|
36
|
+
* be allocated to create an interpreter. One of these structures has to be
|
37
|
+
* allocated for each inference engine. This structure contains C++ objects, and
|
38
|
+
* must therefore be allocated inside a C++ source file.
|
39
|
+
*/
|
40
|
+
struct tflite_micro_objects {
|
41
|
+
tflite_micro::micro::xcore::XCoreErrorReporter error_reporter;
|
42
|
+
tflite_micro::micro::xcore::XCoreProfiler xcore_profiler;
|
43
|
+
uint64_t interpreter_buffer
|
44
|
+
[(sizeof(tflite_micro::micro::xcore::XCoreInterpreter) + sizeof(uint64_t) - 1) /
|
45
|
+
sizeof(uint64_t)]; // This needs to be aligned on a double word boundary
|
46
|
+
tflite_micro::MicroMutableOpResolver<XTFLM_OPERATORS> resolver;
|
47
|
+
|
48
|
+
tflite_micro::micro::xcore::XCoreInterpreter *interpreter;
|
49
|
+
const tflite_micro::Model *model;
|
50
|
+
};
|
51
|
+
#endif
|
52
|
+
|
53
|
+
#endif
|
54
|
+
|
55
|
+
// Opaque definition for the C++ struct above, used in C.
|
56
|
+
struct tflite_micro_objects;
|
57
|
+
|
58
|
+
/** Structure that contains all the data needed to describe an inference engine
|
59
|
+
* This structure contains no C++, just standard C pointers and arrays.
|
60
|
+
*/
|
61
|
+
typedef struct inference_engine {
|
62
|
+
uint32_t *UNSAFE
|
63
|
+
memory_primary; ///< Pointer to space for tensor arena and optional model
|
64
|
+
uint32_t *UNSAFE
|
65
|
+
memory_secondary; ///< Pointer to secondary space. If null,
|
66
|
+
// use the primary for model and tensor arena
|
67
|
+
uint32_t
|
68
|
+
outputs; ///< Number of output tensors, initialised on loading a model.
|
69
|
+
uint32_t inputs; ///< Number of input tensors, initialised on loading a model.
|
70
|
+
uint32_t *UNSAFE
|
71
|
+
output_buffers[NUM_OUTPUT_TENSORS]; ///< Pointers to output tensors.
|
72
|
+
uint32_t *UNSAFE
|
73
|
+
input_buffers[NUM_INPUT_TENSORS]; ///< Pointers to input tensors.
|
74
|
+
uint32_t output_sizes[NUM_OUTPUT_TENSORS]; ///< Size of each output tensor in
|
75
|
+
///< bytes.
|
76
|
+
uint32_t
|
77
|
+
input_sizes[NUM_INPUT_TENSORS]; ///< Size of each input tensor in bytes.
|
78
|
+
uint32_t output_size; ///< Total size of all outputs - TODO: obsolete?
|
79
|
+
uint32_t input_size; ///< Total size of all inputs - TODO: obsolete?
|
80
|
+
uint32_t
|
81
|
+
memory_primary_bytes; ///< Number of bytes available in primary memory
|
82
|
+
uint32_t
|
83
|
+
memory_secondary_bytes; ///< Number of bytes available in secondary memory
|
84
|
+
uint32_t
|
85
|
+
output_times_size; ///< Number of bytes available to store profiling data
|
86
|
+
uint32_t operators_size; ///< ???
|
87
|
+
uint32_t *UNSAFE output_times; ///< pointer to profiling data, one per layer
|
88
|
+
struct tflite_micro_objects *UNSAFE
|
89
|
+
xtflm; ///< Pointer to C++ XTFLM object - opaque to C
|
90
|
+
// status for the engine to maintain
|
91
|
+
uint32_t haveModel; ///< if 1: we have a model
|
92
|
+
uint32_t chainToNext; ///< if 1: we are chained (could be implicit in c_push
|
93
|
+
///< being non-null?)
|
94
|
+
uint32_t acquireMode; ///< if non zero we're acquiring data
|
95
|
+
uint32_t outputGpioEn; // TODO: should this be here? Possibly not
|
96
|
+
int8_t outputGpioThresh[AISRV_GPIO_LENGTH];
|
97
|
+
uint8_t outputGpioMode;
|
98
|
+
uint32_t debug_log_buffer[MAX_DEBUG_LOG_LENGTH /
|
99
|
+
sizeof(uint32_t)]; ///< buffer for error messages
|
100
|
+
uint32_t arena_needed_bytes; ///< Total arena needed in bytes.
|
101
|
+
uint32_t num_threads;
|
102
|
+
struct xc_context_config_t xc_config;
|
103
|
+
} inference_engine_t;
|
104
|
+
|
105
|
+
#ifdef __cplusplus
|
106
|
+
#ifndef XTFLM_DISABLED
|
107
|
+
/** Function that initializes the inference_engine object, given a
|
108
|
+
* tflite_micro_objects object. This function has to be called from a C++ source
|
109
|
+
* files, and it performs the initialisation of the inference engine. This
|
110
|
+
* involves setting up basic pointers inside the IE object, nothing else.
|
111
|
+
*
|
112
|
+
* The function returns the operator-resolver, which must be be used to add all
|
113
|
+
* necessary operators to the inference engine. A typical calling sequence is as
|
114
|
+
* follows::
|
115
|
+
*
|
116
|
+
* uint32_t data_ext[100000/sizeof(int)];
|
117
|
+
* [...]
|
118
|
+
* static struct tflite_micro_objects s0;
|
119
|
+
* auto *resolver = inference_engine_initialize(ie,
|
120
|
+
* data_ext, 100000,
|
121
|
+
* nullptr, 0,
|
122
|
+
* &s0);
|
123
|
+
* resolver->AddAdd();
|
124
|
+
* resolver->AddConv2D();
|
125
|
+
* resolver->AddCustom(tflite_micro::ops::micro::xcore::Conv2D_V2_OpCode,
|
126
|
+
* tflite_micro::ops::micro::xcore::Register_Conv2D_V2());
|
127
|
+
* [...]
|
128
|
+
*
|
129
|
+
* Note that when tensorflow lite for micro is disabled this function will not
|
130
|
+
* exist as it depends on all and sundry in XTFLM.
|
131
|
+
*
|
132
|
+
* Note that the lifetime of all spaces passed to this function should be longer
|
133
|
+
* than the lifetime of the inference engine. Typically all spaces are declared
|
134
|
+
* globally.
|
135
|
+
*
|
136
|
+
* \param ie Pointer to an uninitialized inference engine
|
137
|
+
* object, allocated by the caller. \param memory_primary Pointer to the
|
138
|
+
* space to be used for the tensor arena, allocated by the caller. If the fourth
|
139
|
+
* parameter is null, then this space will be used for both model and tensor
|
140
|
+
* arena. \param n_primary Number of bytes available in primary memory
|
141
|
+
* \param memory_secondary Pointer to the space to be used for the model
|
142
|
+
* allocated by the caller. If this parameter is
|
143
|
+
* null, then the primary memory will be used for both model and tensor arena.
|
144
|
+
* \param n_secondary Number of bytes available in secondary memory
|
145
|
+
* \param xtflmo C++ structure for storing the XTFLM data
|
146
|
+
* structures. Must be allocated by the caller.
|
147
|
+
*
|
148
|
+
*/
|
149
|
+
tflite_micro::MicroMutableOpResolver<XTFLM_OPERATORS> *inference_engine_initialize(
|
150
|
+
inference_engine_t *UNSAFE ie, uint32_t memory_primary[],
|
151
|
+
uint32_t n_memory_primary, uint32_t memory_secondary[],
|
152
|
+
uint32_t n_secondary, struct tflite_micro_objects *UNSAFE xtflmo);
|
153
|
+
#endif
|
154
|
+
extern "C" {
|
155
|
+
#endif
|
156
|
+
/** Function that unloads a model frmo the inference engine. This function
|
157
|
+
* must be called before before overwriting the model. For example, you
|
158
|
+
* have ran a model successfully, before you store a new model over the top
|
159
|
+
* of the model (from flash or anywhere else), you must first unload the
|
160
|
+
* model, then you can overwrite the model, and finally you can call the
|
161
|
+
* inference_engine_load_model to set up the new model.
|
162
|
+
*
|
163
|
+
* It is safe to call unload model if there is no model loaded.
|
164
|
+
*
|
165
|
+
* \param ie pointer to inference engine.
|
166
|
+
*/
|
167
|
+
void inference_engine_unload_model(inference_engine_t *UNSAFE ie);
|
168
|
+
|
169
|
+
/** Function that loads a model into the inference engine. The model must be
|
170
|
+
* stored in either of the two spaces passed to the inference_engine_initialize
|
171
|
+
* function above: either the dedicated data_model space or the space shared
|
172
|
+
* with the tensor_arena. This funciton assumes the model is in place already
|
173
|
+
* and will simply parse it, not copy it.
|
174
|
+
*
|
175
|
+
* \param ie pointer to inference engine.
|
176
|
+
* \param model_bytes Number of bytes in the model
|
177
|
+
* \param model_data Pointer to the model (one of data_model or
|
178
|
+
* data_tensor_arena passed above) \param c_flash_or_tile Optional channel to flash
|
179
|
+
* or tile server
|
180
|
+
*
|
181
|
+
* \returns non zero indicates an error
|
182
|
+
*/
|
183
|
+
#ifdef __XC__
|
184
|
+
int inference_engine_load_model(inference_engine_t * UNSAFE ie, uint32_t model_bytes, uint32_t * UNSAFE model_data, chanend ?c_flash_or_tile);
|
185
|
+
#else
|
186
|
+
int inference_engine_load_model(inference_engine_t *UNSAFE ie,
|
187
|
+
uint32_t model_bytes,
|
188
|
+
uint32_t *UNSAFE model_data, void *weights_data_ptr);
|
189
|
+
#endif
|
190
|
+
|
191
|
+
/** Function that invokes the inference engine. This function will create an
|
192
|
+
* extra four threads enabling a model to run in 5 threads.
|
193
|
+
*
|
194
|
+
* \param ie pointer to inference engine.
|
195
|
+
*/
|
196
|
+
int interp_invoke_par_5(inference_engine_t *ie);
|
197
|
+
int interp_invoke_par_4(inference_engine_t *ie);
|
198
|
+
int interp_invoke_par_3(inference_engine_t *ie);
|
199
|
+
int interp_invoke_par_2(inference_engine_t *ie);
|
200
|
+
int interp_invoke(inference_engine_t *ie);
|
201
|
+
TfLiteStatus interp_invoke_internal(inference_engine_t *ie);
|
202
|
+
|
203
|
+
/** Function that resets variable tensors.
|
204
|
+
* This should be called after invoking a model with stateful ops such as LSTM.
|
205
|
+
*/
|
206
|
+
int interp_reset(inference_engine_t *ie);
|
207
|
+
|
208
|
+
/** Function that prints a summary of the time each operator took. This
|
209
|
+
* function uses printf - you may want to avoid calling it.
|
210
|
+
*
|
211
|
+
* \param ie pointer to inference engine.
|
212
|
+
*/
|
213
|
+
void print_profiler_summary(inference_engine_t *UNSAFE ie);
|
214
|
+
#ifdef __cplusplus
|
215
|
+
};
|
216
|
+
#endif
|
217
|
+
|
218
|
+
#endif // INFERENCE_ENGINE_H_
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#include <stdint.h>
|
2
|
+
#include "thread_call.h"
|
3
|
+
|
4
|
+
#ifdef __XC__
|
5
|
+
#include <xs1.h>
|
6
|
+
#else
|
7
|
+
#include <xcore/chanend.h>
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#ifdef __XC__
|
11
|
+
|
12
|
+
extern void memory_parallel_receive(chanend c, uint32_t data[], uint32_t bytes);
|
13
|
+
extern void memory_parallel_receive_thread_call(chanend c, uint32_t data[], uint32_t bytes, thread_info_t &ptr);
|
14
|
+
extern void memory_parallel_send(chanend c, uint32_t data[], uint32_t bytes);
|
15
|
+
|
16
|
+
#else
|
17
|
+
|
18
|
+
/** Function that receives a block of data.
|
19
|
+
* The number of bytes must be a multiple of 4.
|
20
|
+
* This function creates three threads and three channel ends in order to
|
21
|
+
* make full use of the bandwidth of the switch.
|
22
|
+
*
|
23
|
+
* \param c channel end to the sender
|
24
|
+
* \param data pointer where data must be stored
|
25
|
+
* \param bytes number of bytes that will be received.
|
26
|
+
*/
|
27
|
+
extern void memory_parallel_receive(chanend_t c, uint32_t *data, uint32_t bytes);
|
28
|
+
|
29
|
+
/** Function that receives a block of data.
|
30
|
+
* The number of bytes must be a multiple of 4.
|
31
|
+
* This function assumes that at least three threads have been created by the
|
32
|
+
* thread_call library and will use those together with three fresh channel
|
33
|
+
* ends in order to make full use of the bandwidth of the switch.
|
34
|
+
*
|
35
|
+
* \param c channel end to the sender
|
36
|
+
* \param data pointer where data must be stored
|
37
|
+
* \param bytes number of bytes that will be received.
|
38
|
+
*/
|
39
|
+
extern void memory_parallel_receive_thread_call(chanend_t c, uint32_t *data, uint32_t bytes, thread_info_t *ptr);
|
40
|
+
|
41
|
+
/** Function that sends a block of data.
|
42
|
+
* The number of bytes must be a multiple of 4.
|
43
|
+
* This function creates three threads and three channel ends in order to
|
44
|
+
* make full use of the bandwidth of the switch.
|
45
|
+
*
|
46
|
+
* \param c channel end to the receiver
|
47
|
+
* \param data pointer where data must be loaded frmo
|
48
|
+
* \param bytes number of bytes that will be sent.
|
49
|
+
*/
|
50
|
+
extern void memory_parallel_send(chanend_t c, uint32_t *data, uint32_t bytes);
|
51
|
+
|
52
|
+
#endif
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Copyright (c) 2020, XMOS Ltd, All rights reserved
|
2
|
+
#ifndef XCORE_VERSION_H_
|
3
|
+
#define XCORE_VERSION_H_
|
4
|
+
|
5
|
+
namespace lib_tflite_micro {
|
6
|
+
|
7
|
+
static const unsigned major_version = 0;
|
8
|
+
static const unsigned minor_version = 6;
|
9
|
+
static const unsigned patch_version = 0;
|
10
|
+
|
11
|
+
} // namespace lib_tflite_micro
|
12
|
+
|
13
|
+
#endif // XCORE_VERSION_H_
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#ifndef XCORE_CONFIG_H_
|
2
|
+
#define XCORE_CONFIG_H_
|
3
|
+
|
4
|
+
#include "../src/thread_call.h"
|
5
|
+
|
6
|
+
struct xc_context_config_t {
|
7
|
+
// This is the thread count specified in the compiler.
|
8
|
+
// It's used by lookup op, beta float ops etc to split up work
|
9
|
+
// in the Prepare phase.
|
10
|
+
// Conv ops have their own thread count as the thread work is
|
11
|
+
// calculated in the compiler.
|
12
|
+
int model_thread_count;
|
13
|
+
thread_info_t thread_info;
|
14
|
+
void *UNSAFE weights_data_ptr; // DDR ptr or channel to flash/tile server.
|
15
|
+
};
|
16
|
+
|
17
|
+
#endif // XCORE_CONFIG_H_
|
@@ -0,0 +1,62 @@
|
|
1
|
+
// Copyright (c) 2020, XMOS Ltd, All rights reserved
|
2
|
+
#ifndef XCORE_DEVICE_MEMORY_H_
|
3
|
+
#define XCORE_DEVICE_MEMORY_H_
|
4
|
+
|
5
|
+
#include <stddef.h>
|
6
|
+
#include <stdint.h>
|
7
|
+
|
8
|
+
#ifdef __cplusplus
|
9
|
+
extern "C" {
|
10
|
+
#endif
|
11
|
+
|
12
|
+
#ifdef XCORE
|
13
|
+
#ifdef _TIME_H_
|
14
|
+
#define _clock_defined
|
15
|
+
#endif
|
16
|
+
#include <xcore/thread.h>
|
17
|
+
|
18
|
+
#define STRINGIFY(NAME) #NAME
|
19
|
+
#define GET_STACKWORDS(DEST, NAME) \
|
20
|
+
asm("ldc %[__dest], " STRINGIFY(NAME) ".nstackwords" : [__dest] "=r"(DEST))
|
21
|
+
#define GET_STACKSIZE(DEST, NAME) \
|
22
|
+
{ \
|
23
|
+
size_t _stack_words; \
|
24
|
+
asm("ldc %[__dest], " STRINGIFY(NAME) ".nstackwords" \
|
25
|
+
: [__dest] "=r"(_stack_words)); \
|
26
|
+
DEST = (_stack_words + 2) * 4; \
|
27
|
+
}
|
28
|
+
#define IS_RAM(a) (((uintptr_t)a >= 0x80000) && ((uintptr_t)a <= 0x100000))
|
29
|
+
#define IS_NOT_RAM(a) ((uintptr_t)a > 0x100000)
|
30
|
+
#define IS_EXTMEM(a) \
|
31
|
+
(((uintptr_t)a >= 0x10000000) && (((uintptr_t)a <= 0x20000000)))
|
32
|
+
#define IS_SWMEM(a) \
|
33
|
+
(((uintptr_t)a >= 0x40000000) && (((uintptr_t)a <= 0x80000000)))
|
34
|
+
|
35
|
+
#ifdef USE_SWMEM
|
36
|
+
#ifndef USE_QSPI_SWMEM_DEV
|
37
|
+
void swmem_setup();
|
38
|
+
#else
|
39
|
+
#include <xcore/chanend.h>
|
40
|
+
void swmem_setup(chanend_t ctrl_swmem_c);
|
41
|
+
#endif // USE_QSPI_SWMEM_DEV
|
42
|
+
#endif // USE_SWMEM
|
43
|
+
|
44
|
+
void swmem_handler(void *ignored);
|
45
|
+
void swmem_teardown();
|
46
|
+
|
47
|
+
#else // not XCORE
|
48
|
+
|
49
|
+
#define GET_STACKSIZE(DEST, NAME) DEST = 0
|
50
|
+
#define GET_STACKWORDS(DEST, NAME) DEST = 0
|
51
|
+
#define IS_RAM(a) (1)
|
52
|
+
#define IS_NOT_RAM(a) (0)
|
53
|
+
|
54
|
+
#endif // XCORE
|
55
|
+
|
56
|
+
void memload(void *dest, void *src, size_t size);
|
57
|
+
|
58
|
+
#ifdef __cplusplus
|
59
|
+
}
|
60
|
+
#endif
|
61
|
+
|
62
|
+
#endif // XCORE_DEVICE_MEMORY_H_
|
@@ -0,0 +1,31 @@
|
|
1
|
+
// Copyright (c) 2020, XMOS Ltd, All rights reserved
|
2
|
+
#ifndef XCORE_SHARED_CONFIG_H_
|
3
|
+
#define XCORE_SHARED_CONFIG_H_
|
4
|
+
|
5
|
+
namespace shared_config {
|
6
|
+
|
7
|
+
// This string is used as a key to store the shared config
|
8
|
+
// between xformer and lib_tflite_micro in the flatbuffer
|
9
|
+
constexpr char xcoreMetadataName[] = "xcoreSharedConfig";
|
10
|
+
|
11
|
+
struct xcore_metadata {
|
12
|
+
// Dummy variable for aligning the metadata struct to 16 bytes
|
13
|
+
// We cannot use alignas(16) yet in xcore
|
14
|
+
int32_t padding[2];
|
15
|
+
// Versions of libraries used to build the model
|
16
|
+
int32_t lib_nn_major_version;
|
17
|
+
int32_t lib_nn_minor_version;
|
18
|
+
int32_t lib_nn_patch_version;
|
19
|
+
int32_t lib_tflite_micro_major_version;
|
20
|
+
int32_t lib_tflite_micro_minor_version;
|
21
|
+
int32_t lib_tflite_micro_patch_version;
|
22
|
+
int32_t xformer_major_version;
|
23
|
+
int32_t xformer_minor_version;
|
24
|
+
int32_t xformer_patch_version;
|
25
|
+
// Number of threads required from the runtime to execute the model
|
26
|
+
int32_t required_thread_count;
|
27
|
+
};
|
28
|
+
|
29
|
+
} // namespace shared_config
|
30
|
+
|
31
|
+
#endif // XCORE_SHARED_CONFIG_H_
|
@@ -0,0 +1,155 @@
|
|
1
|
+
#ifndef _conv2d_float_h_
|
2
|
+
#define _conv2d_float_h_
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
/** Function that calculates a fully connected.
|
9
|
+
*
|
10
|
+
* @param outputs pointer to the output data, the output data will
|
11
|
+
* be stored as an array [out_features]
|
12
|
+
* @param inputs pointer to the input data, the input data must
|
13
|
+
* be stored as an array [input_features]
|
14
|
+
* @param kernels pointer to the kernels, the kernels
|
15
|
+
* must be stored as an array
|
16
|
+
* [out_features][input_features]
|
17
|
+
* @param out_features dimension 1 of the output array
|
18
|
+
* @param input_features dimension 1 of the input array
|
19
|
+
* @returns number of MACCs
|
20
|
+
*/
|
21
|
+
extern int xc_fc_float_ref(float *outputs, float *inputs, float *kernels,
|
22
|
+
int out_features, int input_features);
|
23
|
+
|
24
|
+
/** Optimized function that calculates a fully connected.
|
25
|
+
*
|
26
|
+
* @param outputs pointer to the output data, the output data will
|
27
|
+
* be stored as an array [out_features]
|
28
|
+
* @param inputs pointer to the input data, the input data must
|
29
|
+
* be stored as an array [input_features]
|
30
|
+
* @param kernels pointer to the kernels, the kernels
|
31
|
+
* must be stored as an array
|
32
|
+
* [out_features][input_features]
|
33
|
+
* @param out_features dimension 1 of the output array
|
34
|
+
* @param input_features dimension 1 of the input array
|
35
|
+
* @param out_f_start output features to start at
|
36
|
+
* @param out_f_end output features to end at plus one
|
37
|
+
* @returns number of MACCs
|
38
|
+
*/
|
39
|
+
extern int xc_fc_float_opt(float *outputs, float *inputs, float *kernels,
|
40
|
+
int out_features, int input_features, int out_f_start,
|
41
|
+
int out_f_end);
|
42
|
+
|
43
|
+
/** Function that calculates a convolution with a 5x2 filter with stride 2
|
44
|
+
* over dimension 2 of a tensor over a tensor.
|
45
|
+
*
|
46
|
+
* @param outputs pointer to the output data, the output data will be
|
47
|
+
* stored as an array [out_w][out_h][out_depth]
|
48
|
+
* @param inputs pointer to the input data, the input data must be
|
49
|
+
* stored as an array [input_w][input_h][input_depth]
|
50
|
+
* @param kernels pointer to the kernels, the kernels
|
51
|
+
* must be stored as an array
|
52
|
+
* [out_depth][5][2][depth]
|
53
|
+
* @param bias pointer to the biases, the bias must be stored as an
|
54
|
+
* array [out_depth]
|
55
|
+
* @param out_w dimension 2 of the output array
|
56
|
+
* @param out_h dimension 1 of the output array
|
57
|
+
* @param out_depth dimension 3 of the output array
|
58
|
+
* @param input_w dimension 2 of the input array
|
59
|
+
* @param input_h dimension 1 of the input array
|
60
|
+
* @param input_depth dimension 3 of the input array
|
61
|
+
* @returns number of MACCs
|
62
|
+
*/
|
63
|
+
extern int xc_conv2d_float_kw5xh2_stride_w3_ref(float *outputs, float *inputs,
|
64
|
+
float *kernels, float *biases,
|
65
|
+
int out_w, int out_h,
|
66
|
+
int out_depth, int input_w,
|
67
|
+
int input_h, int input_depth);
|
68
|
+
|
69
|
+
/** Optimised function that calculates a convolution with a 5x2 filter with
|
70
|
+
* stride 2 over dimension 2 of a tensor. For parallel usage, supply
|
71
|
+
* multiple invocations with different values of out_depth_start and
|
72
|
+
* out_depth_end so that the whole output depth is covered between all of
|
73
|
+
* them.
|
74
|
+
*
|
75
|
+
* @param outputs pointer to the output data, the output data will be
|
76
|
+
* stored as an array [out_w][out_h][out_depth]
|
77
|
+
* @param inputs pointer to the input data, the input data must be
|
78
|
+
* stored as an array [input_w][input_h][input_depth]
|
79
|
+
* @param kernels pointer to the kernels, the kernels
|
80
|
+
* must be stored as an array
|
81
|
+
* [out_depth][5][2][depth]
|
82
|
+
* @param bias pointer to the biases, the bias must be stored as an
|
83
|
+
* array [out_depth]
|
84
|
+
* @param out_w dimension 2 of the output array
|
85
|
+
* @param out_h dimension 1 of the output array
|
86
|
+
* @param out_depth dimension 3 of the output array
|
87
|
+
* @param input_w dimension 2 of the input array
|
88
|
+
* @param input_h dimension 1 of the input array
|
89
|
+
* @param input_depth dimension 3 of the input array
|
90
|
+
* @param out_depth_start output depth to start at
|
91
|
+
* @param out_depth_end output depth to end at plus one
|
92
|
+
*/
|
93
|
+
extern void xc_conv2d_float_kw5xh2_stride_w3_opt(
|
94
|
+
float *outputs, float *inputs, float *kernels, float *biases, int out_w,
|
95
|
+
int out_h, int out_depth, int input_w, int input_h, int input_depth,
|
96
|
+
int out_depth_start, int out_depth_end);
|
97
|
+
|
98
|
+
/** Function that calculates a transposed convolution with a 5x2 filter with
|
99
|
+
* stride 3 in dimension 2 over a tensor.
|
100
|
+
*
|
101
|
+
* @param outputs pointer to the output data, the output data will be
|
102
|
+
* stored as an array [out_w][out_h][out_depth]
|
103
|
+
* @param inputs pointer to the input data, the input data must be
|
104
|
+
* stored as an array [input_w][input_h][input_depth]
|
105
|
+
* @param kernels pointer to the kernels, the kernels
|
106
|
+
* must be stored as an array
|
107
|
+
* [out_depth][5][2][depth]
|
108
|
+
* @param bias pointer to the biases, the bias must be stored as an
|
109
|
+
* array [out_depth]
|
110
|
+
* @param out_w dimension 2 of the output array
|
111
|
+
* @param out_h dimension 1 of the output array
|
112
|
+
* @param out_depth dimension 3 of the output array
|
113
|
+
* @param input_w dimension 2 of the input array
|
114
|
+
* @param input_h dimension 1 of the input array
|
115
|
+
* @param input_depth dimension 3 of the input array
|
116
|
+
* @returns number of MACCs
|
117
|
+
*/
|
118
|
+
extern int xc_transpose_conv2d_float_kw5xh2_stride_h3_ref(
|
119
|
+
float *outputs, float *inputs, float *kernels, float *biases, int out_w,
|
120
|
+
int out_h, int out_depth, int input_w, int input_h, int input_depth);
|
121
|
+
|
122
|
+
/** Optimised function that calculates a transposed convolution with a 5x2
|
123
|
+
* filter with stride 3 over dimension 2 of a tensor. For parallel usage,
|
124
|
+
* supply multiple invocations with different values of out_depth_start and
|
125
|
+
* out_depth_end so that the whole output depth is covered between all of
|
126
|
+
* them.
|
127
|
+
*
|
128
|
+
* @param outputs pointer to the output data, the output data will be
|
129
|
+
* stored as an array [out_w][out_h][out_depth]
|
130
|
+
* @param inputs pointer to the input data, the input data must be
|
131
|
+
* stored as an array [input_w][input_h][input_depth]
|
132
|
+
* @param kernels pointer to the kernels, the kernels
|
133
|
+
* must be stored as an array
|
134
|
+
* [out_depth][5][2][depth]
|
135
|
+
* @param bias pointer to the biases, the bias must be stored as an
|
136
|
+
* array [out_depth]
|
137
|
+
* @param out_w dimension 2 of the output array
|
138
|
+
* @param out_h dimension 1 of the output array
|
139
|
+
* @param out_depth dimension 3 of the output array
|
140
|
+
* @param input_w dimension 2 of the input array
|
141
|
+
* @param input_h dimension 1 of the input array
|
142
|
+
* @param input_depth dimension 3 of the input array
|
143
|
+
* @param out_depth_start output depth to start at
|
144
|
+
* @param out_depth_end output depth to end at plus one
|
145
|
+
*/
|
146
|
+
extern void xc_transpose_conv2d_float_kw5xh2_stride_h3_opt(
|
147
|
+
float *outputs, float *inputs, float *kernels, float *biases, int out_w,
|
148
|
+
int out_h, int out_depth, int input_w, int input_h, int input_depth,
|
149
|
+
int out_depth_start, int out_depth_end);
|
150
|
+
|
151
|
+
#ifdef __cplusplus
|
152
|
+
};
|
153
|
+
#endif
|
154
|
+
|
155
|
+
#endif
|