Directories | |
| Dsppp | |
The example implements the vector addition a + b * c using different memory allocators. In both tests, the vector loop is merging the add and multiply in the same vectorized loop. With Helium, a predicated loop is generated.
It is more efficient than using the C APIs of CMSIS-DSP : arm_add_f32 and arm_mult_f32. Use of the C API will require a temporary array and two loops. Each loop will contain only one arithmetic operation, two loads and a store and it is not efficient.
The fused operations generated by the C++ tewmplate only require one loop. No temporary array is required and the loop contains more arithmetic operations.
test1 is using the pool_allocator that can be used when the vector have size known at statically. To know how to dimension the memory pools, the stat_allocator can be temporarily used.
Change the memory allocator in Dsppp/Dsppp.cproject.yml. Define STAT_ALLOCATOR when the memory allocator is stat_allocator
test2 is using the arena_allocator on the vector but keep the TMP_ALLOC for use with temporary buffers. arena_allocator is used with dynamically sized vectors.