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,54 @@
|
|
1
|
+
#ifndef _output_transform_fn_int16_h_
|
2
|
+
#define _output_transform_fn_int16_h_
|
3
|
+
|
4
|
+
#include <stdint.h>
|
5
|
+
|
6
|
+
typedef struct {
|
7
|
+
int32_t output_slice_channel_count;
|
8
|
+
} otfn_int16_params_t;
|
9
|
+
|
10
|
+
|
11
|
+
/** Function that transform a ring buffer accumulator
|
12
|
+
* into a vector of 16 bit numbers after multiplying and scaling.
|
13
|
+
* In the name of efficiency the inputs shoudl be provided in the following
|
14
|
+
* order (K indicates the value that affects output channel K):
|
15
|
+
*
|
16
|
+
* vD/vR: 0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 14, 13, 15.
|
17
|
+
* (each second and third element are swapped)
|
18
|
+
* If only few channels are being used, eg two, they
|
19
|
+
* must be: 0, X, 1, X, X, X, X, X X, X, X, X X, X, X, X.
|
20
|
+
*
|
21
|
+
* mul_add: m1, m3, m5, m7, m9, m11, m13, m15,
|
22
|
+
* a1, a3, a5, a7, a9, a11, a13, a15,
|
23
|
+
* m0, m2, m4, m6, m8, m10, m12, m14
|
24
|
+
* a0, a2, a4, a6, a8, a10, a12, a14.
|
25
|
+
* If only few channels are being used, eg two, they
|
26
|
+
* must be: m1, X, X, X, X, X, X, X, a1, X, X, X, X, X, X, X,
|
27
|
+
* m0, X, X, X, X, X, X, X, a0, X, X, X, X, X, X, X.
|
28
|
+
*
|
29
|
+
* output: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
30
|
+
* Only the channels used are written, eg, for two channels
|
31
|
+
* 0, 1.
|
32
|
+
*
|
33
|
+
*
|
34
|
+
*
|
35
|
+
* \param vDvR Pointer to 32 shorts storing 16 upper halfs
|
36
|
+
* of the ring buffer, and 16 lower halfs in that
|
37
|
+
* order
|
38
|
+
*
|
39
|
+
* \param mul_add Pointer to four vectors of length N/2 integers, the first
|
40
|
+
* and third vector are multipliers (Q2.30), the second
|
41
|
+
* and fourth vectors are adders (Q16.16).
|
42
|
+
*
|
43
|
+
* \param output Pointer to the desired place where N values will be
|
44
|
+
* outputted
|
45
|
+
*
|
46
|
+
* \param N Number of vector elements to process; N <= 16.
|
47
|
+
*/
|
48
|
+
extern int16_t *output_transform_fn_int16(otfn_int16_params_t *params,
|
49
|
+
int16_t *output,
|
50
|
+
int16_t *vDvR,
|
51
|
+
int32_t output_channel_group,
|
52
|
+
int32_t *mul_add);
|
53
|
+
|
54
|
+
#endif
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#ifndef _output_transform_fn_int16_kernel_transform_h_
|
2
|
+
#define _output_transform_fn_int16_kernel_transform_h_
|
3
|
+
|
4
|
+
#include <stdint.h>
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Function that performs all the transformations needed for a 16-bit convolution
|
8
|
+
* 1. It transforms the weight ordering to reverse the weights in groups of 16 in preparation of VLMACCR shift-and-rotate
|
9
|
+
* 2. It convers the channel multpliers to integer multipliers
|
10
|
+
* 3. It interleaves the channel multpliers and channel biases into a single blob
|
11
|
+
* The number of kernels is assumed to be input_channels x output_channels elements
|
12
|
+
* The number of bias terms and multipliers is assumed to be output_channels
|
13
|
+
* The number of elements in the array mul_add_out should be 2xoutput_channels
|
14
|
+
* The number of elements in the kernel_weights_out array should be input_channels x output_channels
|
15
|
+
*
|
16
|
+
* @param kernel_weights_in kernel weights input
|
17
|
+
*
|
18
|
+
* @param channel_multpliers_in per-channel multipliers.
|
19
|
+
*
|
20
|
+
* @param channel_bias_terms_in per-channel bias terms.
|
21
|
+
*
|
22
|
+
* @param kernel_weights_out reordered kernel weights
|
23
|
+
*
|
24
|
+
* @param mul_add_out mixed per-channel multipliers and bias-terms
|
25
|
+
*
|
26
|
+
* @param input_channels number of input channels
|
27
|
+
*
|
28
|
+
* @param output_channels number of output_channels
|
29
|
+
*/
|
30
|
+
|
31
|
+
extern void output_transform_fn_int16_kernel_transform(
|
32
|
+
const int8_t *kernel_weights_in,
|
33
|
+
const float *channel_multipliers_in, const int *channel_bias_terms_in,
|
34
|
+
int8_t *kernel_weights_out, int32_t *mul_add_out,
|
35
|
+
int input_channels, int output_channels);
|
36
|
+
|
37
|
+
#endif
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#ifndef _output_transform_fn_int16_mappings_h_
|
2
|
+
#define _output_transform_fn_int16_mappings_h_
|
3
|
+
|
4
|
+
// This defines the mapping of the output transform multipliers from output channels
|
5
|
+
extern int ot_int16_mul_index_used_for_output[];
|
6
|
+
|
7
|
+
// This defines the mapping of the output transform biases from output channels
|
8
|
+
extern int ot_int16_add_index_used_for_output[];
|
9
|
+
|
10
|
+
// This defines the kernel mapping from output channels
|
11
|
+
extern int aggr_ot_int16_input_channel_used_for_output[];
|
12
|
+
|
13
|
+
#endif
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#ifndef _quadratic_approximation_h_
|
2
|
+
#define _quadratic_approximation_h_
|
3
|
+
|
4
|
+
#ifdef __xcore__
|
5
|
+
#define ACTIVATION_FUNCTION __attribute__(( fptrgroup("activation_functions") ))
|
6
|
+
#else
|
7
|
+
#define ACTIVATION_FUNCTION /**/
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#include "nn_api.h"
|
11
|
+
#include <stdint.h>
|
12
|
+
|
13
|
+
#define QUADRATIC_APPROXIMATION_MAX_CHUNKS 2048
|
14
|
+
|
15
|
+
/** Type that stores an approximation table.
|
16
|
+
* Must be stored 64-bit aligned when presented to assembly code.
|
17
|
+
* Use:
|
18
|
+
* * ``quadratic_function_table_number_bytes()`` to query the size
|
19
|
+
* * ``quadratic_function_table_bytes()`` to obtain a pointer to the table
|
20
|
+
*/
|
21
|
+
struct quadratic_function_table {
|
22
|
+
struct { // The order matters - this is how the assembly code expects them
|
23
|
+
int32_t c;
|
24
|
+
int8_t a;
|
25
|
+
int8_t padding;
|
26
|
+
int16_t b;
|
27
|
+
} coefficients[QUADRATIC_APPROXIMATION_MAX_CHUNKS];
|
28
|
+
int data_bytes;
|
29
|
+
};
|
30
|
+
|
31
|
+
typedef struct quadratic_function_table quadratic_function_table_t;
|
32
|
+
|
33
|
+
/* Function pointer type - any float -> float
|
34
|
+
*/
|
35
|
+
typedef float (*float_function_t)(float x);
|
36
|
+
|
37
|
+
/** Function that builds a quadratic approximation table
|
38
|
+
* The function passed in must be monotinuous
|
39
|
+
* Any number of chunks will work but the assembly implementiaton assumes 128.
|
40
|
+
* The function returns a table pointer, and through two arguments the max error,
|
41
|
+
* and the sqrt of the sum of squared errors as a goodness metric.
|
42
|
+
*
|
43
|
+
* \param table interpolation table to be filled in
|
44
|
+
* \param av function to be interpolated
|
45
|
+
* \param input_scaler scale that is applied to the input, eg 8.0/32768.0
|
46
|
+
* \param outptu_scaler scale that is applied to the output, eg 32768.0
|
47
|
+
* \param chunks number of interpolations. Set to 128.
|
48
|
+
* \param max_error maximum error, ought to be 1
|
49
|
+
* \param error sqrt of sum of squared errors.
|
50
|
+
*/
|
51
|
+
C_API void quadratic_approximation_generator(
|
52
|
+
quadratic_function_table_t *table,
|
53
|
+
ACTIVATION_FUNCTION float_function_t av,
|
54
|
+
double input_scaler,
|
55
|
+
double output_scaler,
|
56
|
+
int chunks,
|
57
|
+
int *max_error,
|
58
|
+
double *error);
|
59
|
+
|
60
|
+
/** Function that returns the number of bytes in an approximation table
|
61
|
+
*
|
62
|
+
* \param x the table
|
63
|
+
* \returns The number of bytes in the table
|
64
|
+
*/
|
65
|
+
C_API uint32_t quadratic_function_table_number_bytes(quadratic_function_table_t *x);
|
66
|
+
|
67
|
+
|
68
|
+
/** Function that returns a pointer to the bytes in an approximation table
|
69
|
+
*
|
70
|
+
* \param x the table
|
71
|
+
* \returns Pointer to the bytes in the table
|
72
|
+
*/
|
73
|
+
C_API uint8_t *quadratic_function_table_bytes(quadratic_function_table_t *x);
|
74
|
+
|
75
|
+
/** Example functions that can be passed in
|
76
|
+
*/
|
77
|
+
C_API float approximation_function_tanh(float x);
|
78
|
+
C_API float approximation_function_logistics(float x);
|
79
|
+
C_API float approximation_function_elu(float x);
|
80
|
+
C_API float approximation_function_relu(float x);
|
81
|
+
|
82
|
+
#endif
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#ifndef _quadratic_interpolation_h_
|
2
|
+
#define _quadratic_interpolation_h_
|
3
|
+
|
4
|
+
#include <stdint.h>
|
5
|
+
|
6
|
+
/** Function that performs a quadratic interpolation on a vector of inputs given a table
|
7
|
+
* of coefficients
|
8
|
+
*
|
9
|
+
* \param outputs Output vector, 16-bit signed integers
|
10
|
+
*
|
11
|
+
* \param inputs Output vector, 16-bit signed integers
|
12
|
+
*
|
13
|
+
* \param coefficients The bytes comprising the table of coefficients produced with
|
14
|
+
* ``quadratic_approximation_generator()``.
|
15
|
+
* Must be 64-bit aligned.
|
16
|
+
*
|
17
|
+
* \param N Number of 16-bit elements in the vector
|
18
|
+
*/
|
19
|
+
extern void quadratic_interpolation_128(int16_t *outputs, int16_t *inputs,
|
20
|
+
uint8_t *coeffs,
|
21
|
+
uint32_t N);
|
22
|
+
|
23
|
+
#endif
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#ifndef _quantize_int16_h_
|
2
|
+
#define _quantize_int16_h_
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Function that implements quantization of a 16-bit tensor to a 32-bit tensor.
|
6
|
+
* The blob must have been created by a call to ``quantize_int16_blob()``
|
7
|
+
*
|
8
|
+
* @param output Output tensor
|
9
|
+
*
|
10
|
+
* @param input Input tensor
|
11
|
+
* Must be word-aligned
|
12
|
+
*
|
13
|
+
* @param blob Transformed constant input tensor
|
14
|
+
* Must be word-aligned
|
15
|
+
*
|
16
|
+
* @param tensor_length Number of elements in the tensor (product of all dimensions)
|
17
|
+
* There are no constraints on this number.
|
18
|
+
*/
|
19
|
+
void quantize_int16_tensor(int16_t *output, float *input,
|
20
|
+
int tensor_length, void *blob);
|
21
|
+
|
22
|
+
#endif
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#ifndef _quantize_int16_transform_h_
|
2
|
+
#define _quantize_int16_transform_h_
|
3
|
+
|
4
|
+
#include "nn_api.h"
|
5
|
+
#include <stdint.h>
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Function that performs the compile time transformation of an int16 addition
|
9
|
+
* between two tensors.
|
10
|
+
*
|
11
|
+
* this function should be
|
12
|
+
* called at compile-time, and at run-time the output of this function shall be passed
|
13
|
+
* as the second input tensor of ``quantize_int16_tensor``
|
14
|
+
*
|
15
|
+
* @param output Output of the function; a blob of
|
16
|
+
* ``QUANTIZE_INT16_TENSOR_BYTES()`` bytes.
|
17
|
+
* Must be word-aligned.
|
18
|
+
*
|
19
|
+
* @param output_scaler Quantisation scaler for the output
|
20
|
+
*
|
21
|
+
* @returns 1 on success, 0 on fail (fallback required)
|
22
|
+
*/
|
23
|
+
C_API int quantize_int16_tensor_blob(void *output,
|
24
|
+
float output_scaler);
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Macro that calculates the number of int16_t that should be allocated to
|
28
|
+
* store the output of ``quantize_int16_tensor_blob()``
|
29
|
+
*/
|
30
|
+
#define QUANTIZE_INT16_TENSOR_BYTES() (1 * sizeof(float))
|
31
|
+
|
32
|
+
|
33
|
+
#endif
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Copyright (c) 2020, XMOS Ltd, All rights reserved
|
2
|
+
#ifndef LIB_NN_VERSION_H_
|
3
|
+
#define LIB_NN_VERSION_H_
|
4
|
+
|
5
|
+
namespace lib_nn {
|
6
|
+
|
7
|
+
static const unsigned major_version = 0;
|
8
|
+
static const unsigned minor_version = 3;
|
9
|
+
static const unsigned patch_version = 0;
|
10
|
+
|
11
|
+
} // namespace lib_nn
|
12
|
+
|
13
|
+
#endif // LIB_NN_VERSION_H_
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#ifndef _vpu_memmove_word_aligned_h_
|
2
|
+
#define _vpu_memmove_word_aligned_h_
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Function that copies a block of memory. Both source and destination
|
6
|
+
* address must be word aligned. Any number of bytes can be copied. There
|
7
|
+
* may be an overlap between the destination and source.
|
8
|
+
*
|
9
|
+
* @param dst Destination address, must be word aligned.
|
10
|
+
* @param src Source address, must be word aligned.
|
11
|
+
* @param byte_count Number of bytes to copy - may be zero
|
12
|
+
*/
|
13
|
+
void vpu_memmove_word_aligned(void * dst, const void * src, unsigned int byte_count);
|
14
|
+
|
15
|
+
#endif
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#include <stdint.h>
|
2
|
+
|
3
|
+
#ifndef _vpu_memset_256_h_
|
4
|
+
#define _vpu_memset_256_h_
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Function that replicates a vector. The source address must be word
|
8
|
+
* aligned, the destination address is assumed to be aligned with the
|
9
|
+
* replication pattern in the source. Any number of bytes can be copied.
|
10
|
+
* There should not be an overlap between the destination and source.
|
11
|
+
*
|
12
|
+
* It is assumed that the source address contains 32 replicated bytes (if
|
13
|
+
* the destination address is byte aligned), or that it contains 16
|
14
|
+
* replicated shorts (if the destination address is 16-bit aligned), or
|
15
|
+
* that it contains 8 replicated ints.
|
16
|
+
*
|
17
|
+
* broadcast_32_to_256() and BROADCAST_8_TO_32() cane be used to
|
18
|
+
* create the source vector
|
19
|
+
*
|
20
|
+
* @param dst Destination address
|
21
|
+
* @param src Source address, must be word aligned.
|
22
|
+
* @param byte_count Number of bytes to copy - may be zero
|
23
|
+
*/
|
24
|
+
void vpu_memset_256(void *dst, const void *src, unsigned int byte_count);
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Function that replicates an int over a vector. The vector must be
|
28
|
+
* aligned on an 8-byte boundary. In order to replicate a byte or short over
|
29
|
+
* a vector, combine this with a call to BROADCAST_8_TO_32() or
|
30
|
+
* BROADCAST_16_TO_32(). Declare the vector as a uint64_t x[] in order to
|
31
|
+
* guarantee 8-byte alignement.
|
32
|
+
*
|
33
|
+
* @param dst Destination address, must be 8-byte aligned
|
34
|
+
* @param from Value to be replicated
|
35
|
+
*/
|
36
|
+
void broadcast_32_to_256(void *dst, uint32_t from);
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Macro that replicates a byte over an int.
|
40
|
+
* Use with broadcast_32_to_256() in order to replicate a byte over a vector
|
41
|
+
*/
|
42
|
+
#define BROADCAST_8_TO_32(f) (((uint8_t)f) * 0x01010101)
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Macro that replicates a short over an int
|
46
|
+
* Use with broadcast_32_to_256() in order to replicate a short over a vector
|
47
|
+
*/
|
48
|
+
#define BROADCAST_16_TO_32(f) (((uint16_t)f) * 0x00010001)
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Macro that replicates a byte over a short
|
52
|
+
*/
|
53
|
+
#define BROADCAST_8_TO_16(f) (((uint8_t)f) * 0x00000101)
|
54
|
+
|
55
|
+
#endif
|
@@ -0,0 +1,118 @@
|
|
1
|
+
// Copyright 2020 XMOS LIMITED. This Software is subject to the terms of the
|
2
|
+
// XMOS Public License: Version 1
|
3
|
+
|
4
|
+
#ifndef LIB_NN_VPU_SIM_H_
|
5
|
+
#define LIB_NN_VPU_SIM_H_
|
6
|
+
|
7
|
+
#include <assert.h>
|
8
|
+
#include <stdint.h>
|
9
|
+
#include <string.h>
|
10
|
+
|
11
|
+
#include "nn_types.h"
|
12
|
+
#include "xs3_vpu.h"
|
13
|
+
|
14
|
+
C_API
|
15
|
+
typedef union {
|
16
|
+
uint8_t u8[VPU_INT8_EPV];
|
17
|
+
int8_t s8[VPU_INT8_EPV];
|
18
|
+
|
19
|
+
uint16_t u16[VPU_INT16_EPV];
|
20
|
+
int16_t s16[VPU_INT16_EPV];
|
21
|
+
|
22
|
+
uint32_t u32[VPU_INT32_EPV];
|
23
|
+
int32_t s32[VPU_INT32_EPV];
|
24
|
+
} vpu_vector_t;
|
25
|
+
|
26
|
+
C_API
|
27
|
+
typedef enum {
|
28
|
+
MODE_S32 = 0x00,
|
29
|
+
MODE_S16 = 0x100,
|
30
|
+
MODE_S8 = 0x200,
|
31
|
+
} vector_mode;
|
32
|
+
|
33
|
+
C_API
|
34
|
+
typedef struct {
|
35
|
+
vector_mode mode;
|
36
|
+
vpu_vector_t vR;
|
37
|
+
vpu_vector_t vD;
|
38
|
+
vpu_vector_t vC;
|
39
|
+
} xs3_vpu;
|
40
|
+
|
41
|
+
C_API void VSETC(xs3_vpu* vpu, const vector_mode mode);
|
42
|
+
C_API void VCLRDR(xs3_vpu* vpu);
|
43
|
+
C_API void VLDR(xs3_vpu* vpu, const void* addr);
|
44
|
+
C_API void VLDD(xs3_vpu* vpu, const void* addr);
|
45
|
+
C_API void VLDC(xs3_vpu* vpu, const void* addr);
|
46
|
+
C_API void VSTR(const xs3_vpu* vpu, void* addr);
|
47
|
+
C_API void VSTD(const xs3_vpu* vpu, void* addr);
|
48
|
+
C_API void VSTC(const xs3_vpu* vpu, void* addr);
|
49
|
+
C_API void VSTRPV(const xs3_vpu* vpu, void* addr, unsigned mask);
|
50
|
+
C_API void VLMACC(xs3_vpu* vpu, const void* addr);
|
51
|
+
C_API void VLMACCR(xs3_vpu* vpu, const void* addr);
|
52
|
+
C_API void VLMACCR1(xs3_vpu* vpu, const void* addr);
|
53
|
+
C_API void VPOS(xs3_vpu* vpu);
|
54
|
+
C_API void VLSAT(xs3_vpu* vpu, const void* addr);
|
55
|
+
C_API void VLSAT_FIXED(xs3_vpu* vpu, const void* addr);
|
56
|
+
C_API void VLASHR(xs3_vpu* vpu, const void* addr, const int32_t shr);
|
57
|
+
C_API void VLADD(xs3_vpu* vpu, const void* addr);
|
58
|
+
C_API void VLSUB(xs3_vpu* vpu, const void* addr);
|
59
|
+
C_API void VLMUL(xs3_vpu* vpu, const void* addr);
|
60
|
+
C_API void VDEPTH1(xs3_vpu* vpu);
|
61
|
+
C_API void VDEPTH8(xs3_vpu* vpu);
|
62
|
+
C_API void VDEPTH16(xs3_vpu* vpu);
|
63
|
+
|
64
|
+
/** Print vector register contents based on current vector_mode **/
|
65
|
+
C_API void vpu_accu_print(xs3_vpu* vpu);
|
66
|
+
C_API void vpu_sim_print(xs3_vpu* vpu);
|
67
|
+
C_API void vpu_sim_mem_print(void* address, vector_mode mode);
|
68
|
+
|
69
|
+
// Function for implementing the saturation logic within the VPU.
|
70
|
+
C_API int64_t vpu_saturate(const int64_t input, const unsigned bits);
|
71
|
+
|
72
|
+
// Assert if the memory access is non-word aligned
|
73
|
+
// void assert_word_aligned(const void* address);
|
74
|
+
#define assert_word_aligned(address) assert(((uintptr_t)address & 0x3) == 0);
|
75
|
+
|
76
|
+
#ifdef __cplusplus
|
77
|
+
|
78
|
+
namespace nn {
|
79
|
+
|
80
|
+
class VPU {
|
81
|
+
private:
|
82
|
+
xs3_vpu vpu;
|
83
|
+
|
84
|
+
public:
|
85
|
+
vpu_vector_t& vD;
|
86
|
+
vpu_vector_t& vR;
|
87
|
+
vpu_vector_t& vC;
|
88
|
+
vector_mode& mode;
|
89
|
+
|
90
|
+
public:
|
91
|
+
VPU() : vD(vpu.vD), vR(vpu.vR), vC(vpu.vC), mode(vpu.mode) {}
|
92
|
+
|
93
|
+
/** `mode` should be one of `MODE_S32`, `MODE_S16` or `MODE_S8` */
|
94
|
+
void vsetc(const vector_mode mode) { VSETC(&this->vpu, mode); }
|
95
|
+
void vclrdr() { VCLRDR(&this->vpu); }
|
96
|
+
void vldr(void const* addr) { VLDR(&this->vpu, addr); }
|
97
|
+
void vldd(void const* addr) { VLDD(&this->vpu, addr); }
|
98
|
+
void vldc(void const* addr) { VLDC(&this->vpu, addr); }
|
99
|
+
void vstr(void* addr) { VSTR(&this->vpu, addr); }
|
100
|
+
void vstd(void* addr) { VSTD(&this->vpu, addr); }
|
101
|
+
void vstc(void* addr) { VSTC(&this->vpu, addr); }
|
102
|
+
void vstrpv(void* addr, uint32_t mask) { VSTRPV(&this->vpu, addr, mask); }
|
103
|
+
void vlmacc(void const* addr) { VLMACC(&this->vpu, addr); }
|
104
|
+
void vlmaccr(void const* addr) { VLMACCR(&this->vpu, addr); }
|
105
|
+
void vlmaccr1(void const* addr) { VLMACCR1(&this->vpu, addr); }
|
106
|
+
void vlsat(void const* addr) { VLSAT(&this->vpu, addr); }
|
107
|
+
void vlashr(void const* addr, int32_t shr) { VLASHR(&this->vpu, addr, shr); }
|
108
|
+
void vladd(void const* addr) { VLADD(&this->vpu, addr); }
|
109
|
+
void vlsub(void const* addr) { VLSUB(&this->vpu, addr); }
|
110
|
+
void vlmul(void const* addr) { VLMUL(&this->vpu, addr); }
|
111
|
+
void vdepth1() { VDEPTH1(&this->vpu); }
|
112
|
+
void vdepth8() { VDEPTH8(&this->vpu); }
|
113
|
+
void vdepth16() { VDEPTH16(&this->vpu); }
|
114
|
+
};
|
115
|
+
} // namespace nn
|
116
|
+
|
117
|
+
#endif
|
118
|
+
#endif // LIB_NN_VPU_SIM_H_
|
@@ -0,0 +1,216 @@
|
|
1
|
+
// Copyright 2020-2021 XMOS LIMITED.
|
2
|
+
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
3
|
+
|
4
|
+
#ifndef XS3_VPU_H_
|
5
|
+
#define XS3_VPU_H_
|
6
|
+
|
7
|
+
#include <xs3a_registers.h>
|
8
|
+
|
9
|
+
#include "nn_api.h"
|
10
|
+
|
11
|
+
#ifndef XS1_VSR_TYPE
|
12
|
+
|
13
|
+
/* TODO use from xs3a_kernel.h in a future tools release */
|
14
|
+
#define XS1_VSR_HEADROOM_SHIFT 0x0
|
15
|
+
#define XS1_VSR_HEADROOM_SIZE 0x5
|
16
|
+
#define XS1_VSR_HEADROOM_MASK \
|
17
|
+
(((1 << XS1_VSR_HEADROOM_SIZE) - 1) << XS1_VSR_HEADROOM_SHIFT)
|
18
|
+
#define XS1_VSR_HEADROOM(x) \
|
19
|
+
(((x)&XS1_VSR_HEADROOM_MASK) >> XS1_VSR_HEADROOM_SHIFT)
|
20
|
+
#define XS1_VSR_HEADROOM_SET(x, v) \
|
21
|
+
(((x) & ~XS1_VSR_HEADROOM_MASK) | \
|
22
|
+
(((v) << XS1_VSR_HEADROOM_SHIFT) & XS1_VSR_HEADROOM_MASK))
|
23
|
+
#define XS1_VSR_SHIFT_SHIFT 0x6
|
24
|
+
#define XS1_VSR_SHIFT_SIZE 0x2
|
25
|
+
#define XS1_VSR_SHIFT_MASK \
|
26
|
+
(((1 << XS1_VSR_SHIFT_SIZE) - 1) << XS1_VSR_SHIFT_SHIFT)
|
27
|
+
#define XS1_VSR_SHIFT(x) (((x)&XS1_VSR_SHIFT_MASK) >> XS1_VSR_SHIFT_SHIFT)
|
28
|
+
#define XS1_VSR_SHIFT_SET(x, v) \
|
29
|
+
(((x) & ~XS1_VSR_SHIFT_MASK) | \
|
30
|
+
(((v) << XS1_VSR_SHIFT_SHIFT) & XS1_VSR_SHIFT_MASK))
|
31
|
+
#define XS1_VSR_TYPE_SHIFT 0x8
|
32
|
+
#define XS1_VSR_TYPE_SIZE 0x4
|
33
|
+
#define XS1_VSR_TYPE_MASK (((1 << XS1_VSR_TYPE_SIZE) - 1) << XS1_VSR_TYPE_SHIFT)
|
34
|
+
#define XS1_VSR_TYPE(x) (((x)&XS1_VSR_TYPE_MASK) >> XS1_VSR_TYPE_SHIFT)
|
35
|
+
#define XS1_VSR_TYPE_SET(x, v) \
|
36
|
+
(((x) & ~XS1_VSR_TYPE_MASK) | \
|
37
|
+
(((v) << XS1_VSR_TYPE_SHIFT) & XS1_VSR_TYPE_MASK))
|
38
|
+
#define XS1_VSR_LENGTH_SHIFT 0xc
|
39
|
+
#define XS1_VSR_LENGTH_SIZE 0x4
|
40
|
+
#define XS1_VSR_LENGTH_MASK \
|
41
|
+
(((1 << XS1_VSR_LENGTH_SIZE) - 1) << XS1_VSR_LENGTH_SHIFT)
|
42
|
+
#define XS1_VSR_LENGTH(x) (((x)&XS1_VSR_LENGTH_MASK) >> XS1_VSR_LENGTH_SHIFT)
|
43
|
+
#define XS1_VSR_LENGTH_SET(x, v) \
|
44
|
+
(((x) & ~XS1_VSR_LENGTH_MASK) | \
|
45
|
+
(((v) << XS1_VSR_LENGTH_SHIFT) & XS1_VSR_LENGTH_MASK))
|
46
|
+
|
47
|
+
#endif
|
48
|
+
|
49
|
+
#define XS1_VSETC_SHIFT_NOSHIFT 0x0
|
50
|
+
#define XS1_VSETC_SHIFT_SHIFTLEFT 0x1
|
51
|
+
#define XS1_VSETC_SHIFT_SHIFTRIGHT 0x2
|
52
|
+
#define XS1_VSETC_TYPE_INT32 0x0
|
53
|
+
#define XS1_VSETC_TYPE_INT16 0x1
|
54
|
+
#define XS1_VSETC_TYPE_INT8 0x2
|
55
|
+
|
56
|
+
#define XS1_NUM_WORDS_PER_VECTOR 0x8
|
57
|
+
|
58
|
+
/* End of xs3a_kernel.h */
|
59
|
+
|
60
|
+
#define XS3_VPU_VREG_WIDTH_BITS (XS1_NUM_WORDS_PER_VECTOR * XS1_ALL_BITS_SIZE)
|
61
|
+
#define XS3_VPU_VREG_WIDTH_BYTES (XS3_VPU_VREG_WIDTH_BITS >> 3)
|
62
|
+
#define XS3_VPU_VREG_WIDTH_WORDS (XS3_VPU_VREG_WIDTH_BYTES >> 2)
|
63
|
+
|
64
|
+
#ifndef __ASSEMBLER__
|
65
|
+
|
66
|
+
C_API enum {
|
67
|
+
VEC_INT_32 = 0, /**< 0 */
|
68
|
+
VEC_INT_16 = 1, /**< 1 */
|
69
|
+
VEC_INT_8 = 2, /**< 2 */
|
70
|
+
VEC_FLT_32 = 4, /**< 4 */
|
71
|
+
VEC_FLT_16 = 5, /**< 5 */
|
72
|
+
VEC_FLT_8 = 6, /**< 6 */
|
73
|
+
};
|
74
|
+
|
75
|
+
C_API enum {
|
76
|
+
VEC_SH0 = 0, /**< 0 */
|
77
|
+
VEC_SHL = 1, /**< 1 */
|
78
|
+
VEC_SHR = 2, /**< 2 */
|
79
|
+
};
|
80
|
+
|
81
|
+
/**
|
82
|
+
* The saturation bounds for signed integers in each VPU operating mode.
|
83
|
+
*/
|
84
|
+
C_API enum {
|
85
|
+
VPU_INT8_MAX = 0x7F, /**< 0x7F */
|
86
|
+
VPU_INT8_MIN = -0x7F, /**< -0x7F */
|
87
|
+
|
88
|
+
VPU_INT16_MAX = 0x7FFF, /**< 0x7FFF */
|
89
|
+
VPU_INT16_MIN = -0x7FFF, /**< -0x7FFF */
|
90
|
+
|
91
|
+
VPU_INT32_MAX = 0x7FFFFFFF, /**< 0x7FFFFFFF */
|
92
|
+
VPU_INT32_MIN = -0x7FFFFFFF, /**< -0x7FFFFFFF */
|
93
|
+
};
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Number of accumulator bits in each operating mode.
|
97
|
+
*
|
98
|
+
* In each operating mode, the VLMACC, VLMACCR and VLSAT instructions operate on
|
99
|
+
* an array of accumulators in the vector registers vR and vD. In each case, the
|
100
|
+
* most significant bits are stored in vD, and the least significant bits are
|
101
|
+
* stored in vR.
|
102
|
+
*/
|
103
|
+
C_API enum {
|
104
|
+
VPU_INT8_ACC_SIZE = 32, /**< 32 */
|
105
|
+
VPU_INT16_ACC_SIZE = 32, /**< 32 */
|
106
|
+
VPU_INT32_ACC_SIZE = 40, /**< 40 */
|
107
|
+
};
|
108
|
+
|
109
|
+
/**
|
110
|
+
* When vD and vR contain accumulators, the values in this enum indicate how
|
111
|
+
* many least significant bits are stored in vR, with the remaining bits stored
|
112
|
+
* in vD.
|
113
|
+
*/
|
114
|
+
C_API enum {
|
115
|
+
VPU_INT8_ACC_VR_BITS = 16, /**< 16 */
|
116
|
+
VPU_INT16_ACC_VR_BITS = 16, /**< 16 */
|
117
|
+
VPU_INT32_ACC_VR_BITS = 32, /**< 32 */
|
118
|
+
};
|
119
|
+
/**
|
120
|
+
* When vD and vR contain accumulators, the values in this enum can be used to
|
121
|
+
* mask off the bits of the accumulator value which correspond to the portion in
|
122
|
+
* vR.
|
123
|
+
*/
|
124
|
+
C_API enum {
|
125
|
+
VPU_INT8_ACC_VR_MASK = 0xFFFF, /**< 0xFFFF */
|
126
|
+
VPU_INT16_ACC_VR_MASK = 0xFFFF, /**< 0xFFFF */
|
127
|
+
VPU_INT32_ACC_VR_MASK = 0xFFFFFFFF, /**< 0xFFFFFFFF */
|
128
|
+
};
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Integer type which fits a single accumulator (32-bits) corresponding to the
|
132
|
+
* 8-bit VPU mode.
|
133
|
+
*/
|
134
|
+
C_API typedef int32_t vpu_int8_acc_t;
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Integer type which fits a single accumulator (32-bits) corresponding to the
|
138
|
+
* 16-bit VPU mode.
|
139
|
+
*/
|
140
|
+
C_API typedef int32_t vpu_int16_acc_t;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Integer type which fits a single accumulator (40-bits) corresponding to the
|
144
|
+
* 32-bit VPU mode.
|
145
|
+
*/
|
146
|
+
C_API typedef int64_t vpu_int32_acc_t;
|
147
|
+
|
148
|
+
/**
|
149
|
+
* The number of elements which fit into a vector register for each operating
|
150
|
+
* mode.
|
151
|
+
*
|
152
|
+
* This is also the number of elements which are operated on in the following
|
153
|
+
* instructions: VDEPTH1, VDEPTH16, VDEPTH8, VLADD, VLADDD, VLASHR, VLMACCR,
|
154
|
+
* VLMUL, VLSUB, VPOS, VSIGN
|
155
|
+
*
|
156
|
+
*/
|
157
|
+
C_API enum {
|
158
|
+
VPU_INT8_EPV = 32, /**< 32 */
|
159
|
+
VPU_INT16_EPV = 16, /**< 16 */
|
160
|
+
VPU_INT32_EPV = 8, /**< 8 */
|
161
|
+
};
|
162
|
+
|
163
|
+
/**
|
164
|
+
* log-base-2 of the corresponding VPU_INT*_EPV values.
|
165
|
+
*/
|
166
|
+
C_API enum {
|
167
|
+
VPU_INT8_EPV_LOG2 = 5, /**< 5 */
|
168
|
+
VPU_INT16_EPV_LOG2 = 4, /**< 4 */
|
169
|
+
VPU_INT32_EPV_LOG2 = 3, /**< 3 */
|
170
|
+
};
|
171
|
+
|
172
|
+
/**
|
173
|
+
* The number of accumulators, spread across vR and vD, in each operating mode.
|
174
|
+
*
|
175
|
+
* This is also the number of elements consumed (number of multiplies) by the
|
176
|
+
* VLMACC instruction.
|
177
|
+
*/
|
178
|
+
C_API enum {
|
179
|
+
VPU_BIN_ACC_PERIOD = 16, /**< 16 */
|
180
|
+
VPU_INT8_ACC_PERIOD = 16, /**< 16 */
|
181
|
+
VPU_INT16_ACC_PERIOD = 16, /**< 16 */
|
182
|
+
VPU_INT32_ACC_PERIOD = 8, /**< 8 */
|
183
|
+
};
|
184
|
+
|
185
|
+
/**
|
186
|
+
* log-base-2 of the corresponding VPU_INT*_ACC_PERIOD values.
|
187
|
+
*/
|
188
|
+
C_API enum {
|
189
|
+
VPU_INT8_ACC_PERIOD_LOG2 = 4, /**< 4 */
|
190
|
+
VPU_INT16_ACC_PERIOD_LOG2 = 4, /**< 4 */
|
191
|
+
VPU_INT32_ACC_PERIOD_LOG2 = 3, /**< 3 */
|
192
|
+
};
|
193
|
+
|
194
|
+
/**
|
195
|
+
* The number of elements consumed by a VLMACC instruction in each operating
|
196
|
+
* mode. In other words, the number of simultaneous multiply-accumulates
|
197
|
+
* performed by the VLMACC instruction.
|
198
|
+
*/
|
199
|
+
C_API enum {
|
200
|
+
VPU_INT8_VLMACC_ELMS = 16, /**< 16 */
|
201
|
+
VPU_INT16_VLMACC_ELMS = 16, /**< 16 */
|
202
|
+
VPU_INT32_VLMACC_ELMS = 8, /**< 8 */
|
203
|
+
};
|
204
|
+
|
205
|
+
/**
|
206
|
+
* log-base-2 of the corresponding VPU_INT*_VLMACC_ELMS values.
|
207
|
+
*/
|
208
|
+
C_API enum {
|
209
|
+
VPU_INT8_VLMACC_ELMS_LOG2 = 4, /**< 4 */
|
210
|
+
VPU_INT16_VLMACC_ELMS_LOG2 = 4, /**< 4 */
|
211
|
+
VPU_INT32_VLMACC_ELMS_LOG2 = 3, /**< 3 */
|
212
|
+
};
|
213
|
+
|
214
|
+
#endif //__ASM__
|
215
|
+
|
216
|
+
#endif // XS3_VPU_H_
|