├── .gitignore ├── CMakeLists.txt ├── CMakeLists_template.txt ├── README.md ├── benchmark_results.txt ├── examples ├── hello_world │ ├── CMakeLists.txt │ ├── constants.cpp │ ├── constants.h │ ├── hello_world_float_model_data.cpp │ ├── hello_world_float_model_data.h │ ├── hello_world_int8_model_data.cpp │ ├── hello_world_int8_model_data.h │ ├── hello_world_test.cpp │ ├── main.cpp │ ├── main_functions.cpp │ ├── main_functions.h │ ├── output_handler.h │ ├── output_handler_test.cpp │ └── rp2 │ │ └── output_handler.cpp └── person_detection │ ├── CMakeLists.txt │ ├── detection_responder.cpp │ ├── detection_responder.h │ ├── detection_responder_test.cpp │ ├── image_provider.cpp │ ├── image_provider.h │ ├── image_provider_test.cpp │ ├── main.cpp │ ├── main_functions.cpp │ ├── main_functions.h │ ├── model_settings.cpp │ ├── model_settings.h │ ├── no_person_image_data.h │ ├── person_detect_model_data.h │ ├── person_detection_test.cpp │ ├── person_image_data.h │ └── tensorflow │ └── lite │ └── micro │ ├── benchmarks │ └── person_detection_benchmark.cpp │ └── tools │ └── make │ └── downloads │ └── person_model │ ├── no_person_image_data.cpp │ ├── person_detect_model_data.cpp │ └── person_image_data.cpp ├── pico_sdk_import.cmake ├── src ├── signal │ ├── micro │ │ └── kernels │ │ │ ├── delay.cpp │ │ │ ├── delay_flexbuffers_generated_data.h │ │ │ ├── energy.cpp │ │ │ ├── energy_flexbuffers_generated_data.h │ │ │ ├── fft_auto_scale_common.cpp │ │ │ ├── fft_auto_scale_kernel.cpp │ │ │ ├── fft_auto_scale_kernel.h │ │ │ ├── fft_flexbuffers_generated_data.h │ │ │ ├── filter_bank.cpp │ │ │ ├── filter_bank_flexbuffers_generated_data.h │ │ │ ├── filter_bank_log.cpp │ │ │ ├── filter_bank_log_flexbuffers_generated_data.h │ │ │ ├── filter_bank_spectral_subtraction.cpp │ │ │ ├── filter_bank_spectral_subtraction_flexbuffers_generated_data.h │ │ │ ├── filter_bank_square_root.cpp │ │ │ ├── filter_bank_square_root.h │ │ │ ├── filter_bank_square_root_common.cpp │ │ │ ├── framer.cpp │ │ │ ├── framer_flexbuffers_generated_data.h │ │ │ ├── irfft.cpp │ │ │ ├── irfft.h │ │ │ ├── overlap_add.cpp │ │ │ ├── overlap_add_flexbuffers_generated_data.h │ │ │ ├── pcan.cpp │ │ │ ├── pcan_flexbuffers_generated_data.h │ │ │ ├── rfft.cpp │ │ │ ├── rfft.h │ │ │ ├── stacker.cpp │ │ │ ├── stacker_flexbuffers_generated_data.h │ │ │ ├── window.cpp │ │ │ └── window_flexbuffers_generated_data.h │ └── src │ │ ├── circular_buffer.cpp │ │ ├── circular_buffer.h │ │ ├── complex.h │ │ ├── energy.cpp │ │ ├── energy.h │ │ ├── fft_auto_scale.cpp │ │ ├── fft_auto_scale.h │ │ ├── filter_bank.cpp │ │ ├── filter_bank.h │ │ ├── filter_bank_log.cpp │ │ ├── filter_bank_log.h │ │ ├── filter_bank_spectral_subtraction.cpp │ │ ├── filter_bank_spectral_subtraction.h │ │ ├── filter_bank_square_root.cpp │ │ ├── filter_bank_square_root.h │ │ ├── irfft.h │ │ ├── irfft_float.cpp │ │ ├── irfft_int16.cpp │ │ ├── irfft_int32.cpp │ │ ├── kiss_fft_wrappers │ │ ├── kiss_fft_common.h │ │ ├── kiss_fft_float.cpp │ │ ├── kiss_fft_float.h │ │ ├── kiss_fft_int16.cpp │ │ ├── kiss_fft_int16.h │ │ ├── kiss_fft_int32.cpp │ │ └── kiss_fft_int32.h │ │ ├── log.cpp │ │ ├── log.h │ │ ├── max_abs.cpp │ │ ├── max_abs.h │ │ ├── msb.h │ │ ├── msb_32.cpp │ │ ├── msb_64.cpp │ │ ├── overlap_add.cpp │ │ ├── overlap_add.h │ │ ├── pcan_argc_fixed.cpp │ │ ├── pcan_argc_fixed.h │ │ ├── rfft.h │ │ ├── rfft_float.cpp │ │ ├── rfft_int16.cpp │ │ ├── rfft_int32.cpp │ │ ├── square_root.h │ │ ├── square_root_32.cpp │ │ ├── square_root_64.cpp │ │ ├── window.cpp │ │ └── window.h ├── tensorflow │ ├── compiler │ │ └── mlir │ │ │ └── lite │ │ │ ├── core │ │ │ ├── api │ │ │ │ ├── error_reporter.cpp │ │ │ │ └── error_reporter.h │ │ │ └── c │ │ │ │ ├── builtin_op_data.h │ │ │ │ └── tflite_types.h │ │ │ ├── kernels │ │ │ └── internal │ │ │ │ └── compatibility_macros.h │ │ │ └── schema │ │ │ ├── schema_generated.h │ │ │ ├── schema_utils.cpp │ │ │ └── schema_utils.h │ └── lite │ │ ├── builtin_op_data.h │ │ ├── builtin_ops.h │ │ ├── c │ │ ├── builtin_op_data.h │ │ ├── c_api_types.h │ │ └── common.h │ │ ├── context_util.h │ │ ├── core │ │ ├── api │ │ │ ├── error_reporter.h │ │ │ ├── flatbuffer_conversions.cpp │ │ │ ├── flatbuffer_conversions.h │ │ │ ├── tensor_utils.cpp │ │ │ └── tensor_utils.h │ │ ├── c │ │ │ ├── builtin_op_data.h │ │ │ ├── c_api_types.h │ │ │ ├── common.cpp │ │ │ └── common.h │ │ └── macros.h │ │ ├── kernels │ │ ├── internal │ │ │ ├── common.cpp │ │ │ ├── common.h │ │ │ ├── compatibility.h │ │ │ ├── cppmath.h │ │ │ ├── max.h │ │ │ ├── min.h │ │ │ ├── optimized │ │ │ │ └── neon_check.h │ │ │ ├── portable_tensor.h │ │ │ ├── portable_tensor_utils.cpp │ │ │ ├── portable_tensor_utils.h │ │ │ ├── quantization_util.cpp │ │ │ ├── quantization_util.h │ │ │ ├── reference │ │ │ │ ├── add.h │ │ │ │ ├── add_n.h │ │ │ │ ├── arg_min_max.h │ │ │ │ ├── batch_matmul.h │ │ │ │ ├── batch_to_space_nd.h │ │ │ │ ├── binary_function.h │ │ │ │ ├── broadcast_args.h │ │ │ │ ├── broadcast_to.h │ │ │ │ ├── ceil.h │ │ │ │ ├── comparisons.cpp │ │ │ │ ├── comparisons.h │ │ │ │ ├── concatenation.h │ │ │ │ ├── conv.h │ │ │ │ ├── cumsum.h │ │ │ │ ├── depth_to_space.h │ │ │ │ ├── depthwiseconv_float.h │ │ │ │ ├── depthwiseconv_uint8.h │ │ │ │ ├── dequantize.h │ │ │ │ ├── div.h │ │ │ │ ├── elu.h │ │ │ │ ├── exp.h │ │ │ │ ├── fill.h │ │ │ │ ├── floor.h │ │ │ │ ├── floor_div.h │ │ │ │ ├── floor_mod.h │ │ │ │ ├── fully_connected.h │ │ │ │ ├── hard_swish.h │ │ │ │ ├── integer_ops │ │ │ │ │ ├── add.h │ │ │ │ │ ├── conv.h │ │ │ │ │ ├── depthwise_conv.h │ │ │ │ │ ├── fully_connected.h │ │ │ │ │ ├── l2normalization.h │ │ │ │ │ ├── logistic.h │ │ │ │ │ ├── mean.h │ │ │ │ │ ├── mul.h │ │ │ │ │ ├── pooling.h │ │ │ │ │ ├── tanh.h │ │ │ │ │ └── transpose_conv.h │ │ │ │ ├── l2normalization.h │ │ │ │ ├── leaky_relu.h │ │ │ │ ├── log_softmax.h │ │ │ │ ├── logistic.h │ │ │ │ ├── lstm_cell.h │ │ │ │ ├── maximum_minimum.h │ │ │ │ ├── mul.h │ │ │ │ ├── neg.h │ │ │ │ ├── pad.h │ │ │ │ ├── pooling.h │ │ │ │ ├── portable_tensor_utils.cpp │ │ │ │ ├── portable_tensor_utils.h │ │ │ │ ├── portable_tensor_utils_impl.h │ │ │ │ ├── prelu.h │ │ │ │ ├── process_broadcast_shapes.h │ │ │ │ ├── quantize.h │ │ │ │ ├── reduce.h │ │ │ │ ├── requantize.h │ │ │ │ ├── resize_bilinear.h │ │ │ │ ├── resize_nearest_neighbor.h │ │ │ │ ├── round.h │ │ │ │ ├── select.h │ │ │ │ ├── slice.h │ │ │ │ ├── softmax.h │ │ │ │ ├── space_to_batch_nd.h │ │ │ │ ├── space_to_depth.h │ │ │ │ ├── strided_slice.h │ │ │ │ ├── sub.h │ │ │ │ ├── tanh.h │ │ │ │ ├── transpose.h │ │ │ │ └── transpose_conv.h │ │ │ ├── runtime_shape.cpp │ │ │ ├── runtime_shape.h │ │ │ ├── strided_slice_logic.h │ │ │ ├── tensor_ctypes.cpp │ │ │ ├── tensor_ctypes.h │ │ │ ├── tensor_utils.cpp │ │ │ └── types.h │ │ ├── kernel_util.cpp │ │ ├── kernel_util.h │ │ ├── op_macros.h │ │ └── padding.h │ │ ├── micro │ │ ├── arena_allocator │ │ │ ├── ibuffer_allocator.h │ │ │ ├── non_persistent_arena_buffer_allocator.cpp │ │ │ ├── non_persistent_arena_buffer_allocator.h │ │ │ ├── persistent_arena_buffer_allocator.cpp │ │ │ ├── persistent_arena_buffer_allocator.h │ │ │ ├── recording_single_arena_buffer_allocator.cpp │ │ │ ├── recording_single_arena_buffer_allocator.h │ │ │ ├── single_arena_buffer_allocator.cpp │ │ │ └── single_arena_buffer_allocator.h │ │ ├── benchmarks │ │ │ └── micro_benchmark.h │ │ ├── compatibility.h │ │ ├── compression.h │ │ ├── debug_log.cpp │ │ ├── debug_log.h │ │ ├── fake_micro_context.cpp │ │ ├── fake_micro_context.h │ │ ├── flatbuffer_utils.cpp │ │ ├── flatbuffer_utils.h │ │ ├── hexdump.cpp │ │ ├── hexdump.h │ │ ├── hexdump_test.cpp │ │ ├── kernels │ │ │ ├── activation_utils.h │ │ │ ├── activations.cpp │ │ │ ├── activations.h │ │ │ ├── activations_common.cpp │ │ │ ├── add.h │ │ │ ├── add_common.cpp │ │ │ ├── add_n.cpp │ │ │ ├── arg_min_max.cpp │ │ │ ├── assign_variable.cpp │ │ │ ├── batch_matmul.h │ │ │ ├── batch_to_space_nd.cpp │ │ │ ├── broadcast_args.cpp │ │ │ ├── broadcast_to.cpp │ │ │ ├── call_once.cpp │ │ │ ├── cast.cpp │ │ │ ├── ceil.cpp │ │ │ ├── circular_buffer.cpp │ │ │ ├── circular_buffer.h │ │ │ ├── circular_buffer_common.cpp │ │ │ ├── circular_buffer_flexbuffers_generated_data.h │ │ │ ├── cmsis_nn │ │ │ │ ├── add.cpp │ │ │ │ ├── batch_matmul.cpp │ │ │ │ ├── conv.cpp │ │ │ │ ├── depthwise_conv.cpp │ │ │ │ ├── fully_connected.cpp │ │ │ │ ├── mul.cpp │ │ │ │ ├── pooling.cpp │ │ │ │ ├── softmax.cpp │ │ │ │ ├── svdf.cpp │ │ │ │ ├── transpose_conv.cpp │ │ │ │ └── unidirectional_sequence_lstm.cpp │ │ │ ├── comparisons.cpp │ │ │ ├── concatenation.cpp │ │ │ ├── conv.h │ │ │ ├── conv_common.cpp │ │ │ ├── conv_test.h │ │ │ ├── cumsum.cpp │ │ │ ├── decompress.cpp │ │ │ ├── decompress.h │ │ │ ├── decompress_common.cpp │ │ │ ├── depth_to_space.cpp │ │ │ ├── depthwise_conv.h │ │ │ ├── depthwise_conv_common.cpp │ │ │ ├── dequantize.cpp │ │ │ ├── dequantize.h │ │ │ ├── dequantize_common.cpp │ │ │ ├── detection_postprocess.cpp │ │ │ ├── detection_postprocess_flexbuffers_generated_data.h │ │ │ ├── div.cpp │ │ │ ├── elementwise.cpp │ │ │ ├── elu.cpp │ │ │ ├── embedding_lookup.cpp │ │ │ ├── ethosu.cpp │ │ │ ├── ethosu.h │ │ │ ├── exp.cpp │ │ │ ├── expand_dims.cpp │ │ │ ├── fill.cpp │ │ │ ├── floor.cpp │ │ │ ├── floor_div.cpp │ │ │ ├── floor_mod.cpp │ │ │ ├── fully_connected.h │ │ │ ├── fully_connected_common.cpp │ │ │ ├── gather.cpp │ │ │ ├── gather_nd.cpp │ │ │ ├── hard_swish.cpp │ │ │ ├── hard_swish.h │ │ │ ├── hard_swish_common.cpp │ │ │ ├── if.cpp │ │ │ ├── kernel_runner.cpp │ │ │ ├── kernel_runner.h │ │ │ ├── kernel_util.cpp │ │ │ ├── kernel_util.h │ │ │ ├── l2_pool_2d.cpp │ │ │ ├── l2norm.cpp │ │ │ ├── leaky_relu.cpp │ │ │ ├── leaky_relu.h │ │ │ ├── leaky_relu_common.cpp │ │ │ ├── log_softmax.cpp │ │ │ ├── logical.cpp │ │ │ ├── logical.h │ │ │ ├── logical_common.cpp │ │ │ ├── logistic.cpp │ │ │ ├── logistic.h │ │ │ ├── logistic_common.cpp │ │ │ ├── lstm_eval.cpp │ │ │ ├── lstm_eval.h │ │ │ ├── lstm_eval_common.cpp │ │ │ ├── lstm_eval_test.h │ │ │ ├── lstm_shared.h │ │ │ ├── maximum_minimum.cpp │ │ │ ├── micro_ops.h │ │ │ ├── micro_tensor_utils.cpp │ │ │ ├── micro_tensor_utils.h │ │ │ ├── mirror_pad.cpp │ │ │ ├── mul.h │ │ │ ├── mul_common.cpp │ │ │ ├── neg.cpp │ │ │ ├── pack.cpp │ │ │ ├── pad.cpp │ │ │ ├── pad.h │ │ │ ├── pooling.h │ │ │ ├── pooling_common.cpp │ │ │ ├── prelu.cpp │ │ │ ├── prelu.h │ │ │ ├── prelu_common.cpp │ │ │ ├── quantize.cpp │ │ │ ├── quantize.h │ │ │ ├── quantize_common.cpp │ │ │ ├── read_variable.cpp │ │ │ ├── reduce.cpp │ │ │ ├── reduce.h │ │ │ ├── reduce_common.cpp │ │ │ ├── reshape.cpp │ │ │ ├── reshape.h │ │ │ ├── reshape_common.cpp │ │ │ ├── resize_bilinear.cpp │ │ │ ├── resize_nearest_neighbor.cpp │ │ │ ├── round.cpp │ │ │ ├── select.cpp │ │ │ ├── shape.cpp │ │ │ ├── slice.cpp │ │ │ ├── softmax.h │ │ │ ├── softmax_common.cpp │ │ │ ├── space_to_batch_nd.cpp │ │ │ ├── space_to_depth.cpp │ │ │ ├── split.cpp │ │ │ ├── split_v.cpp │ │ │ ├── squared_difference.cpp │ │ │ ├── squeeze.cpp │ │ │ ├── strided_slice.cpp │ │ │ ├── strided_slice.h │ │ │ ├── strided_slice_common.cpp │ │ │ ├── sub.cpp │ │ │ ├── sub.h │ │ │ ├── sub_common.cpp │ │ │ ├── svdf.h │ │ │ ├── svdf_common.cpp │ │ │ ├── tanh.cpp │ │ │ ├── transpose.cpp │ │ │ ├── transpose_conv.h │ │ │ ├── unidirectional_sequence_lstm.h │ │ │ ├── unpack.cpp │ │ │ ├── var_handle.cpp │ │ │ ├── while.cpp │ │ │ └── zeros_like.cpp │ │ ├── memory_helpers.cpp │ │ ├── memory_helpers.h │ │ ├── memory_planner │ │ │ ├── greedy_memory_planner.cpp │ │ │ ├── greedy_memory_planner.h │ │ │ ├── linear_memory_planner.cpp │ │ │ ├── linear_memory_planner.h │ │ │ ├── memory_plan_struct.h │ │ │ ├── micro_memory_planner.h │ │ │ ├── non_persistent_buffer_planner_shim.cpp │ │ │ └── non_persistent_buffer_planner_shim.h │ │ ├── micro_allocation_info.cpp │ │ ├── micro_allocation_info.h │ │ ├── micro_allocator.cpp │ │ ├── micro_allocator.h │ │ ├── micro_arena_constants.h │ │ ├── micro_common.h │ │ ├── micro_context.cpp │ │ ├── micro_context.h │ │ ├── micro_graph.h │ │ ├── micro_interpreter.cpp │ │ ├── micro_interpreter.h │ │ ├── micro_interpreter_context.cpp │ │ ├── micro_interpreter_context.h │ │ ├── micro_interpreter_graph.cpp │ │ ├── micro_interpreter_graph.h │ │ ├── micro_log.cpp │ │ ├── micro_log.h │ │ ├── micro_mutable_op_resolver.h │ │ ├── micro_op_resolver.cpp │ │ ├── micro_op_resolver.h │ │ ├── micro_profiler.cpp │ │ ├── micro_profiler.h │ │ ├── micro_profiler_interface.h │ │ ├── micro_resource_variable.cpp │ │ ├── micro_resource_variable.h │ │ ├── micro_time.cpp │ │ ├── micro_time.h │ │ ├── micro_utils.cpp │ │ ├── micro_utils.h │ │ ├── mock_micro_graph.cpp │ │ ├── mock_micro_graph.h │ │ ├── recording_micro_allocator.cpp │ │ ├── recording_micro_allocator.h │ │ ├── recording_micro_interpreter.h │ │ ├── span.h │ │ ├── static_vector.h │ │ ├── system_setup.cpp │ │ ├── system_setup.h │ │ ├── test_helper_custom_ops.cpp │ │ ├── test_helper_custom_ops.h │ │ ├── test_helpers.cpp │ │ ├── test_helpers.h │ │ ├── testing │ │ │ └── micro_test.h │ │ └── tflite_bridge │ │ │ ├── flatbuffer_conversions_bridge.cpp │ │ │ ├── flatbuffer_conversions_bridge.h │ │ │ ├── micro_error_reporter.cpp │ │ │ └── micro_error_reporter.h │ │ ├── portable_type_to_tflitetype.h │ │ └── schema │ │ ├── schema_generated.h │ │ └── schema_utils.h └── third_party │ ├── cmsis │ ├── CMSIS │ │ └── Core │ │ │ └── Include │ │ │ ├── cmsis_armclang.h │ │ │ ├── cmsis_clang.h │ │ │ ├── cmsis_compiler.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── cmsis_iccarm.h │ │ │ ├── cmsis_version.h │ │ │ ├── core_ca.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm1.h │ │ │ ├── core_cm23.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm33.h │ │ │ ├── core_cm35p.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm52.h │ │ │ ├── core_cm55.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cm85.h │ │ │ ├── core_sc000.h │ │ │ ├── core_sc300.h │ │ │ ├── core_starmc1.h │ │ │ └── tz_context.h │ └── LICENSE │ ├── cmsis_nn │ ├── Include │ │ ├── Internal │ │ │ └── arm_nn_compiler.h │ │ ├── arm_nn_math_types.h │ │ ├── arm_nn_tables.h │ │ ├── arm_nn_types.h │ │ ├── arm_nnfunctions.h │ │ └── arm_nnsupportfunctions.h │ ├── LICENSE │ └── Source │ │ ├── ActivationFunctions │ │ ├── arm_nn_activation_s16.c │ │ ├── arm_relu6_s8.c │ │ ├── arm_relu_q15.c │ │ └── arm_relu_q7.c │ │ ├── BasicMathFunctions │ │ ├── arm_elementwise_add_s16.c │ │ ├── arm_elementwise_add_s8.c │ │ ├── arm_elementwise_mul_acc_s16.c │ │ ├── arm_elementwise_mul_s16.c │ │ ├── arm_elementwise_mul_s16_batch_offset.c │ │ ├── arm_elementwise_mul_s16_s8.c │ │ ├── arm_elementwise_mul_s8.c │ │ ├── arm_maximum_s8.c │ │ └── arm_minimum_s8.c │ │ ├── ConcatenationFunctions │ │ ├── arm_concatenation_s8_w.c │ │ ├── arm_concatenation_s8_x.c │ │ ├── arm_concatenation_s8_y.c │ │ └── arm_concatenation_s8_z.c │ │ ├── ConvolutionFunctions │ │ ├── arm_convolve_1_x_n_s4.c │ │ ├── arm_convolve_1_x_n_s8.c │ │ ├── arm_convolve_1x1_s4.c │ │ ├── arm_convolve_1x1_s4_fast.c │ │ ├── arm_convolve_1x1_s8.c │ │ ├── arm_convolve_1x1_s8_fast.c │ │ ├── arm_convolve_even_s4.c │ │ ├── arm_convolve_get_buffer_sizes_s16.c │ │ ├── arm_convolve_get_buffer_sizes_s4.c │ │ ├── arm_convolve_get_buffer_sizes_s8.c │ │ ├── arm_convolve_s16.c │ │ ├── arm_convolve_s4.c │ │ ├── arm_convolve_s8.c │ │ ├── arm_convolve_wrapper_s16.c │ │ ├── arm_convolve_wrapper_s4.c │ │ ├── arm_convolve_wrapper_s8.c │ │ ├── arm_depthwise_conv_3x3_s8.c │ │ ├── arm_depthwise_conv_fast_s16.c │ │ ├── arm_depthwise_conv_get_buffer_sizes_s16.c │ │ ├── arm_depthwise_conv_get_buffer_sizes_s4.c │ │ ├── arm_depthwise_conv_get_buffer_sizes_s8.c │ │ ├── arm_depthwise_conv_s16.c │ │ ├── arm_depthwise_conv_s4.c │ │ ├── arm_depthwise_conv_s4_opt.c │ │ ├── arm_depthwise_conv_s8.c │ │ ├── arm_depthwise_conv_s8_opt.c │ │ ├── arm_depthwise_conv_wrapper_s16.c │ │ ├── arm_depthwise_conv_wrapper_s4.c │ │ ├── arm_depthwise_conv_wrapper_s8.c │ │ ├── arm_nn_depthwise_conv_s8_core.c │ │ ├── arm_nn_mat_mult_kernel_row_offset_s8_s16.c │ │ ├── arm_nn_mat_mult_kernel_s16.c │ │ ├── arm_nn_mat_mult_kernel_s4_s16.c │ │ ├── arm_nn_mat_mult_kernel_s8_s16.c │ │ ├── arm_nn_mat_mult_s8.c │ │ ├── arm_transpose_conv_get_buffer_sizes_s8.c │ │ ├── arm_transpose_conv_s8.c │ │ └── arm_transpose_conv_wrapper_s8.c │ │ ├── FullyConnectedFunctions │ │ ├── arm_batch_matmul_s16.c │ │ ├── arm_batch_matmul_s8.c │ │ ├── arm_fully_connected_get_buffer_sizes_s16.c │ │ ├── arm_fully_connected_get_buffer_sizes_s8.c │ │ ├── arm_fully_connected_per_channel_s8.c │ │ ├── arm_fully_connected_s16.c │ │ ├── arm_fully_connected_s4.c │ │ ├── arm_fully_connected_s8.c │ │ ├── arm_fully_connected_wrapper_s8.c │ │ ├── arm_vector_sum_s8.c │ │ └── arm_vector_sum_s8_s64.c │ │ ├── LSTMFunctions │ │ ├── arm_lstm_unidirectional_s16.c │ │ └── arm_lstm_unidirectional_s8.c │ │ ├── NNSupportFunctions │ │ ├── arm_nn_depthwise_conv_nt_t_padded_s8.c │ │ ├── arm_nn_depthwise_conv_nt_t_s16.c │ │ ├── arm_nn_depthwise_conv_nt_t_s4.c │ │ ├── arm_nn_depthwise_conv_nt_t_s8.c │ │ ├── arm_nn_lstm_calculate_gate_s16.c │ │ ├── arm_nn_lstm_calculate_gate_s8_s16.c │ │ ├── arm_nn_lstm_step_s16.c │ │ ├── arm_nn_lstm_step_s8.c │ │ ├── arm_nn_mat_mul_core_1x_s4.c │ │ ├── arm_nn_mat_mul_core_1x_s8.c │ │ ├── arm_nn_mat_mul_core_4x_s8.c │ │ ├── arm_nn_mat_mult_nt_interleaved_t_even_s4.c │ │ ├── arm_nn_mat_mult_nt_t_s16.c │ │ ├── arm_nn_mat_mult_nt_t_s4.c │ │ ├── arm_nn_mat_mult_nt_t_s8.c │ │ ├── arm_nn_mat_mult_nt_t_s8_s32.c │ │ ├── arm_nn_transpose_conv_row_s8_s32.c │ │ ├── arm_nn_vec_mat_mul_result_acc_s16.c │ │ ├── arm_nn_vec_mat_mul_result_acc_s8_s16.c │ │ ├── arm_nn_vec_mat_mult_t_per_ch_s8.c │ │ ├── arm_nn_vec_mat_mult_t_s16.c │ │ ├── arm_nn_vec_mat_mult_t_s16_s16.c │ │ ├── arm_nn_vec_mat_mult_t_s4.c │ │ ├── arm_nn_vec_mat_mult_t_s8.c │ │ ├── arm_nn_vec_mat_mult_t_svdf_s8.c │ │ ├── arm_nntables.c │ │ ├── arm_q7_to_q15_with_offset.c │ │ └── arm_s8_to_s16_unordered_with_offset.c │ │ ├── PadFunctions │ │ └── arm_pad_s8.c │ │ ├── PoolingFunctions │ │ ├── arm_avgpool_get_buffer_sizes_s16.c │ │ ├── arm_avgpool_get_buffer_sizes_s8.c │ │ ├── arm_avgpool_s16.c │ │ ├── arm_avgpool_s8.c │ │ ├── arm_max_pool_s16.c │ │ └── arm_max_pool_s8.c │ │ ├── ReshapeFunctions │ │ └── arm_reshape_s8.c │ │ ├── SVDFunctions │ │ ├── arm_svdf_get_buffer_sizes_s8.c │ │ ├── arm_svdf_s8.c │ │ └── arm_svdf_state_s16_s8.c │ │ ├── SoftmaxFunctions │ │ ├── arm_nn_softmax_common_s8.c │ │ ├── arm_softmax_s16.c │ │ ├── arm_softmax_s8.c │ │ ├── arm_softmax_s8_s16.c │ │ └── arm_softmax_u8.c │ │ └── TransposeFunctions │ │ └── arm_transpose_s8.c │ ├── flatbuffers │ ├── LICENSE │ └── include │ │ └── flatbuffers │ │ ├── allocator.h │ │ ├── array.h │ │ ├── base.h │ │ ├── buffer.h │ │ ├── buffer_ref.h │ │ ├── code_generator.h │ │ ├── code_generators.h │ │ ├── default_allocator.h │ │ ├── detached_buffer.h │ │ ├── file_manager.h │ │ ├── flatbuffer_builder.h │ │ ├── flatbuffers.h │ │ ├── flex_flat_util.h │ │ ├── flexbuffers.h │ │ ├── grpc.h │ │ ├── hash.h │ │ ├── idl.h │ │ ├── minireflect.h │ │ ├── reflection.h │ │ ├── reflection_generated.h │ │ ├── registry.h │ │ ├── stl_emulation.h │ │ ├── string.h │ │ ├── struct.h │ │ ├── table.h │ │ ├── util.h │ │ ├── vector.h │ │ ├── vector_downward.h │ │ └── verifier.h │ ├── gemmlowp │ ├── LICENSE │ ├── fixedpoint │ │ ├── fixedpoint.h │ │ ├── fixedpoint_neon.h │ │ └── fixedpoint_sse.h │ └── internal │ │ └── detect_platform.h │ ├── kissfft │ ├── COPYING │ ├── _kiss_fft_guts.h │ ├── kiss_fft.c │ ├── kiss_fft.h │ └── tools │ │ ├── kiss_fftr.c │ │ └── kiss_fftr.h │ └── ruy │ └── ruy │ └── profiler │ └── instrumentation.h ├── sync ├── MANIFEST.ini ├── add_usb.py ├── arm_nn_mat_mult_nt_t_s8.c ├── create_tests.py ├── create_tflm_arduino.py ├── fix_arduino_subfolders.py ├── micro_benchmark.h ├── micro_profiler.cpp ├── micro_test.h ├── micro_time.cpp ├── replace_string_with_file_contents.py ├── sync_with_upstream.sh ├── system_setup.cpp ├── test_CMakeLists_template.txt └── transform_source.py └── tests ├── arena_allocator_non_persistent_arena_buffer_allocator_test ├── CMakeLists.txt └── non_persistent_arena_buffer_allocator_test.cpp ├── arena_allocator_persistent_arena_buffer_allocator_test ├── CMakeLists.txt └── persistent_arena_buffer_allocator_test.cpp ├── arena_allocator_recording_single_arena_buffer_allocator_test ├── CMakeLists.txt └── recording_single_arena_buffer_allocator_test.cpp ├── arena_allocator_single_arena_buffer_allocator_test ├── CMakeLists.txt └── single_arena_buffer_allocator_test.cpp ├── fake_micro_context_test ├── CMakeLists.txt └── fake_micro_context_test.cpp ├── flatbuffer_utils_test ├── CMakeLists.txt └── flatbuffer_utils_test.cpp ├── hexdump_test ├── CMakeLists.txt └── hexdump_test.cpp ├── kernels_activations_test ├── CMakeLists.txt └── activations_test.cpp ├── kernels_add_n_test ├── CMakeLists.txt └── add_n_test.cpp ├── kernels_add_test ├── CMakeLists.txt └── add_test.cpp ├── kernels_arg_min_max_test ├── CMakeLists.txt └── arg_min_max_test.cpp ├── kernels_batch_matmul_test ├── CMakeLists.txt └── batch_matmul_test.cpp ├── kernels_batch_to_space_nd_test ├── CMakeLists.txt └── batch_to_space_nd_test.cpp ├── kernels_broadcast_args_test ├── CMakeLists.txt └── broadcast_args_test.cpp ├── kernels_broadcast_to_test ├── CMakeLists.txt └── broadcast_to_test.cpp ├── kernels_call_once_test ├── CMakeLists.txt └── call_once_test.cpp ├── kernels_cast_test ├── CMakeLists.txt └── cast_test.cpp ├── kernels_ceil_test ├── CMakeLists.txt └── ceil_test.cpp ├── kernels_circular_buffer_test ├── CMakeLists.txt ├── circular_buffer_test.cpp └── tensorflow │ └── lite │ └── micro │ └── kernels │ ├── circular_buffer_flexbuffers_generated_data.cpp │ └── circular_buffer_flexbuffers_generated_data.h ├── kernels_comparisons_test ├── CMakeLists.txt └── comparisons_test.cpp ├── kernels_concatenation_test ├── CMakeLists.txt └── concatenation_test.cpp ├── kernels_conv_test ├── CMakeLists.txt ├── conv_test.cpp └── tensorflow │ └── lite │ └── micro │ └── kernels │ ├── conv_test_common.cpp │ └── testdata │ ├── conv_test_data.cpp │ └── conv_test_data.h ├── kernels_cumsum_test ├── CMakeLists.txt └── cumsum_test.cpp ├── kernels_decompress_test ├── CMakeLists.txt └── decompress_test.cpp ├── kernels_depth_to_space_test ├── CMakeLists.txt └── depth_to_space_test.cpp ├── kernels_depthwise_conv_test ├── CMakeLists.txt └── depthwise_conv_test.cpp ├── kernels_dequantize_test ├── CMakeLists.txt └── dequantize_test.cpp ├── kernels_detection_postprocess_test ├── CMakeLists.txt ├── detection_postprocess_test.cpp └── tensorflow │ └── lite │ └── micro │ └── kernels │ ├── detection_postprocess_flexbuffers_generated_data.cpp │ └── detection_postprocess_flexbuffers_generated_data.h ├── kernels_div_test ├── CMakeLists.txt └── div_test.cpp ├── kernels_elementwise_test ├── CMakeLists.txt └── elementwise_test.cpp ├── kernels_elu_test ├── CMakeLists.txt └── elu_test.cpp ├── kernels_embedding_lookup_test ├── CMakeLists.txt └── embedding_lookup_test.cpp ├── kernels_exp_test ├── CMakeLists.txt └── exp_test.cpp ├── kernels_expand_dims_test ├── CMakeLists.txt └── expand_dims_test.cpp ├── kernels_fill_test ├── CMakeLists.txt └── fill_test.cpp ├── kernels_floor_div_test ├── CMakeLists.txt └── floor_div_test.cpp ├── kernels_floor_mod_test ├── CMakeLists.txt └── floor_mod_test.cpp ├── kernels_floor_test ├── CMakeLists.txt └── floor_test.cpp ├── kernels_fully_connected_test ├── CMakeLists.txt └── fully_connected_test.cpp ├── kernels_gather_nd_test ├── CMakeLists.txt └── gather_nd_test.cpp ├── kernels_gather_test ├── CMakeLists.txt └── gather_test.cpp ├── kernels_hard_swish_test ├── CMakeLists.txt └── hard_swish_test.cpp ├── kernels_if_test ├── CMakeLists.txt └── if_test.cpp ├── kernels_l2_pool_2d_test ├── CMakeLists.txt └── l2_pool_2d_test.cpp ├── kernels_l2norm_test ├── CMakeLists.txt └── l2norm_test.cpp ├── kernels_leaky_relu_test ├── CMakeLists.txt └── leaky_relu_test.cpp ├── kernels_log_softmax_test ├── CMakeLists.txt └── log_softmax_test.cpp ├── kernels_logical_test ├── CMakeLists.txt └── logical_test.cpp ├── kernels_logistic_test ├── CMakeLists.txt └── logistic_test.cpp ├── kernels_lstm_eval_test ├── CMakeLists.txt ├── lstm_eval_test.cpp └── tensorflow │ └── lite │ └── micro │ └── kernels │ └── testdata │ ├── lstm_test_data.cpp │ └── lstm_test_data.h ├── kernels_maximum_minimum_test ├── CMakeLists.txt └── maximum_minimum_test.cpp ├── kernels_mirror_pad_test ├── CMakeLists.txt └── mirror_pad_test.cpp ├── kernels_mul_test ├── CMakeLists.txt └── mul_test.cpp ├── kernels_neg_test ├── CMakeLists.txt └── neg_test.cpp ├── kernels_pack_test ├── CMakeLists.txt └── pack_test.cpp ├── kernels_pad_test ├── CMakeLists.txt └── pad_test.cpp ├── kernels_pooling_test ├── CMakeLists.txt └── pooling_test.cpp ├── kernels_prelu_test ├── CMakeLists.txt └── prelu_test.cpp ├── kernels_quantization_util_test ├── CMakeLists.txt └── quantization_util_test.cpp ├── kernels_quantize_test ├── CMakeLists.txt └── quantize_test.cpp ├── kernels_reduce_test ├── CMakeLists.txt └── reduce_test.cpp ├── kernels_reshape_test ├── CMakeLists.txt └── reshape_test.cpp ├── kernels_resize_bilinear_test ├── CMakeLists.txt └── resize_bilinear_test.cpp ├── kernels_resize_nearest_neighbor_test ├── CMakeLists.txt └── resize_nearest_neighbor_test.cpp ├── kernels_round_test ├── CMakeLists.txt └── round_test.cpp ├── kernels_select_test ├── CMakeLists.txt └── select_test.cpp ├── kernels_shape_test ├── CMakeLists.txt └── shape_test.cpp ├── kernels_slice_test ├── CMakeLists.txt └── slice_test.cpp ├── kernels_softmax_test ├── CMakeLists.txt └── softmax_test.cpp ├── kernels_space_to_batch_nd_test ├── CMakeLists.txt └── space_to_batch_nd_test.cpp ├── kernels_space_to_depth_test ├── CMakeLists.txt └── space_to_depth_test.cpp ├── kernels_split_test ├── CMakeLists.txt └── split_test.cpp ├── kernels_split_v_test ├── CMakeLists.txt └── split_v_test.cpp ├── kernels_squared_difference_test ├── CMakeLists.txt └── squared_difference_test.cpp ├── kernels_squeeze_test ├── CMakeLists.txt └── squeeze_test.cpp ├── kernels_strided_slice_test ├── CMakeLists.txt └── strided_slice_test.cpp ├── kernels_sub_test ├── CMakeLists.txt └── sub_test.cpp ├── kernels_svdf_test ├── CMakeLists.txt └── svdf_test.cpp ├── kernels_tanh_test ├── CMakeLists.txt └── tanh_test.cpp ├── kernels_transpose_conv_test ├── CMakeLists.txt └── transpose_conv_test.cpp ├── kernels_transpose_test ├── CMakeLists.txt └── transpose_test.cpp ├── kernels_unidirectional_sequence_lstm_test ├── CMakeLists.txt ├── tensorflow │ └── lite │ │ └── micro │ │ └── kernels │ │ └── testdata │ │ ├── lstm_test_data.cpp │ │ └── lstm_test_data.h └── unidirectional_sequence_lstm_test.cpp ├── kernels_unpack_test ├── CMakeLists.txt └── unpack_test.cpp ├── kernels_while_test ├── CMakeLists.txt └── while_test.cpp ├── kernels_zeros_like_test ├── CMakeLists.txt └── zeros_like_test.cpp ├── memory_arena_threshold_test ├── CMakeLists.txt ├── memory_arena_threshold_test.cpp └── tensorflow │ └── lite │ └── micro │ ├── models │ ├── keyword_scrambled_model_data.cpp │ └── keyword_scrambled_model_data.h │ └── testing │ ├── test_conv_model.cpp │ └── test_conv_model.h ├── memory_helpers_test ├── CMakeLists.txt └── memory_helpers_test.cpp ├── memory_planner_greedy_memory_planner_test ├── CMakeLists.txt └── greedy_memory_planner_test.cpp ├── memory_planner_linear_memory_planner_test ├── CMakeLists.txt └── linear_memory_planner_test.cpp ├── memory_planner_non_persistent_buffer_planner_shim_test ├── CMakeLists.txt └── non_persistent_buffer_planner_shim_test.cpp ├── micro_allocation_info_test ├── CMakeLists.txt └── micro_allocation_info_test.cpp ├── micro_allocator_test ├── CMakeLists.txt ├── micro_allocator_test.cpp └── tensorflow │ └── lite │ └── micro │ └── testing │ ├── test_conv_model.cpp │ └── test_conv_model.h ├── micro_interpreter_context_test ├── CMakeLists.txt └── micro_interpreter_context_test.cpp ├── micro_log_test ├── CMakeLists.txt └── micro_log_test.cpp ├── micro_mutable_op_resolver_test ├── CMakeLists.txt └── micro_mutable_op_resolver_test.cpp ├── micro_resource_variable_test ├── CMakeLists.txt └── micro_resource_variable_test.cpp ├── micro_time_test ├── CMakeLists.txt └── micro_time_test.cpp ├── micro_utils_test ├── CMakeLists.txt └── micro_utils_test.cpp ├── recording_micro_allocator_test ├── CMakeLists.txt ├── recording_micro_allocator_test.cpp └── tensorflow │ └── lite │ └── micro │ └── testing │ ├── test_conv_model.cpp │ └── test_conv_model.h ├── span_test ├── CMakeLists.txt └── span_test.cpp ├── static_vector_test ├── CMakeLists.txt └── static_vector_test.cpp ├── testing_helpers_test ├── CMakeLists.txt └── testing_helpers_test.cpp └── testing_util_test ├── CMakeLists.txt └── util_test.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | /.vscode 2 | /build 3 | -------------------------------------------------------------------------------- /examples/hello_world/constants.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "constants.h" 17 | 18 | // This is a small number so that it's easy to read the logs 19 | const int kInferencesPerCycle = 20; 20 | -------------------------------------------------------------------------------- /examples/hello_world/hello_world_float_model_data.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern const unsigned int g_hello_world_float_model_data_size; 4 | extern const unsigned char g_hello_world_float_model_data[]; 5 | -------------------------------------------------------------------------------- /examples/hello_world/hello_world_int8_model_data.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern const unsigned int g_hello_world_int8_model_data_size; 4 | extern const unsigned char g_hello_world_int8_model_data[]; 5 | -------------------------------------------------------------------------------- /examples/hello_world/main.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "main_functions.h" 17 | 18 | // This is the default main used on systems that have the standard C entry 19 | // point. Other devices (for example FreeRTOS or ESP32) that have different 20 | // requirements for entry code (like an app_main function) should specialize 21 | // this main.cc file in a target-specific subfolder. 22 | int main(int argc, char* argv[]) { 23 | setup(); 24 | while (true) { 25 | loop(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/hello_world/output_handler.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_OUTPUT_HANDLER_H_ 17 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_OUTPUT_HANDLER_H_ 18 | 19 | #include "tensorflow/lite/c/common.h" 20 | #include "tensorflow/lite/micro/micro_log.h" 21 | 22 | // Called by the main loop to produce some output based on the x and y values 23 | void HandleOutput(float x_value, float y_value); 24 | 25 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_OUTPUT_HANDLER_H_ 26 | -------------------------------------------------------------------------------- /examples/hello_world/output_handler_test.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "output_handler.h" 17 | 18 | #include "tensorflow/lite/micro/testing/micro_test.h" 19 | 20 | TF_LITE_MICRO_TESTS_BEGIN 21 | 22 | TF_LITE_MICRO_TEST(TestCallability) { 23 | // This will have external side-effects (like printing to the debug console 24 | // or lighting an LED) that are hard to observe, so the most we can do is 25 | // make sure the call doesn't crash. 26 | HandleOutput(0, 0); 27 | } 28 | 29 | TF_LITE_MICRO_TESTS_END 30 | -------------------------------------------------------------------------------- /examples/person_detection/detection_responder.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "detection_responder.h" 17 | 18 | // This dummy implementation writes person and no person scores to the error 19 | // console. Real applications will want to take some custom action instead, and 20 | // should implement their own versions of this function. 21 | void RespondToDetection(tflite::ErrorReporter* error_reporter, 22 | int8_t person_score, int8_t no_person_score) { 23 | TF_LITE_REPORT_ERROR(error_reporter, "person score:%d no person score %d", 24 | person_score, no_person_score); 25 | } 26 | -------------------------------------------------------------------------------- /examples/person_detection/detection_responder_test.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "detection_responder.h" 17 | 18 | #include "tensorflow/lite/micro/testing/micro_test.h" 19 | 20 | TF_LITE_MICRO_TESTS_BEGIN 21 | 22 | TF_LITE_MICRO_TEST(TestCallability) { 23 | tflite::MicroErrorReporter micro_error_reporter; 24 | 25 | // This will have external side-effects (like printing to the debug console 26 | // or lighting an LED) that are hard to observe, so the most we can do is 27 | // make sure the call doesn't crash. 28 | RespondToDetection(µ_error_reporter, -100, 100); 29 | RespondToDetection(µ_error_reporter, 100, 50); 30 | } 31 | 32 | TF_LITE_MICRO_TESTS_END 33 | -------------------------------------------------------------------------------- /examples/person_detection/image_provider.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "image_provider.h" 17 | 18 | #include "model_settings.h" 19 | 20 | TfLiteStatus GetImage(tflite::ErrorReporter* error_reporter, int image_width, 21 | int image_height, int channels, int8_t* image_data) { 22 | for (int i = 0; i < image_width * image_height * channels; ++i) { 23 | image_data[i] = 0; 24 | } 25 | return kTfLiteOk; 26 | } 27 | -------------------------------------------------------------------------------- /examples/person_detection/main.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "main_functions.h" 17 | 18 | // This is the default main used on systems that have the standard C entry 19 | // point. Other devices (for example FreeRTOS or ESP32) that have different 20 | // requirements for entry code (like an app_main function) should specialize 21 | // this main.cc file in a target-specific subfolder. 22 | int main(int argc, char* argv[]) { 23 | setup(); 24 | while (true) { 25 | loop(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/person_detection/model_settings.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "model_settings.h" 17 | 18 | const char* kCategoryLabels[kCategoryCount] = { 19 | "notperson", 20 | "person", 21 | }; 22 | -------------------------------------------------------------------------------- /examples/person_detection/person_detect_model_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // This is a standard TensorFlow Lite model file that has been converted into a 17 | // C data array, so it can be easily compiled into a binary for devices that 18 | // don't have a file system. It was created using the command: 19 | // xxd -i person_detect.tflite > person_detect_model_data.cc 20 | 21 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 22 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 23 | 24 | extern const unsigned char g_person_detect_model_data[]; 25 | extern const int g_person_detect_model_data_len; 26 | 27 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 28 | -------------------------------------------------------------------------------- /examples/person_detection/person_image_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // This data was created from a sample image from with a person in it. 17 | // Convert original image to simpler format: 18 | // convert -resize 96x96\! person.PNG person.bmp3 19 | // Skip the 54 byte bmp3 header and add the reset of the bytes to a C array: 20 | // xxd -s 54 -i /tmp/person.bmp3 > /tmp/person.cc 21 | 22 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_IMAGE_DATA_H_ 23 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_IMAGE_DATA_H_ 24 | 25 | #include 26 | 27 | extern const unsigned int g_person_image_data_size; 28 | extern const uint8_t g_person_image_data[]; 29 | 30 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_IMAGE_DATA_H_ 31 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/delay_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_DELAY_FLEXBUFFERS_GENERATED_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_DELAY_FLEXBUFFERS_GENERATED_DATA_H_ 18 | 19 | extern const int g_gen_data_size_3_delay; 20 | extern const unsigned char g_gen_data_3_delay[]; 21 | 22 | extern const int g_gen_data_size_5_delay; 23 | extern const unsigned char g_gen_data_5_delay[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_DELAY_FLEXBUFFERS_GENERATED_DATA_H_ 26 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/energy_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_ENERGY_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_ENERGY_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_start_index_2_end_index_4; 20 | extern const unsigned char g_gen_data_start_index_2_end_index_4[]; 21 | 22 | extern const int g_gen_data_size_start_index_0_end_index_4; 23 | extern const unsigned char g_gen_data_start_index_0_end_index_4[]; 24 | 25 | extern const int g_gen_data_size_start_index_4_end_index_8; 26 | extern const unsigned char g_gen_data_start_index_4_end_index_8[]; 27 | 28 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_ENERGY_FLEXBUFFERS_DATA_H_ 29 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/fft_auto_scale_kernel.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_FFT_AUTO_SCALE_KERNEL_H_ 16 | #define SIGNAL_MICRO_KERNELS_FFT_AUTO_SCALE_KERNEL_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TfLiteStatus FftAutoScalePrepare(TfLiteContext* context, TfLiteNode* node); 23 | 24 | } // namespace tflite 25 | 26 | #endif // SIGNAL_MICRO_KERNELS_FFT_AUTO_SCALE_KERNEL_H_ 27 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/filter_bank_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FILTER_BANK_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FILTER_BANK_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_filter_bank_32_channel; 20 | extern const unsigned char g_gen_data_filter_bank_32_channel[]; 21 | 22 | extern const int g_gen_data_size_filter_bank_16_channel; 23 | extern const unsigned char g_gen_data_filter_bank_16_channel[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FILTER_BANK_FLEXBUFFERS_DATA_H_ 26 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/filter_bank_log_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FILTER_BANK_LOG_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FILTER_BANK_LOG_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_filter_bank_log_scale_1600_correction_bits_3; 20 | extern const unsigned char 21 | g_gen_data_filter_bank_log_scale_1600_correction_bits_3[]; 22 | 23 | extern const int g_gen_data_size_filter_bank_log_scale_32768_correction_bits_5; 24 | extern const unsigned char 25 | g_gen_data_filter_bank_log_scale_32768_correction_bits_5[]; 26 | 27 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FILTER_BANK_LOG_FLEXBUFFERS_DATA_H_ 28 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/filter_bank_square_root.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_FILTER_BANK_SQUARE_ROOT_H_ 16 | #define SIGNAL_MICRO_KERNELS_FILTER_BANK_SQUARE_ROOT_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TfLiteStatus FilterBankSquareRootPrepare(TfLiteContext* context, 23 | TfLiteNode* node); 24 | 25 | } // namespace tflite 26 | 27 | #endif // SIGNAL_MICRO_KERNELS_FILTER_BANK_SQUARE_ROOT_H_ 28 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/framer_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FRAMER_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FRAMER_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_3_1_0_framer; 20 | extern const unsigned char g_gen_data_3_1_0_framer[]; 21 | 22 | extern const int g_gen_data_size_5_2_1_framer; 23 | extern const unsigned char g_gen_data_5_2_1_framer[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FRAMER_FLEXBUFFERS_DATA_H_ 26 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/irfft.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_IRFFT_H_ 16 | #define SIGNAL_MICRO_KERNELS_IRFFT_H_ 17 | 18 | #include "tensorflow/lite/micro/micro_common.h" 19 | 20 | namespace tflite { 21 | namespace tflm_signal { 22 | 23 | TFLMRegistration* Register_IRFFT(); 24 | TFLMRegistration* Register_IRFFT_FLOAT(); 25 | TFLMRegistration* Register_IRFFT_INT16(); 26 | TFLMRegistration* Register_IRFFT_INT32(); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | 31 | #endif // SIGNAL_MICRO_KERNELS_IRFFT_H_ 32 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/overlap_add_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_OVERLAP_ADD_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_OVERLAP_ADD_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_overlap_add_float; 20 | extern const unsigned char g_gen_data_overlap_add_float[]; 21 | 22 | extern const int g_gen_data_size_overlap_add_int16; 23 | extern const unsigned char g_gen_data_overlap_add_int16[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_OVERLAP_ADD_FLEXBUFFERS_DATA_H_ 26 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/pcan_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | #ifndef SIGNAL_MICRO_KERNELS_PCAN_FLEXBUFFERS_GENERATED_DATA_H_ 2 | #define SIGNAL_MICRO_KERNELS_PCAN_FLEXBUFFERS_GENERATED_DATA_H_ 3 | 4 | extern const int g_gen_data_size_snr_shift_6_test; 5 | extern const unsigned char g_gen_data_snr_shift_6_test[]; 6 | 7 | #endif // SIGNAL_MICRO_KERNELS_PCAN_FLEXBUFFERS_GENERATED_DATA_H_ 8 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/rfft.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_RFFT_H_ 16 | #define SIGNAL_MICRO_KERNELS_RFFT_H_ 17 | 18 | #include "tensorflow/lite/micro/micro_common.h" 19 | 20 | namespace tflite { 21 | namespace tflm_signal { 22 | 23 | TFLMRegistration* Register_RFFT(); 24 | TFLMRegistration* Register_RFFT_FLOAT(); 25 | TFLMRegistration* Register_RFFT_INT16(); 26 | TFLMRegistration* Register_RFFT_INT32(); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | 31 | #endif // SIGNAL_MICRO_KERNELS_RFFT_H_ 32 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/stacker_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_STACKER_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_STACKER_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_stacker_3_channels_step_1; 20 | extern const unsigned char g_gen_data_stacker_3_channels_step_1[]; 21 | 22 | extern const int g_gen_data_size_stacker_10_channels_step_2; 23 | extern const unsigned char g_gen_data_stacker_10_channels_step_2[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_STACKER_FLEXBUFFERS_DATA_H_ 26 | -------------------------------------------------------------------------------- /src/signal/micro/kernels/window_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_WINDOW_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_WINDOW_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_window_shift_12; 20 | extern const unsigned char g_gen_data_window_shift_12[]; 21 | 22 | extern const int g_gen_data_size_window_shift_8; 23 | extern const unsigned char g_gen_data_window_shift_8[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_WINDOW_FLEXBUFFERS_DATA_H_ 26 | -------------------------------------------------------------------------------- /src/signal/src/complex.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_COMPLEX_H_ 17 | #define SIGNAL_SRC_COMPLEX_H_ 18 | 19 | #include 20 | 21 | // We would use the standard complex type in complex.h, but there's 22 | // no guarantee that all architectures will support it. 23 | template 24 | struct Complex { 25 | T real; 26 | T imag; 27 | }; 28 | 29 | #endif // SIGNAL_SRC_COMPLEX_H_ 30 | -------------------------------------------------------------------------------- /src/signal/src/energy.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #include "signal/src/energy.h" 16 | 17 | #include "signal/src/complex.h" 18 | 19 | namespace tflite { 20 | namespace tflm_signal { 21 | void SpectrumToEnergy(const Complex* input, int start_index, 22 | int end_index, uint32_t* output) { 23 | for (int i = start_index; i < end_index; i++) { 24 | const int16_t real = input[i].real; // 15 bits 25 | const int16_t imag = input[i].imag; // 15 bits 26 | // 31 bits 27 | output[i] = (static_cast(real) * real) + 28 | (static_cast(imag) * imag); 29 | } 30 | } 31 | 32 | } // namespace tflm_signal 33 | } // namespace tflite 34 | -------------------------------------------------------------------------------- /src/signal/src/fft_auto_scale.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_FFT_AUTO_SCALE_H_ 17 | #define SIGNAL_SRC_FFT_AUTO_SCALE_H_ 18 | 19 | #include 20 | #include 21 | 22 | // TODO(b/286250473): remove namespace once de-duped libraries 23 | namespace tflite { 24 | namespace tflm_signal { 25 | 26 | // Auto scales `input` and write the result to `output` 27 | // Elements in `input` are left shifted to maximize the amplitude without 28 | // clipping, 29 | // * both `input` and `output` must be of size `size` 30 | int FftAutoScale(const int16_t* input, int size, int16_t* output); 31 | 32 | } // namespace tflm_signal 33 | } // namespace tflite 34 | 35 | #endif // SIGNAL_SRC_FFT_AUTO_SCALE_H_ 36 | -------------------------------------------------------------------------------- /src/signal/src/filter_bank_square_root.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/filter_bank_square_root.h" 17 | 18 | #include "signal/src/square_root.h" 19 | 20 | namespace tflite { 21 | namespace tflm_signal { 22 | 23 | void FilterbankSqrt(const uint64_t* input, int num_channels, 24 | int scale_down_bits, uint32_t* output) { 25 | for (int i = 0; i < num_channels; ++i) { 26 | output[i] = Sqrt64(input[i]) >> scale_down_bits; 27 | } 28 | } 29 | 30 | } // namespace tflm_signal 31 | } // namespace tflite 32 | -------------------------------------------------------------------------------- /src/signal/src/filter_bank_square_root.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_FILTER_BANK_SQUARE_ROOT_H_ 17 | #define SIGNAL_SRC_FILTER_BANK_SQUARE_ROOT_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Apply square root to each element in `input`, then shift right by 26 | // `scale_down_bits` before writing the result to `output`, 27 | // `input` and `output` must both be of size `num_channels` 28 | void FilterbankSqrt(const uint64_t* input, int num_channels, 29 | int scale_down_bits, uint32_t* output); 30 | 31 | } // namespace tflm_signal 32 | } // namespace tflite 33 | 34 | #endif // SIGNAL_SRC_FILTER_BANK_SQUARE_ROOT_H_ 35 | -------------------------------------------------------------------------------- /src/signal/src/kiss_fft_wrappers/kiss_fft_float.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 17 | 18 | #undef FIXED_POINT 19 | namespace kiss_fft_float { 20 | #include "kiss_fft.c" 21 | #include "tools/kiss_fftr.c" 22 | } // namespace kiss_fft_float 23 | -------------------------------------------------------------------------------- /src/signal/src/kiss_fft_wrappers/kiss_fft_float.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_FLOAT_H_ 17 | #define SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_FLOAT_H_ 18 | 19 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 20 | 21 | // Wrap floating point kiss fft in its own namespace. Enables us to link an 22 | // application with different kiss fft resolutions 23 | // (16/32 bit integer, float, double) without getting a linker error. 24 | #undef FIXED_POINT 25 | namespace kiss_fft_float { 26 | #include "third_party/kissfft/kiss_fft.h" 27 | #include "third_party/kissfft/tools/kiss_fftr.h" 28 | } // namespace kiss_fft_float 29 | #undef FIXED_POINT 30 | 31 | #endif // SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_FLOAT_H_ 32 | -------------------------------------------------------------------------------- /src/signal/src/kiss_fft_wrappers/kiss_fft_int16.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 17 | 18 | #define FIXED_POINT 16 19 | namespace kiss_fft_fixed16 { 20 | #include "kiss_fft.c" 21 | #include "tools/kiss_fftr.c" 22 | } // namespace kiss_fft_fixed16 23 | #undef FIXED_POINT 24 | -------------------------------------------------------------------------------- /src/signal/src/kiss_fft_wrappers/kiss_fft_int16.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_INT16_H_ 17 | #define SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_INT16_H_ 18 | 19 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 20 | // Wrap floating point kiss fft in its own namespace. Enables us to link an 21 | // application with different kiss fft resolutions 22 | // (16/32 bit integer, float, double) without getting a linker error. 23 | #define FIXED_POINT 16 24 | namespace kiss_fft_fixed16 { 25 | #include "third_party/kissfft/kiss_fft.h" 26 | #include "third_party/kissfft/tools/kiss_fftr.h" 27 | } // namespace kiss_fft_fixed16 28 | #undef FIXED_POINT 29 | 30 | #endif // SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_INT16_H_ 31 | -------------------------------------------------------------------------------- /src/signal/src/kiss_fft_wrappers/kiss_fft_int32.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 17 | 18 | #define FIXED_POINT 32 19 | namespace kiss_fft_fixed32 { 20 | #include "kiss_fft.c" 21 | #include "tools/kiss_fftr.c" 22 | } // namespace kiss_fft_fixed32 23 | #undef FIXED_POINT 24 | -------------------------------------------------------------------------------- /src/signal/src/kiss_fft_wrappers/kiss_fft_int32.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_INT32_H_ 17 | #define SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_INT32_H_ 18 | 19 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 20 | 21 | // Wrap floating point kiss fft in its own namespace. Enables us to link an 22 | // application with different kiss fft resolutions 23 | // (16/32 bit integer, float, double) without getting a linker error. 24 | #define FIXED_POINT 32 25 | namespace kiss_fft_fixed32 { 26 | #include "third_party/kissfft/kiss_fft.h" 27 | #include "third_party/kissfft/tools/kiss_fftr.h" 28 | } // namespace kiss_fft_fixed32 29 | #undef FIXED_POINT 30 | 31 | #endif // SIGNAL_SRC_KISS_FFT_WRAPPERS_KISS_FFT_INT32_H_ 32 | -------------------------------------------------------------------------------- /src/signal/src/log.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_LOG_H_ 17 | #define SIGNAL_SRC_LOG_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Natural logarithm of an integer. The result is multiplied by out_scale 26 | uint32_t Log32(uint32_t x, uint32_t out_scale); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | #endif // SIGNAL_SRC_LOG_H_ 31 | -------------------------------------------------------------------------------- /src/signal/src/max_abs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_MAX_ABS_H_ 17 | #define SIGNAL_SRC_MAX_ABS_H_ 18 | 19 | #include 20 | 21 | // TODO(b/286250473): remove namespace once de-duped libraries 22 | namespace tflite { 23 | namespace tflm_signal { 24 | 25 | // Returns the maximum absolute value of the `size` elements in `input` 26 | int16_t MaxAbs16(const int16_t* input, int size); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | 31 | #endif // SIGNAL_SRC_MAX_ABS_H_ 32 | -------------------------------------------------------------------------------- /src/signal/src/msb.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_MSB_H_ 17 | #define SIGNAL_SRC_MSB_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Index of the most significant bit 26 | uint32_t MostSignificantBit32(uint32_t x); 27 | uint32_t MostSignificantBit64(uint64_t x); 28 | 29 | } // namespace tflm_signal 30 | } // namespace tflite 31 | 32 | #endif // SIGNAL_SRC_MSB_H_ 33 | -------------------------------------------------------------------------------- /src/signal/src/square_root.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_SQUARE_ROOT_H_ 17 | #define SIGNAL_SRC_SQUARE_ROOT_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Square root 26 | uint16_t Sqrt32(uint32_t num); 27 | uint32_t Sqrt64(uint64_t num); 28 | 29 | } // namespace tflm_signal 30 | } // namespace tflite 31 | 32 | #endif // SIGNAL_SRC_SQUARE_ROOT_H_ 33 | -------------------------------------------------------------------------------- /src/signal/src/window.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/window.h" 17 | 18 | #include 19 | 20 | // TODO(b/286250473): remove namespace once de-duped libraries 21 | namespace tflm_signal { 22 | 23 | void ApplyWindow(const int16_t* input, const int16_t* window, int size, 24 | int shift, int16_t* output) { 25 | for (int i = 0; i < size; ++i) { 26 | int32_t raw = (static_cast(input[i]) * window[i]) >> shift; 27 | if (raw < INT16_MIN) { 28 | output[i] = INT16_MIN; 29 | } else if (raw > INT16_MAX) { 30 | output[i] = INT16_MAX; 31 | } else { 32 | output[i] = static_cast(raw); 33 | } 34 | } 35 | } 36 | } // namespace tflm_signal 37 | -------------------------------------------------------------------------------- /src/signal/src/window.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_WINDOW_H_ 17 | #define SIGNAL_SRC_WINDOW_H_ 18 | 19 | #include 20 | 21 | namespace tflm_signal { 22 | 23 | // Applies a window function to an input signal 24 | // 25 | // * `input` and `window` must be both of size `size` elements and are 26 | // multiplied element-by element. 27 | // * `shift` is a right shift to apply before writing the result to `output`. 28 | void ApplyWindow(const int16_t* input, const int16_t* window, int size, 29 | int shift, int16_t* output); 30 | } // namespace tflm_signal 31 | #endif // SIGNAL_SRC_WINDOW_H_ 32 | -------------------------------------------------------------------------------- /src/tensorflow/compiler/mlir/lite/kernels/internal/compatibility_macros.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ 17 | #define TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ 18 | 19 | #include "tensorflow/lite/kernels/internal/compatibility.h" 20 | 21 | #endif // TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ 22 | -------------------------------------------------------------------------------- /src/tensorflow/compiler/mlir/lite/schema/schema_generated.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_GENERATED_H_ 16 | #define TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_GENERATED_H_ 17 | 18 | // This file should only be used by the make build to redirect schema_utils.cc 19 | // usage of the generated schema to the proper location. 20 | #include "tensorflow/lite/schema/schema_generated.h" 21 | 22 | #endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 23 | -------------------------------------------------------------------------------- /src/tensorflow/lite/builtin_op_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // Compatibility shim for new location of interface definitions. 16 | 17 | #ifndef TENSORFLOW_LITE_BUILTIN_OP_DATA_H_ 18 | #define TENSORFLOW_LITE_BUILTIN_OP_DATA_H_ 19 | 20 | #include "tensorflow/lite/core/c/builtin_op_data.h" 21 | 22 | #endif // TENSORFLOW_LITE_BUILTIN_OP_DATA_H_ 23 | -------------------------------------------------------------------------------- /src/tensorflow/lite/c/builtin_op_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_ 16 | #define TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_ 17 | 18 | /// For documentation, see 19 | /// third_party/tensorflow/lite/core/c/builtin_op_data.h 20 | 21 | #include "tensorflow/lite/core/c/builtin_op_data.h" 22 | 23 | #endif // TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_ 24 | -------------------------------------------------------------------------------- /src/tensorflow/lite/c/c_api_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_C_C_API_TYPES_H_ 16 | #define TENSORFLOW_LITE_C_C_API_TYPES_H_ 17 | 18 | /// \file 19 | /// 20 | /// C API types for TensorFlow Lite. 21 | /// 22 | /// For documentation, see tensorflow/lite/core/c/c_api_types.h 23 | 24 | #include "tensorflow/lite/core/c/c_api_types.h" 25 | 26 | #endif // TENSORFLOW_LITE_C_C_API_TYPES_H_ 27 | -------------------------------------------------------------------------------- /src/tensorflow/lite/c/common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | /// \file 17 | /// 18 | /// This file defines common C types and APIs for implementing operations, 19 | /// delegates and other constructs in TensorFlow Lite. The actual operations and 20 | /// delegates can be defined using C++, but the interface between the 21 | /// interpreter and the operations are C. 22 | /// 23 | /// For documentation, see tensorflow/lite/core/c/common.h. 24 | /// 25 | /// See also c_api_opaque.h which has more ABI-stable variants of some of these 26 | /// APIs. 27 | 28 | #ifndef TENSORFLOW_LITE_C_COMMON_H_ 29 | #define TENSORFLOW_LITE_C_COMMON_H_ 30 | 31 | #include "tensorflow/lite/core/c/common.h" 32 | 33 | #endif // TENSORFLOW_LITE_C_COMMON_H_ 34 | -------------------------------------------------------------------------------- /src/tensorflow/lite/core/api/error_reporter.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_ 16 | #define TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_ 17 | 18 | #include "tensorflow/compiler/mlir/lite/core/api/error_reporter.h" 19 | 20 | #endif // TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_ 21 | -------------------------------------------------------------------------------- /src/tensorflow/lite/core/api/tensor_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 17 | #define TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 18 | 19 | #include "tensorflow/lite/core/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | // Resets a variable tensor to the default value. 24 | TfLiteStatus ResetVariableTensor(TfLiteTensor* tensor); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 29 | -------------------------------------------------------------------------------- /src/tensorflow/lite/core/c/builtin_op_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | /// WARNING: Users of TensorFlow Lite should not include this file directly, 16 | /// but should instead include 17 | /// "third_party/tensorflow/lite/c/builtin_op_data.h". 18 | /// Only the TensorFlow Lite implementation itself should include this 19 | /// file directly. 20 | #ifndef TENSORFLOW_LITE_CORE_C_BUILTIN_OP_DATA_H_ 21 | #define TENSORFLOW_LITE_CORE_C_BUILTIN_OP_DATA_H_ 22 | 23 | #include "tensorflow/compiler/mlir/lite/core/c/builtin_op_data.h" 24 | #include "tensorflow/lite/core/c/common.h" 25 | 26 | #endif // TENSORFLOW_LITE_CORE_C_BUILTIN_OP_DATA_H_ 27 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/max.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_MAX) || defined(__ZEPHYR__) 23 | inline float TfLiteMax(const float& x, const float& y) { 24 | return std::max(x, y); 25 | } 26 | #else 27 | template 28 | inline T TfLiteMax(const T& x, const T& y) { 29 | return std::fmax(x, y); 30 | } 31 | #endif 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 36 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/min.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_MIN) || defined(__ZEPHYR__) 23 | inline float TfLiteMin(const float& x, const float& y) { 24 | return std::min(x, y); 25 | } 26 | #else 27 | template 28 | inline T TfLiteMin(const T& x, const T& y) { 29 | return std::fmin(x, y); 30 | } 31 | #endif 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 36 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/optimized/neon_check.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 17 | 18 | // TFLM does not need to utilize any Neon optimizations. 19 | 20 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 21 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/reference/floor_div.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_DIV_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_DIV_H_ 17 | 18 | #include 19 | #include 20 | 21 | #include "tensorflow/lite/kernels/internal/types.h" 22 | 23 | namespace tflite { 24 | namespace reference_ops { 25 | 26 | template 27 | T FloorDiv(T input1, T input2) { 28 | return std::floor(std::divides()(static_cast(input1), 29 | static_cast(input2))); 30 | } 31 | 32 | } // namespace reference_ops 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_DIV_H_ 36 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_MEAN_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_MEAN_H_ 17 | 18 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_MEAN_H_ 19 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/runtime_shape.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/kernels/internal/runtime_shape.h" 17 | 18 | namespace tflite { 19 | 20 | // Defining a constexpr static class member is necessary in C++11 21 | constexpr int tflite::RuntimeShape::kMaxSmallSize; 22 | 23 | } // namespace tflite 24 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/tensor_ctypes.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | RuntimeShape GetTensorShape(const TfLiteTensor* tensor) { 23 | if (tensor == nullptr) { 24 | return RuntimeShape(); 25 | } 26 | 27 | TfLiteIntArray* dims = tensor->dims; 28 | const int dims_size = dims->size; 29 | const int32_t* dims_data = reinterpret_cast(dims->data); 30 | return RuntimeShape(dims_size, dims_data); 31 | } 32 | 33 | RuntimeShape GetTensorShape(std::vector data) { 34 | return RuntimeShape(data.size(), data.data()); 35 | } 36 | 37 | } // namespace tflite 38 | -------------------------------------------------------------------------------- /src/tensorflow/lite/kernels/internal/tensor_utils.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ============================================================================== 15 | */ 16 | 17 | // internal/reference/portable_tensor_utils.h has the implementation of the 18 | // functions declared in internal/portable_tensor_utils.h. This somewhat 19 | // confusing setup is derived from how the code is organized in TfLite where it 20 | // is used to select between NEON, SSE and portable implementaitons. See 21 | // https://github.com/tensorflow/tensorflow/blob/d76c23975c4a3a0d7987cfe3f45c76566df06180/tensorflow/lite/kernels/internal/tensor_utils.cc 22 | // for how the code is written in TfLite. 23 | 24 | #include "tensorflow/lite/kernels/internal/portable_tensor_utils.h" 25 | #include "tensorflow/lite/kernels/internal/reference/portable_tensor_utils.h" 26 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/debug_log.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // This file is empty to ensure that a specialized implementation of 16 | // debug_log.h is used (instead of the default implementation from 17 | // tensorflow/lite/micro/debug_log.cc). 18 | // 19 | // The actual target-specific implementation of debug_log.h is in 20 | // system_setup.cc since that allows us to consolidate all the target-specific 21 | // specializations into one source file. 22 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/hexdump.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The TensorFlow Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef TENSORFLOW_LITE_MICRO_HEXDUMP_H_ 16 | #define TENSORFLOW_LITE_MICRO_HEXDUMP_H_ 17 | 18 | #include 19 | 20 | #include "tensorflow/lite/micro/span.h" 21 | 22 | namespace tflite { 23 | 24 | // Displays the contents of a memory region, formatted in hexadecimal and ASCII 25 | // in a style matching Python's hexdump module, using DebugLog(). 26 | void hexdump(Span region); 27 | 28 | // Writes the contents of a memory region, formatted in hexadecimal and ASCII 29 | // in a style matching Python's hexdump module, to a buffer. Returns the portion 30 | // of the buffer written. 31 | Span hexdump(Span region, Span buffer); 32 | 33 | } // end namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_MICRO_HEXDUMP_H_ 36 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_circular_buffer_config; 20 | extern const unsigned char g_gen_data_circular_buffer_config[]; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/detection_postprocess_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_none_regular_nms; 20 | extern const unsigned char g_gen_data_none_regular_nms[]; 21 | 22 | extern const int g_gen_data_size_regular_nms; 23 | extern const unsigned char g_gen_data_regular_nms[]; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/ethosu.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // 17 | // This is a stub file for non-Ethos platforms 18 | // 19 | #include "tensorflow/lite/micro/micro_common.h" 20 | 21 | namespace tflite { 22 | 23 | TFLMRegistration* Register_ETHOSU() { return nullptr; } 24 | 25 | const char* GetString_ETHOSU() { return ""; } 26 | 27 | } // namespace tflite 28 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/ethosu.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TFLMRegistration* Register_ETHOSU(); 23 | 24 | const char* GetString_ETHOSU(); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 29 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/hard_swish.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_HARD_SWISH_H_ 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_HARD_SWISH_H_ 18 | 19 | #include "tensorflow/lite/c/builtin_op_data.h" 20 | #include "tensorflow/lite/c/common.h" 21 | 22 | namespace tflite { 23 | 24 | extern const int kHardSwishInputTensor; 25 | extern const int kHardSwishOutputTensor; 26 | 27 | TfLiteStatus HardSwishPrepare(TfLiteContext* context, TfLiteNode* node); 28 | } // namespace tflite 29 | 30 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_HARD_SWISH_H_ 31 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/logical.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_LOGICAL_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_LOGICAL_H_ 17 | 18 | #include "tensorflow/lite/c/builtin_op_data.h" 19 | #include "tensorflow/lite/c/common.h" 20 | 21 | namespace tflite { 22 | // Input/output tensor index. 23 | extern const int kLogicalInputTensor1; 24 | extern const int kLogicalInputTensor2; 25 | extern const int kLogicalOutputTensor; 26 | 27 | TfLiteStatus LogicalImpl(TfLiteContext* context, TfLiteNode* node, 28 | bool (*func)(bool, bool)); 29 | 30 | bool LogicalOr(bool x, bool y); 31 | bool LogicalAnd(bool x, bool y); 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_LOGICAL_H_ 36 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/pad.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_PAD_H_ 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_PAD_H_ 18 | 19 | #include "tensorflow/lite/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | TfLiteStatus PadPrepare(TfLiteContext* context, TfLiteNode* node); 24 | 25 | } // namespace tflite 26 | 27 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_PAD_H_ 28 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/kernels/reshape.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/c/builtin_op_data.h" 17 | #include "tensorflow/lite/c/common.h" 18 | 19 | namespace tflite { 20 | 21 | constexpr int kReshapeInputTensor = 0; 22 | constexpr int kReshapeOutputTensor = 0; 23 | 24 | TfLiteStatus PrepareReshapeReference(TfLiteContext* context, TfLiteNode* node); 25 | 26 | } // namespace tflite 27 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/micro_arena_constants.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_MICRO_ARENA_CONSTANTS_H_ 17 | #define TENSORFLOW_LITE_MICRO_MICRO_ARENA_CONSTANTS_H_ 18 | 19 | namespace tflite { 20 | 21 | // The default buffer alignment requirement. 22 | // We align tensor buffers to 16-byte boundaries, since this is a common 23 | // requirement for SIMD extensions. 24 | constexpr int MicroArenaBufferAlignment() { return 16; } 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_MICRO_MICRO_ARENA_CONSTANTS_H_ 29 | -------------------------------------------------------------------------------- /src/tensorflow/lite/micro/micro_time.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | Unless required by applicable law or agreed to in writing, software 7 | distributed under the License is distributed on an "AS IS" BASIS, 8 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | See the License for the specific language governing permissions and 10 | limitations under the License. 11 | ==============================================================================*/ 12 | 13 | // Raspberry Pi Pico-specific implementation of timing functions. 14 | 15 | #include "tensorflow/lite/micro/micro_time.h" 16 | 17 | #include "tensorflow/lite/micro/debug_log.h" 18 | 19 | // These are headers from the RP2's SDK. 20 | #include "hardware/timer.h" // NOLINT 21 | 22 | namespace tflite { 23 | namespace { 24 | // Pico's time_us_32() returns microseconds. 25 | const uint32_t kClocksPerSecond = 1000000; 26 | } // namespace 27 | 28 | uint32_t ticks_per_second() { return kClocksPerSecond; } 29 | 30 | uint32_t GetCurrentTimeTicks() { 31 | return static_cast(time_us_32()); 32 | } 33 | 34 | } // namespace tflite -------------------------------------------------------------------------------- /src/tensorflow/lite/schema/schema_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 16 | #define TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 17 | 18 | #include "tensorflow/compiler/mlir/lite/schema/schema_utils.h" 19 | 20 | #endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 21 | -------------------------------------------------------------------------------- /src/third_party/flatbuffers/include/flatbuffers/flex_flat_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Google Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLATBUFFERS_FLEX_FLAT_UTIL_H_ 18 | #define FLATBUFFERS_FLEX_FLAT_UTIL_H_ 19 | 20 | #include "third_party/flatbuffers/include/flatbuffers/flatbuffers.h" 21 | #include "third_party/flatbuffers/include/flatbuffers/flexbuffers.h" 22 | 23 | namespace flexbuffers { 24 | 25 | // Verifies the `nested` flexbuffer within a flatbuffer vector is valid. 26 | inline bool VerifyNestedFlexBuffer( 27 | const flatbuffers::Vector *const nested, 28 | flatbuffers::Verifier &verifier) { 29 | if (!nested) return true; 30 | return verifier.Check(flexbuffers::VerifyBuffer( 31 | nested->data(), nested->size(), verifier.GetFlexReuseTracker())); 32 | } 33 | 34 | } // namespace flexbuffers 35 | 36 | #endif // FLATBUFFERS_FLEX_FLAT_UTIL_H_ 37 | -------------------------------------------------------------------------------- /src/third_party/kissfft/tools/kiss_fftr.h: -------------------------------------------------------------------------------- 1 | #ifndef KISS_FTR_H 2 | #define KISS_FTR_H 3 | 4 | #include "third_party/kissfft/kiss_fft.h" 5 | #ifdef __cplusplus 6 | extern "C++" { 7 | #endif 8 | 9 | 10 | /* 11 | 12 | Real optimized version can save about 45% cpu time vs. complex fft of a real seq. 13 | 14 | 15 | 16 | */ 17 | 18 | typedef struct kiss_fftr_state *kiss_fftr_cfg; 19 | 20 | 21 | kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem); 22 | /* 23 | nfft must be even 24 | 25 | If you don't care to allocate space, use mem = lenmem = NULL 26 | */ 27 | 28 | 29 | void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata); 30 | /* 31 | input timedata has nfft scalar points 32 | output freqdata has nfft/2+1 complex points 33 | */ 34 | 35 | void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata); 36 | /* 37 | input freqdata has nfft/2+1 complex points 38 | output timedata has nfft scalar points 39 | */ 40 | 41 | #define kiss_fftr_free free 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /sync/add_usb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import glob 4 | import os 5 | 6 | for folder in glob.glob("tests/*"): 7 | if not os.path.isdir(folder): 8 | continue 9 | name = os.path.basename(folder) 10 | 11 | cmake_path = os.path.join(folder, "CMakeLists.txt") 12 | with open(cmake_path, 'r') as cmake_file: 13 | cmake_lines = cmake_file.read().split("\n") 14 | 15 | has_already_been_updated = False 16 | new_lines = [] 17 | for cmake_line in cmake_lines: 18 | if cmake_line.startswith("target_sources"): 19 | new_lines.append("pico_enable_stdio_usb(" + name + " 1)") 20 | new_lines.append("pico_enable_stdio_uart(" + name + " 0)") 21 | new_lines.append("") 22 | if cmake_line.startswith("pico_enable_stdio"): 23 | has_already_been_updated = True 24 | break 25 | new_lines.append(cmake_line) 26 | 27 | if has_already_been_updated: 28 | continue 29 | 30 | with open(cmake_path, 'w') as cmake_file: 31 | cmake_file.write("\n".join(new_lines)) 32 | -------------------------------------------------------------------------------- /sync/micro_time.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | Unless required by applicable law or agreed to in writing, software 7 | distributed under the License is distributed on an "AS IS" BASIS, 8 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | See the License for the specific language governing permissions and 10 | limitations under the License. 11 | ==============================================================================*/ 12 | 13 | // Raspberry Pi Pico-specific implementation of timing functions. 14 | 15 | #include "tensorflow/lite/micro/micro_time.h" 16 | 17 | #include "tensorflow/lite/micro/debug_log.h" 18 | 19 | // These are headers from the RP2's SDK. 20 | #include "hardware/timer.h" // NOLINT 21 | 22 | namespace tflite { 23 | namespace { 24 | // Pico's time_us_32() returns microseconds. 25 | const uint32_t kClocksPerSecond = 1000000; 26 | } // namespace 27 | 28 | uint32_t ticks_per_second() { return kClocksPerSecond; } 29 | 30 | uint32_t GetCurrentTimeTicks() { 31 | return static_cast(time_us_32()); 32 | } 33 | 34 | } // namespace tflite -------------------------------------------------------------------------------- /sync/replace_string_with_file_contents.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | 5 | if len(sys.argv) < 4 or (len(sys.argv) % 2 != 0): 6 | print(f"Usage: {sys.argv[0]} [ ...]") 7 | sys.exit(1) 8 | 9 | replacement_contents_list = [] 10 | replacement_patterns_list = [] 11 | for i in range(2, len(sys.argv), 2): 12 | with open(sys.argv[i]) as f: 13 | replacement_contents_list.append(f.read()) 14 | replacement_patterns_list.append(sys.argv[i + 1]) 15 | 16 | with open(sys.argv[1], "rt") as fin: 17 | for line in fin: 18 | for i in range(len(replacement_contents_list)): 19 | replacement_contents = replacement_contents_list[i] 20 | replacement_pattern = replacement_patterns_list[i] 21 | line = line.replace(replacement_pattern, replacement_contents) 22 | sys.stdout.write(line) 23 | -------------------------------------------------------------------------------- /sync/test_CMakeLists_template.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project({{TEST_NAME}} C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable({{TEST_NAME}} "") 8 | 9 | target_include_directories({{TEST_NAME}} 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/{{TEST_NAME}} 12 | ) 13 | 14 | set_target_properties( 15 | {{TEST_NAME}} 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb({{TEST_NAME}} 1) 25 | pico_enable_stdio_uart({{TEST_NAME}} 0) 26 | 27 | target_sources({{TEST_NAME}} 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/{{TEST_NAME}}/{{CPP_BASE}} 30 | {{EXTRA_SOURCES}} 31 | ) 32 | 33 | target_link_libraries( 34 | {{TEST_NAME}} 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs({{TEST_NAME}}) 40 | -------------------------------------------------------------------------------- /tests/arena_allocator_persistent_arena_buffer_allocator_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(arena_allocator_persistent_arena_buffer_allocator_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(arena_allocator_persistent_arena_buffer_allocator_test "") 8 | 9 | target_include_directories(arena_allocator_persistent_arena_buffer_allocator_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/arena_allocator_persistent_arena_buffer_allocator_test 12 | ) 13 | 14 | set_target_properties( 15 | arena_allocator_persistent_arena_buffer_allocator_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(arena_allocator_persistent_arena_buffer_allocator_test 1) 25 | pico_enable_stdio_uart(arena_allocator_persistent_arena_buffer_allocator_test 0) 26 | 27 | target_sources(arena_allocator_persistent_arena_buffer_allocator_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/arena_allocator_persistent_arena_buffer_allocator_test/persistent_arena_buffer_allocator_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | arena_allocator_persistent_arena_buffer_allocator_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(arena_allocator_persistent_arena_buffer_allocator_test) 40 | -------------------------------------------------------------------------------- /tests/arena_allocator_single_arena_buffer_allocator_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(arena_allocator_single_arena_buffer_allocator_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(arena_allocator_single_arena_buffer_allocator_test "") 8 | 9 | target_include_directories(arena_allocator_single_arena_buffer_allocator_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/arena_allocator_single_arena_buffer_allocator_test 12 | ) 13 | 14 | set_target_properties( 15 | arena_allocator_single_arena_buffer_allocator_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(arena_allocator_single_arena_buffer_allocator_test 1) 25 | pico_enable_stdio_uart(arena_allocator_single_arena_buffer_allocator_test 0) 26 | 27 | target_sources(arena_allocator_single_arena_buffer_allocator_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/arena_allocator_single_arena_buffer_allocator_test/single_arena_buffer_allocator_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | arena_allocator_single_arena_buffer_allocator_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(arena_allocator_single_arena_buffer_allocator_test) 40 | -------------------------------------------------------------------------------- /tests/fake_micro_context_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(fake_micro_context_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(fake_micro_context_test "") 8 | 9 | target_include_directories(fake_micro_context_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/fake_micro_context_test 12 | ) 13 | 14 | set_target_properties( 15 | fake_micro_context_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(fake_micro_context_test 1) 25 | pico_enable_stdio_uart(fake_micro_context_test 0) 26 | 27 | target_sources(fake_micro_context_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/fake_micro_context_test/fake_micro_context_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | fake_micro_context_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(fake_micro_context_test) 40 | -------------------------------------------------------------------------------- /tests/flatbuffer_utils_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(flatbuffer_utils_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(flatbuffer_utils_test "") 8 | 9 | target_include_directories(flatbuffer_utils_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/flatbuffer_utils_test 12 | ) 13 | 14 | set_target_properties( 15 | flatbuffer_utils_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(flatbuffer_utils_test 1) 25 | pico_enable_stdio_uart(flatbuffer_utils_test 0) 26 | 27 | target_sources(flatbuffer_utils_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/flatbuffer_utils_test/flatbuffer_utils_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | flatbuffer_utils_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(flatbuffer_utils_test) 40 | -------------------------------------------------------------------------------- /tests/hexdump_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(hexdump_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(hexdump_test "") 8 | 9 | target_include_directories(hexdump_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/hexdump_test 12 | ) 13 | 14 | set_target_properties( 15 | hexdump_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(hexdump_test 1) 25 | pico_enable_stdio_uart(hexdump_test 0) 26 | 27 | target_sources(hexdump_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/hexdump_test/hexdump_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | hexdump_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(hexdump_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_activations_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_activations_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_activations_test "") 8 | 9 | target_include_directories(kernels_activations_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_activations_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_activations_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_activations_test 1) 25 | pico_enable_stdio_uart(kernels_activations_test 0) 26 | 27 | target_sources(kernels_activations_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_activations_test/activations_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_activations_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_activations_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_add_n_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_add_n_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_add_n_test "") 8 | 9 | target_include_directories(kernels_add_n_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_add_n_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_add_n_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_add_n_test 1) 25 | pico_enable_stdio_uart(kernels_add_n_test 0) 26 | 27 | target_sources(kernels_add_n_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_add_n_test/add_n_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_add_n_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_add_n_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_add_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_add_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_add_test "") 8 | 9 | target_include_directories(kernels_add_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_add_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_add_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_add_test 1) 25 | pico_enable_stdio_uart(kernels_add_test 0) 26 | 27 | target_sources(kernels_add_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_add_test/add_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_add_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_add_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_arg_min_max_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_arg_min_max_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_arg_min_max_test "") 8 | 9 | target_include_directories(kernels_arg_min_max_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_arg_min_max_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_arg_min_max_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_arg_min_max_test 1) 25 | pico_enable_stdio_uart(kernels_arg_min_max_test 0) 26 | 27 | target_sources(kernels_arg_min_max_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_arg_min_max_test/arg_min_max_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_arg_min_max_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_arg_min_max_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_batch_matmul_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_batch_matmul_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_batch_matmul_test "") 8 | 9 | target_include_directories(kernels_batch_matmul_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_batch_matmul_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_batch_matmul_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_batch_matmul_test 1) 25 | pico_enable_stdio_uart(kernels_batch_matmul_test 0) 26 | 27 | target_sources(kernels_batch_matmul_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_batch_matmul_test/batch_matmul_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_batch_matmul_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_batch_matmul_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_batch_to_space_nd_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_batch_to_space_nd_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_batch_to_space_nd_test "") 8 | 9 | target_include_directories(kernels_batch_to_space_nd_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_batch_to_space_nd_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_batch_to_space_nd_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_batch_to_space_nd_test 1) 25 | pico_enable_stdio_uart(kernels_batch_to_space_nd_test 0) 26 | 27 | target_sources(kernels_batch_to_space_nd_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_batch_to_space_nd_test/batch_to_space_nd_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_batch_to_space_nd_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_batch_to_space_nd_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_broadcast_args_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_broadcast_args_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_broadcast_args_test "") 8 | 9 | target_include_directories(kernels_broadcast_args_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_broadcast_args_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_broadcast_args_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_broadcast_args_test 1) 25 | pico_enable_stdio_uart(kernels_broadcast_args_test 0) 26 | 27 | target_sources(kernels_broadcast_args_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_broadcast_args_test/broadcast_args_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_broadcast_args_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_broadcast_args_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_broadcast_to_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_broadcast_to_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_broadcast_to_test "") 8 | 9 | target_include_directories(kernels_broadcast_to_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_broadcast_to_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_broadcast_to_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_broadcast_to_test 1) 25 | pico_enable_stdio_uart(kernels_broadcast_to_test 0) 26 | 27 | target_sources(kernels_broadcast_to_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_broadcast_to_test/broadcast_to_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_broadcast_to_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_broadcast_to_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_call_once_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_call_once_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_call_once_test "") 8 | 9 | target_include_directories(kernels_call_once_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_call_once_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_call_once_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_call_once_test 1) 25 | pico_enable_stdio_uart(kernels_call_once_test 0) 26 | 27 | target_sources(kernels_call_once_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_call_once_test/call_once_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_call_once_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_call_once_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_cast_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_cast_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_cast_test "") 8 | 9 | target_include_directories(kernels_cast_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_cast_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_cast_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_cast_test 1) 25 | pico_enable_stdio_uart(kernels_cast_test 0) 26 | 27 | target_sources(kernels_cast_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_cast_test/cast_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_cast_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_cast_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_ceil_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_ceil_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_ceil_test "") 8 | 9 | target_include_directories(kernels_ceil_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_ceil_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_ceil_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_ceil_test 1) 25 | pico_enable_stdio_uart(kernels_ceil_test 0) 26 | 27 | target_sources(kernels_ceil_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_ceil_test/ceil_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_ceil_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_ceil_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_circular_buffer_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_circular_buffer_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_circular_buffer_test "") 8 | 9 | target_include_directories(kernels_circular_buffer_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_circular_buffer_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_circular_buffer_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_circular_buffer_test 1) 25 | pico_enable_stdio_uart(kernels_circular_buffer_test 0) 26 | 27 | target_sources(kernels_circular_buffer_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_circular_buffer_test/circular_buffer_test.cpp 30 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_circular_buffer_test/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.cpp 31 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_circular_buffer_test/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h 32 | 33 | ) 34 | 35 | target_link_libraries( 36 | kernels_circular_buffer_test 37 | pico-tflmicro 38 | pico-tflmicro_test 39 | ) 40 | 41 | pico_add_extra_outputs(kernels_circular_buffer_test) 42 | -------------------------------------------------------------------------------- /tests/kernels_circular_buffer_test/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // This file is generated. See: 17 | // third_party/tensorflow/lite/micro/kernels/test_data_generation/README.md 18 | 19 | #include "tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h" 20 | 21 | const int g_gen_data_size_circular_buffer_config = 21; 22 | const unsigned char g_gen_data_circular_buffer_config[] = { 23 | 0x63, 0x79, 0x63, 0x6c, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x78, 0x00, 24 | 0x01, 0x0c, 0x01, 0x01, 0x01, 0x01, 0x04, 0x02, 0x24, 0x01, 25 | }; 26 | -------------------------------------------------------------------------------- /tests/kernels_circular_buffer_test/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_circular_buffer_config; 20 | extern const unsigned char g_gen_data_circular_buffer_config[]; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /tests/kernels_comparisons_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_comparisons_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_comparisons_test "") 8 | 9 | target_include_directories(kernels_comparisons_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_comparisons_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_comparisons_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_comparisons_test 1) 25 | pico_enable_stdio_uart(kernels_comparisons_test 0) 26 | 27 | target_sources(kernels_comparisons_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_comparisons_test/comparisons_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_comparisons_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_comparisons_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_concatenation_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_concatenation_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_concatenation_test "") 8 | 9 | target_include_directories(kernels_concatenation_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_concatenation_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_concatenation_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_concatenation_test 1) 25 | pico_enable_stdio_uart(kernels_concatenation_test 0) 26 | 27 | target_sources(kernels_concatenation_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_concatenation_test/concatenation_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_concatenation_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_concatenation_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_conv_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_conv_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_conv_test "") 8 | 9 | target_include_directories(kernels_conv_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_conv_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_conv_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_conv_test 1) 25 | pico_enable_stdio_uart(kernels_conv_test 0) 26 | 27 | target_sources(kernels_conv_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_conv_test/conv_test.cpp 30 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_conv_test/tensorflow/lite/micro/kernels//conv_test_common.cpp 31 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_conv_test/tensorflow/lite/micro/kernels//testdata/conv_test_data.cpp 32 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_conv_test/tensorflow/lite/micro/kernels//testdata/conv_test_data.h 33 | 34 | ) 35 | 36 | target_link_libraries( 37 | kernels_conv_test 38 | pico-tflmicro 39 | pico-tflmicro_test 40 | ) 41 | 42 | pico_add_extra_outputs(kernels_conv_test) 43 | -------------------------------------------------------------------------------- /tests/kernels_cumsum_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_cumsum_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_cumsum_test "") 8 | 9 | target_include_directories(kernels_cumsum_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_cumsum_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_cumsum_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_cumsum_test 1) 25 | pico_enable_stdio_uart(kernels_cumsum_test 0) 26 | 27 | target_sources(kernels_cumsum_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_cumsum_test/cumsum_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_cumsum_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_cumsum_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_decompress_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_decompress_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_decompress_test "") 8 | 9 | target_include_directories(kernels_decompress_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_decompress_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_decompress_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_decompress_test 1) 25 | pico_enable_stdio_uart(kernels_decompress_test 0) 26 | 27 | target_sources(kernels_decompress_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_decompress_test/decompress_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_decompress_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_decompress_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_depth_to_space_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_depth_to_space_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_depth_to_space_test "") 8 | 9 | target_include_directories(kernels_depth_to_space_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_depth_to_space_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_depth_to_space_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_depth_to_space_test 1) 25 | pico_enable_stdio_uart(kernels_depth_to_space_test 0) 26 | 27 | target_sources(kernels_depth_to_space_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_depth_to_space_test/depth_to_space_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_depth_to_space_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_depth_to_space_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_depthwise_conv_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_depthwise_conv_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_depthwise_conv_test "") 8 | 9 | target_include_directories(kernels_depthwise_conv_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_depthwise_conv_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_depthwise_conv_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_depthwise_conv_test 1) 25 | pico_enable_stdio_uart(kernels_depthwise_conv_test 0) 26 | 27 | target_sources(kernels_depthwise_conv_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_depthwise_conv_test/depthwise_conv_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_depthwise_conv_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_depthwise_conv_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_dequantize_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_dequantize_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_dequantize_test "") 8 | 9 | target_include_directories(kernels_dequantize_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_dequantize_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_dequantize_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_dequantize_test 1) 25 | pico_enable_stdio_uart(kernels_dequantize_test 0) 26 | 27 | target_sources(kernels_dequantize_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_dequantize_test/dequantize_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_dequantize_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_dequantize_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_detection_postprocess_test/tensorflow/lite/micro/kernels/detection_postprocess_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_none_regular_nms; 20 | extern const unsigned char g_gen_data_none_regular_nms[]; 21 | 22 | extern const int g_gen_data_size_regular_nms; 23 | extern const unsigned char g_gen_data_regular_nms[]; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tests/kernels_div_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_div_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_div_test "") 8 | 9 | target_include_directories(kernels_div_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_div_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_div_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_div_test 1) 25 | pico_enable_stdio_uart(kernels_div_test 0) 26 | 27 | target_sources(kernels_div_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_div_test/div_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_div_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_div_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_elementwise_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_elementwise_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_elementwise_test "") 8 | 9 | target_include_directories(kernels_elementwise_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_elementwise_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_elementwise_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_elementwise_test 1) 25 | pico_enable_stdio_uart(kernels_elementwise_test 0) 26 | 27 | target_sources(kernels_elementwise_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_elementwise_test/elementwise_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_elementwise_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_elementwise_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_elu_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_elu_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_elu_test "") 8 | 9 | target_include_directories(kernels_elu_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_elu_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_elu_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_elu_test 1) 25 | pico_enable_stdio_uart(kernels_elu_test 0) 26 | 27 | target_sources(kernels_elu_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_elu_test/elu_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_elu_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_elu_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_embedding_lookup_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_embedding_lookup_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_embedding_lookup_test "") 8 | 9 | target_include_directories(kernels_embedding_lookup_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_embedding_lookup_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_embedding_lookup_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_embedding_lookup_test 1) 25 | pico_enable_stdio_uart(kernels_embedding_lookup_test 0) 26 | 27 | target_sources(kernels_embedding_lookup_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_embedding_lookup_test/embedding_lookup_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_embedding_lookup_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_embedding_lookup_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_exp_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_exp_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_exp_test "") 8 | 9 | target_include_directories(kernels_exp_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_exp_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_exp_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_exp_test 1) 25 | pico_enable_stdio_uart(kernels_exp_test 0) 26 | 27 | target_sources(kernels_exp_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_exp_test/exp_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_exp_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_exp_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_expand_dims_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_expand_dims_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_expand_dims_test "") 8 | 9 | target_include_directories(kernels_expand_dims_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_expand_dims_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_expand_dims_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_expand_dims_test 1) 25 | pico_enable_stdio_uart(kernels_expand_dims_test 0) 26 | 27 | target_sources(kernels_expand_dims_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_expand_dims_test/expand_dims_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_expand_dims_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_expand_dims_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_fill_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_fill_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_fill_test "") 8 | 9 | target_include_directories(kernels_fill_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_fill_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_fill_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_fill_test 1) 25 | pico_enable_stdio_uart(kernels_fill_test 0) 26 | 27 | target_sources(kernels_fill_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_fill_test/fill_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_fill_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_fill_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_floor_div_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_floor_div_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_floor_div_test "") 8 | 9 | target_include_directories(kernels_floor_div_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_floor_div_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_floor_div_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_floor_div_test 1) 25 | pico_enable_stdio_uart(kernels_floor_div_test 0) 26 | 27 | target_sources(kernels_floor_div_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_floor_div_test/floor_div_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_floor_div_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_floor_div_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_floor_mod_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_floor_mod_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_floor_mod_test "") 8 | 9 | target_include_directories(kernels_floor_mod_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_floor_mod_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_floor_mod_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_floor_mod_test 1) 25 | pico_enable_stdio_uart(kernels_floor_mod_test 0) 26 | 27 | target_sources(kernels_floor_mod_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_floor_mod_test/floor_mod_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_floor_mod_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_floor_mod_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_floor_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_floor_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_floor_test "") 8 | 9 | target_include_directories(kernels_floor_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_floor_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_floor_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_floor_test 1) 25 | pico_enable_stdio_uart(kernels_floor_test 0) 26 | 27 | target_sources(kernels_floor_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_floor_test/floor_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_floor_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_floor_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_fully_connected_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_fully_connected_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_fully_connected_test "") 8 | 9 | target_include_directories(kernels_fully_connected_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_fully_connected_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_fully_connected_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_fully_connected_test 1) 25 | pico_enable_stdio_uart(kernels_fully_connected_test 0) 26 | 27 | target_sources(kernels_fully_connected_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_fully_connected_test/fully_connected_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_fully_connected_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_fully_connected_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_gather_nd_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_gather_nd_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_gather_nd_test "") 8 | 9 | target_include_directories(kernels_gather_nd_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_gather_nd_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_gather_nd_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_gather_nd_test 1) 25 | pico_enable_stdio_uart(kernels_gather_nd_test 0) 26 | 27 | target_sources(kernels_gather_nd_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_gather_nd_test/gather_nd_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_gather_nd_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_gather_nd_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_gather_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_gather_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_gather_test "") 8 | 9 | target_include_directories(kernels_gather_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_gather_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_gather_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_gather_test 1) 25 | pico_enable_stdio_uart(kernels_gather_test 0) 26 | 27 | target_sources(kernels_gather_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_gather_test/gather_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_gather_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_gather_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_hard_swish_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_hard_swish_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_hard_swish_test "") 8 | 9 | target_include_directories(kernels_hard_swish_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_hard_swish_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_hard_swish_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_hard_swish_test 1) 25 | pico_enable_stdio_uart(kernels_hard_swish_test 0) 26 | 27 | target_sources(kernels_hard_swish_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_hard_swish_test/hard_swish_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_hard_swish_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_hard_swish_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_if_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_if_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_if_test "") 8 | 9 | target_include_directories(kernels_if_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_if_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_if_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_if_test 1) 25 | pico_enable_stdio_uart(kernels_if_test 0) 26 | 27 | target_sources(kernels_if_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_if_test/if_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_if_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_if_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_l2_pool_2d_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_l2_pool_2d_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_l2_pool_2d_test "") 8 | 9 | target_include_directories(kernels_l2_pool_2d_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_l2_pool_2d_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_l2_pool_2d_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_l2_pool_2d_test 1) 25 | pico_enable_stdio_uart(kernels_l2_pool_2d_test 0) 26 | 27 | target_sources(kernels_l2_pool_2d_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_l2_pool_2d_test/l2_pool_2d_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_l2_pool_2d_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_l2_pool_2d_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_l2norm_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_l2norm_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_l2norm_test "") 8 | 9 | target_include_directories(kernels_l2norm_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_l2norm_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_l2norm_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_l2norm_test 1) 25 | pico_enable_stdio_uart(kernels_l2norm_test 0) 26 | 27 | target_sources(kernels_l2norm_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_l2norm_test/l2norm_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_l2norm_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_l2norm_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_leaky_relu_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_leaky_relu_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_leaky_relu_test "") 8 | 9 | target_include_directories(kernels_leaky_relu_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_leaky_relu_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_leaky_relu_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_leaky_relu_test 1) 25 | pico_enable_stdio_uart(kernels_leaky_relu_test 0) 26 | 27 | target_sources(kernels_leaky_relu_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_leaky_relu_test/leaky_relu_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_leaky_relu_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_leaky_relu_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_log_softmax_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_log_softmax_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_log_softmax_test "") 8 | 9 | target_include_directories(kernels_log_softmax_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_log_softmax_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_log_softmax_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_log_softmax_test 1) 25 | pico_enable_stdio_uart(kernels_log_softmax_test 0) 26 | 27 | target_sources(kernels_log_softmax_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_log_softmax_test/log_softmax_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_log_softmax_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_log_softmax_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_logical_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_logical_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_logical_test "") 8 | 9 | target_include_directories(kernels_logical_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_logical_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_logical_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_logical_test 1) 25 | pico_enable_stdio_uart(kernels_logical_test 0) 26 | 27 | target_sources(kernels_logical_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_logical_test/logical_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_logical_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_logical_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_logistic_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_logistic_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_logistic_test "") 8 | 9 | target_include_directories(kernels_logistic_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_logistic_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_logistic_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_logistic_test 1) 25 | pico_enable_stdio_uart(kernels_logistic_test 0) 26 | 27 | target_sources(kernels_logistic_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_logistic_test/logistic_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_logistic_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_logistic_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_lstm_eval_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_lstm_eval_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_lstm_eval_test "") 8 | 9 | target_include_directories(kernels_lstm_eval_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_lstm_eval_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_lstm_eval_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_lstm_eval_test 1) 25 | pico_enable_stdio_uart(kernels_lstm_eval_test 0) 26 | 27 | target_sources(kernels_lstm_eval_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_lstm_eval_test/lstm_eval_test.cpp 30 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_lstm_eval_test/tensorflow/lite/micro/kernels/testdata/lstm_test_data.cpp 31 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_lstm_eval_test/tensorflow/lite/micro/kernels/testdata/lstm_test_data.h 32 | 33 | ) 34 | 35 | target_link_libraries( 36 | kernels_lstm_eval_test 37 | pico-tflmicro 38 | pico-tflmicro_test 39 | ) 40 | 41 | pico_add_extra_outputs(kernels_lstm_eval_test) 42 | -------------------------------------------------------------------------------- /tests/kernels_maximum_minimum_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_maximum_minimum_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_maximum_minimum_test "") 8 | 9 | target_include_directories(kernels_maximum_minimum_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_maximum_minimum_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_maximum_minimum_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_maximum_minimum_test 1) 25 | pico_enable_stdio_uart(kernels_maximum_minimum_test 0) 26 | 27 | target_sources(kernels_maximum_minimum_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_maximum_minimum_test/maximum_minimum_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_maximum_minimum_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_maximum_minimum_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_mirror_pad_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_mirror_pad_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_mirror_pad_test "") 8 | 9 | target_include_directories(kernels_mirror_pad_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_mirror_pad_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_mirror_pad_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_mirror_pad_test 1) 25 | pico_enable_stdio_uart(kernels_mirror_pad_test 0) 26 | 27 | target_sources(kernels_mirror_pad_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_mirror_pad_test/mirror_pad_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_mirror_pad_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_mirror_pad_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_mul_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_mul_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_mul_test "") 8 | 9 | target_include_directories(kernels_mul_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_mul_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_mul_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_mul_test 1) 25 | pico_enable_stdio_uart(kernels_mul_test 0) 26 | 27 | target_sources(kernels_mul_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_mul_test/mul_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_mul_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_mul_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_neg_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_neg_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_neg_test "") 8 | 9 | target_include_directories(kernels_neg_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_neg_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_neg_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_neg_test 1) 25 | pico_enable_stdio_uart(kernels_neg_test 0) 26 | 27 | target_sources(kernels_neg_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_neg_test/neg_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_neg_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_neg_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_pack_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_pack_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_pack_test "") 8 | 9 | target_include_directories(kernels_pack_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_pack_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_pack_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_pack_test 1) 25 | pico_enable_stdio_uart(kernels_pack_test 0) 26 | 27 | target_sources(kernels_pack_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_pack_test/pack_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_pack_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_pack_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_pad_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_pad_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_pad_test "") 8 | 9 | target_include_directories(kernels_pad_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_pad_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_pad_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_pad_test 1) 25 | pico_enable_stdio_uart(kernels_pad_test 0) 26 | 27 | target_sources(kernels_pad_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_pad_test/pad_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_pad_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_pad_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_pooling_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_pooling_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_pooling_test "") 8 | 9 | target_include_directories(kernels_pooling_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_pooling_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_pooling_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_pooling_test 1) 25 | pico_enable_stdio_uart(kernels_pooling_test 0) 26 | 27 | target_sources(kernels_pooling_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_pooling_test/pooling_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_pooling_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_pooling_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_prelu_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_prelu_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_prelu_test "") 8 | 9 | target_include_directories(kernels_prelu_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_prelu_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_prelu_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_prelu_test 1) 25 | pico_enable_stdio_uart(kernels_prelu_test 0) 26 | 27 | target_sources(kernels_prelu_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_prelu_test/prelu_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_prelu_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_prelu_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_quantization_util_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_quantization_util_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_quantization_util_test "") 8 | 9 | target_include_directories(kernels_quantization_util_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_quantization_util_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_quantization_util_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_quantization_util_test 1) 25 | pico_enable_stdio_uart(kernels_quantization_util_test 0) 26 | 27 | target_sources(kernels_quantization_util_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_quantization_util_test/quantization_util_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_quantization_util_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_quantization_util_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_quantize_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_quantize_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_quantize_test "") 8 | 9 | target_include_directories(kernels_quantize_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_quantize_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_quantize_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_quantize_test 1) 25 | pico_enable_stdio_uart(kernels_quantize_test 0) 26 | 27 | target_sources(kernels_quantize_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_quantize_test/quantize_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_quantize_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_quantize_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_reduce_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_reduce_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_reduce_test "") 8 | 9 | target_include_directories(kernels_reduce_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_reduce_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_reduce_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_reduce_test 1) 25 | pico_enable_stdio_uart(kernels_reduce_test 0) 26 | 27 | target_sources(kernels_reduce_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_reduce_test/reduce_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_reduce_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_reduce_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_reshape_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_reshape_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_reshape_test "") 8 | 9 | target_include_directories(kernels_reshape_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_reshape_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_reshape_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_reshape_test 1) 25 | pico_enable_stdio_uart(kernels_reshape_test 0) 26 | 27 | target_sources(kernels_reshape_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_reshape_test/reshape_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_reshape_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_reshape_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_resize_bilinear_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_resize_bilinear_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_resize_bilinear_test "") 8 | 9 | target_include_directories(kernels_resize_bilinear_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_resize_bilinear_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_resize_bilinear_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_resize_bilinear_test 1) 25 | pico_enable_stdio_uart(kernels_resize_bilinear_test 0) 26 | 27 | target_sources(kernels_resize_bilinear_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_resize_bilinear_test/resize_bilinear_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_resize_bilinear_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_resize_bilinear_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_resize_nearest_neighbor_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_resize_nearest_neighbor_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_resize_nearest_neighbor_test "") 8 | 9 | target_include_directories(kernels_resize_nearest_neighbor_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_resize_nearest_neighbor_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_resize_nearest_neighbor_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_resize_nearest_neighbor_test 1) 25 | pico_enable_stdio_uart(kernels_resize_nearest_neighbor_test 0) 26 | 27 | target_sources(kernels_resize_nearest_neighbor_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_resize_nearest_neighbor_test/resize_nearest_neighbor_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_resize_nearest_neighbor_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_resize_nearest_neighbor_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_round_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_round_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_round_test "") 8 | 9 | target_include_directories(kernels_round_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_round_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_round_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_round_test 1) 25 | pico_enable_stdio_uart(kernels_round_test 0) 26 | 27 | target_sources(kernels_round_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_round_test/round_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_round_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_round_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_select_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_select_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_select_test "") 8 | 9 | target_include_directories(kernels_select_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_select_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_select_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_select_test 1) 25 | pico_enable_stdio_uart(kernels_select_test 0) 26 | 27 | target_sources(kernels_select_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_select_test/select_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_select_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_select_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_shape_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_shape_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_shape_test "") 8 | 9 | target_include_directories(kernels_shape_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_shape_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_shape_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_shape_test 1) 25 | pico_enable_stdio_uart(kernels_shape_test 0) 26 | 27 | target_sources(kernels_shape_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_shape_test/shape_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_shape_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_shape_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_slice_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_slice_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_slice_test "") 8 | 9 | target_include_directories(kernels_slice_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_slice_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_slice_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_slice_test 1) 25 | pico_enable_stdio_uart(kernels_slice_test 0) 26 | 27 | target_sources(kernels_slice_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_slice_test/slice_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_slice_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_slice_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_softmax_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_softmax_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_softmax_test "") 8 | 9 | target_include_directories(kernels_softmax_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_softmax_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_softmax_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_softmax_test 1) 25 | pico_enable_stdio_uart(kernels_softmax_test 0) 26 | 27 | target_sources(kernels_softmax_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_softmax_test/softmax_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_softmax_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_softmax_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_space_to_batch_nd_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_space_to_batch_nd_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_space_to_batch_nd_test "") 8 | 9 | target_include_directories(kernels_space_to_batch_nd_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_space_to_batch_nd_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_space_to_batch_nd_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_space_to_batch_nd_test 1) 25 | pico_enable_stdio_uart(kernels_space_to_batch_nd_test 0) 26 | 27 | target_sources(kernels_space_to_batch_nd_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_space_to_batch_nd_test/space_to_batch_nd_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_space_to_batch_nd_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_space_to_batch_nd_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_space_to_depth_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_space_to_depth_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_space_to_depth_test "") 8 | 9 | target_include_directories(kernels_space_to_depth_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_space_to_depth_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_space_to_depth_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_space_to_depth_test 1) 25 | pico_enable_stdio_uart(kernels_space_to_depth_test 0) 26 | 27 | target_sources(kernels_space_to_depth_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_space_to_depth_test/space_to_depth_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_space_to_depth_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_space_to_depth_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_split_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_split_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_split_test "") 8 | 9 | target_include_directories(kernels_split_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_split_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_split_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_split_test 1) 25 | pico_enable_stdio_uart(kernels_split_test 0) 26 | 27 | target_sources(kernels_split_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_split_test/split_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_split_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_split_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_split_v_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_split_v_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_split_v_test "") 8 | 9 | target_include_directories(kernels_split_v_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_split_v_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_split_v_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_split_v_test 1) 25 | pico_enable_stdio_uart(kernels_split_v_test 0) 26 | 27 | target_sources(kernels_split_v_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_split_v_test/split_v_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_split_v_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_split_v_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_squared_difference_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_squared_difference_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_squared_difference_test "") 8 | 9 | target_include_directories(kernels_squared_difference_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_squared_difference_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_squared_difference_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_squared_difference_test 1) 25 | pico_enable_stdio_uart(kernels_squared_difference_test 0) 26 | 27 | target_sources(kernels_squared_difference_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_squared_difference_test/squared_difference_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_squared_difference_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_squared_difference_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_squeeze_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_squeeze_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_squeeze_test "") 8 | 9 | target_include_directories(kernels_squeeze_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_squeeze_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_squeeze_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_squeeze_test 1) 25 | pico_enable_stdio_uart(kernels_squeeze_test 0) 26 | 27 | target_sources(kernels_squeeze_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_squeeze_test/squeeze_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_squeeze_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_squeeze_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_strided_slice_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_strided_slice_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_strided_slice_test "") 8 | 9 | target_include_directories(kernels_strided_slice_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_strided_slice_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_strided_slice_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_strided_slice_test 1) 25 | pico_enable_stdio_uart(kernels_strided_slice_test 0) 26 | 27 | target_sources(kernels_strided_slice_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_strided_slice_test/strided_slice_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_strided_slice_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_strided_slice_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_sub_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_sub_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_sub_test "") 8 | 9 | target_include_directories(kernels_sub_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_sub_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_sub_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_sub_test 1) 25 | pico_enable_stdio_uart(kernels_sub_test 0) 26 | 27 | target_sources(kernels_sub_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_sub_test/sub_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_sub_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_sub_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_svdf_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_svdf_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_svdf_test "") 8 | 9 | target_include_directories(kernels_svdf_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_svdf_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_svdf_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_svdf_test 1) 25 | pico_enable_stdio_uart(kernels_svdf_test 0) 26 | 27 | target_sources(kernels_svdf_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_svdf_test/svdf_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_svdf_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_svdf_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_tanh_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_tanh_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_tanh_test "") 8 | 9 | target_include_directories(kernels_tanh_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_tanh_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_tanh_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_tanh_test 1) 25 | pico_enable_stdio_uart(kernels_tanh_test 0) 26 | 27 | target_sources(kernels_tanh_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_tanh_test/tanh_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_tanh_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_tanh_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_transpose_conv_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_transpose_conv_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_transpose_conv_test "") 8 | 9 | target_include_directories(kernels_transpose_conv_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_transpose_conv_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_transpose_conv_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_transpose_conv_test 1) 25 | pico_enable_stdio_uart(kernels_transpose_conv_test 0) 26 | 27 | target_sources(kernels_transpose_conv_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_transpose_conv_test/transpose_conv_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_transpose_conv_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_transpose_conv_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_transpose_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_transpose_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_transpose_test "") 8 | 9 | target_include_directories(kernels_transpose_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_transpose_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_transpose_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_transpose_test 1) 25 | pico_enable_stdio_uart(kernels_transpose_test 0) 26 | 27 | target_sources(kernels_transpose_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_transpose_test/transpose_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_transpose_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_transpose_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_unpack_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_unpack_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_unpack_test "") 8 | 9 | target_include_directories(kernels_unpack_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_unpack_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_unpack_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_unpack_test 1) 25 | pico_enable_stdio_uart(kernels_unpack_test 0) 26 | 27 | target_sources(kernels_unpack_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_unpack_test/unpack_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_unpack_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_unpack_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_while_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_while_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_while_test "") 8 | 9 | target_include_directories(kernels_while_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_while_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_while_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_while_test 1) 25 | pico_enable_stdio_uart(kernels_while_test 0) 26 | 27 | target_sources(kernels_while_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_while_test/while_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_while_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_while_test) 40 | -------------------------------------------------------------------------------- /tests/kernels_zeros_like_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(kernels_zeros_like_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(kernels_zeros_like_test "") 8 | 9 | target_include_directories(kernels_zeros_like_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_zeros_like_test 12 | ) 13 | 14 | set_target_properties( 15 | kernels_zeros_like_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(kernels_zeros_like_test 1) 25 | pico_enable_stdio_uart(kernels_zeros_like_test 0) 26 | 27 | target_sources(kernels_zeros_like_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/kernels_zeros_like_test/zeros_like_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | kernels_zeros_like_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(kernels_zeros_like_test) 40 | -------------------------------------------------------------------------------- /tests/memory_arena_threshold_test/tensorflow/lite/micro/models/keyword_scrambled_model_data.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | constexpr unsigned int g_keyword_scrambled_model_data_size = 34576; 4 | extern const unsigned char g_keyword_scrambled_model_data[]; 5 | -------------------------------------------------------------------------------- /tests/memory_arena_threshold_test/tensorflow/lite/micro/testing/test_conv_model.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 17 | #define TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 18 | 19 | // See generate_test_models.py for updating the contents of this model: 20 | extern const unsigned char kTestConvModelData[]; 21 | extern const unsigned int kTestConvModelDataSize; 22 | 23 | #endif // TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 24 | -------------------------------------------------------------------------------- /tests/memory_helpers_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(memory_helpers_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(memory_helpers_test "") 8 | 9 | target_include_directories(memory_helpers_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_helpers_test 12 | ) 13 | 14 | set_target_properties( 15 | memory_helpers_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(memory_helpers_test 1) 25 | pico_enable_stdio_uart(memory_helpers_test 0) 26 | 27 | target_sources(memory_helpers_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_helpers_test/memory_helpers_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | memory_helpers_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(memory_helpers_test) 40 | -------------------------------------------------------------------------------- /tests/memory_planner_greedy_memory_planner_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(memory_planner_greedy_memory_planner_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(memory_planner_greedy_memory_planner_test "") 8 | 9 | target_include_directories(memory_planner_greedy_memory_planner_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_planner_greedy_memory_planner_test 12 | ) 13 | 14 | set_target_properties( 15 | memory_planner_greedy_memory_planner_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(memory_planner_greedy_memory_planner_test 1) 25 | pico_enable_stdio_uart(memory_planner_greedy_memory_planner_test 0) 26 | 27 | target_sources(memory_planner_greedy_memory_planner_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_planner_greedy_memory_planner_test/greedy_memory_planner_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | memory_planner_greedy_memory_planner_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(memory_planner_greedy_memory_planner_test) 40 | -------------------------------------------------------------------------------- /tests/memory_planner_linear_memory_planner_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(memory_planner_linear_memory_planner_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(memory_planner_linear_memory_planner_test "") 8 | 9 | target_include_directories(memory_planner_linear_memory_planner_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_planner_linear_memory_planner_test 12 | ) 13 | 14 | set_target_properties( 15 | memory_planner_linear_memory_planner_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(memory_planner_linear_memory_planner_test 1) 25 | pico_enable_stdio_uart(memory_planner_linear_memory_planner_test 0) 26 | 27 | target_sources(memory_planner_linear_memory_planner_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_planner_linear_memory_planner_test/linear_memory_planner_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | memory_planner_linear_memory_planner_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(memory_planner_linear_memory_planner_test) 40 | -------------------------------------------------------------------------------- /tests/memory_planner_non_persistent_buffer_planner_shim_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(memory_planner_non_persistent_buffer_planner_shim_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(memory_planner_non_persistent_buffer_planner_shim_test "") 8 | 9 | target_include_directories(memory_planner_non_persistent_buffer_planner_shim_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_planner_non_persistent_buffer_planner_shim_test 12 | ) 13 | 14 | set_target_properties( 15 | memory_planner_non_persistent_buffer_planner_shim_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(memory_planner_non_persistent_buffer_planner_shim_test 1) 25 | pico_enable_stdio_uart(memory_planner_non_persistent_buffer_planner_shim_test 0) 26 | 27 | target_sources(memory_planner_non_persistent_buffer_planner_shim_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/memory_planner_non_persistent_buffer_planner_shim_test/non_persistent_buffer_planner_shim_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | memory_planner_non_persistent_buffer_planner_shim_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(memory_planner_non_persistent_buffer_planner_shim_test) 40 | -------------------------------------------------------------------------------- /tests/micro_allocation_info_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_allocation_info_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_allocation_info_test "") 8 | 9 | target_include_directories(micro_allocation_info_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_allocation_info_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_allocation_info_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_allocation_info_test 1) 25 | pico_enable_stdio_uart(micro_allocation_info_test 0) 26 | 27 | target_sources(micro_allocation_info_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_allocation_info_test/micro_allocation_info_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_allocation_info_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_allocation_info_test) 40 | -------------------------------------------------------------------------------- /tests/micro_allocator_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_allocator_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_allocator_test "") 8 | 9 | target_include_directories(micro_allocator_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_allocator_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_allocator_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_allocator_test 1) 25 | pico_enable_stdio_uart(micro_allocator_test 0) 26 | 27 | target_sources(micro_allocator_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_allocator_test/micro_allocator_test.cpp 30 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_allocator_test/tensorflow/lite/micro/testing/test_conv_model.cpp 31 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_allocator_test/tensorflow/lite/micro/testing/test_conv_model.h 32 | 33 | ) 34 | 35 | target_link_libraries( 36 | micro_allocator_test 37 | pico-tflmicro 38 | pico-tflmicro_test 39 | ) 40 | 41 | pico_add_extra_outputs(micro_allocator_test) 42 | -------------------------------------------------------------------------------- /tests/micro_allocator_test/tensorflow/lite/micro/testing/test_conv_model.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 17 | #define TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 18 | 19 | // See generate_test_models.py for updating the contents of this model: 20 | extern const unsigned char kTestConvModelData[]; 21 | extern const unsigned int kTestConvModelDataSize; 22 | 23 | #endif // TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 24 | -------------------------------------------------------------------------------- /tests/micro_interpreter_context_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_interpreter_context_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_interpreter_context_test "") 8 | 9 | target_include_directories(micro_interpreter_context_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_interpreter_context_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_interpreter_context_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_interpreter_context_test 1) 25 | pico_enable_stdio_uart(micro_interpreter_context_test 0) 26 | 27 | target_sources(micro_interpreter_context_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_interpreter_context_test/micro_interpreter_context_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_interpreter_context_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_interpreter_context_test) 40 | -------------------------------------------------------------------------------- /tests/micro_log_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_log_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_log_test "") 8 | 9 | target_include_directories(micro_log_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_log_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_log_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_log_test 1) 25 | pico_enable_stdio_uart(micro_log_test 0) 26 | 27 | target_sources(micro_log_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_log_test/micro_log_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_log_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_log_test) 40 | -------------------------------------------------------------------------------- /tests/micro_mutable_op_resolver_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_mutable_op_resolver_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_mutable_op_resolver_test "") 8 | 9 | target_include_directories(micro_mutable_op_resolver_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_mutable_op_resolver_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_mutable_op_resolver_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_mutable_op_resolver_test 1) 25 | pico_enable_stdio_uart(micro_mutable_op_resolver_test 0) 26 | 27 | target_sources(micro_mutable_op_resolver_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_mutable_op_resolver_test/micro_mutable_op_resolver_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_mutable_op_resolver_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_mutable_op_resolver_test) 40 | -------------------------------------------------------------------------------- /tests/micro_resource_variable_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_resource_variable_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_resource_variable_test "") 8 | 9 | target_include_directories(micro_resource_variable_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_resource_variable_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_resource_variable_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_resource_variable_test 1) 25 | pico_enable_stdio_uart(micro_resource_variable_test 0) 26 | 27 | target_sources(micro_resource_variable_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_resource_variable_test/micro_resource_variable_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_resource_variable_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_resource_variable_test) 40 | -------------------------------------------------------------------------------- /tests/micro_time_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_time_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_time_test "") 8 | 9 | target_include_directories(micro_time_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_time_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_time_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_time_test 1) 25 | pico_enable_stdio_uart(micro_time_test 0) 26 | 27 | target_sources(micro_time_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_time_test/micro_time_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_time_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_time_test) 40 | -------------------------------------------------------------------------------- /tests/micro_utils_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(micro_utils_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(micro_utils_test "") 8 | 9 | target_include_directories(micro_utils_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_utils_test 12 | ) 13 | 14 | set_target_properties( 15 | micro_utils_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(micro_utils_test 1) 25 | pico_enable_stdio_uart(micro_utils_test 0) 26 | 27 | target_sources(micro_utils_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/micro_utils_test/micro_utils_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | micro_utils_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(micro_utils_test) 40 | -------------------------------------------------------------------------------- /tests/recording_micro_allocator_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(recording_micro_allocator_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(recording_micro_allocator_test "") 8 | 9 | target_include_directories(recording_micro_allocator_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/recording_micro_allocator_test 12 | ) 13 | 14 | set_target_properties( 15 | recording_micro_allocator_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(recording_micro_allocator_test 1) 25 | pico_enable_stdio_uart(recording_micro_allocator_test 0) 26 | 27 | target_sources(recording_micro_allocator_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/recording_micro_allocator_test/recording_micro_allocator_test.cpp 30 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/recording_micro_allocator_test/tensorflow/lite/micro/testing/test_conv_model.cpp 31 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/recording_micro_allocator_test/tensorflow/lite/micro/testing/test_conv_model.h 32 | 33 | ) 34 | 35 | target_link_libraries( 36 | recording_micro_allocator_test 37 | pico-tflmicro 38 | pico-tflmicro_test 39 | ) 40 | 41 | pico_add_extra_outputs(recording_micro_allocator_test) 42 | -------------------------------------------------------------------------------- /tests/recording_micro_allocator_test/tensorflow/lite/micro/testing/test_conv_model.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 17 | #define TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 18 | 19 | // See generate_test_models.py for updating the contents of this model: 20 | extern const unsigned char kTestConvModelData[]; 21 | extern const unsigned int kTestConvModelDataSize; 22 | 23 | #endif // TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 24 | -------------------------------------------------------------------------------- /tests/span_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(span_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(span_test "") 8 | 9 | target_include_directories(span_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/span_test 12 | ) 13 | 14 | set_target_properties( 15 | span_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(span_test 1) 25 | pico_enable_stdio_uart(span_test 0) 26 | 27 | target_sources(span_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/span_test/span_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | span_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(span_test) 40 | -------------------------------------------------------------------------------- /tests/static_vector_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(static_vector_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(static_vector_test "") 8 | 9 | target_include_directories(static_vector_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/static_vector_test 12 | ) 13 | 14 | set_target_properties( 15 | static_vector_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(static_vector_test 1) 25 | pico_enable_stdio_uart(static_vector_test 0) 26 | 27 | target_sources(static_vector_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/static_vector_test/static_vector_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | static_vector_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(static_vector_test) 40 | -------------------------------------------------------------------------------- /tests/testing_helpers_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(testing_helpers_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(testing_helpers_test "") 8 | 9 | target_include_directories(testing_helpers_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/testing_helpers_test 12 | ) 13 | 14 | set_target_properties( 15 | testing_helpers_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(testing_helpers_test 1) 25 | pico_enable_stdio_uart(testing_helpers_test 0) 26 | 27 | target_sources(testing_helpers_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/testing_helpers_test/testing_helpers_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | testing_helpers_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(testing_helpers_test) 40 | -------------------------------------------------------------------------------- /tests/testing_util_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(testing_util_test C CXX ASM) 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD 17) 6 | 7 | add_executable(testing_util_test "") 8 | 9 | target_include_directories(testing_util_test 10 | PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/testing_util_test 12 | ) 13 | 14 | set_target_properties( 15 | testing_util_test 16 | PROPERTIES 17 | COMPILE_FLAGS -Os 18 | COMPILE_FLAGS -fno-rtti 19 | COMPILE_FLAGS -fno-exceptions 20 | COMPILE_FLAGS -fno-threadsafe-statics 21 | COMPILE_FLAGS -nostdlib 22 | ) 23 | 24 | pico_enable_stdio_usb(testing_util_test 1) 25 | pico_enable_stdio_uart(testing_util_test 0) 26 | 27 | target_sources(testing_util_test 28 | PRIVATE 29 | ${CMAKE_CURRENT_LIST_DIR}/../../tests/testing_util_test/util_test.cpp 30 | 31 | ) 32 | 33 | target_link_libraries( 34 | testing_util_test 35 | pico-tflmicro 36 | pico-tflmicro_test 37 | ) 38 | 39 | pico_add_extra_outputs(testing_util_test) 40 | --------------------------------------------------------------------------------