#include "RTE_Components.h"
#include CMSIS_device_header
#include <cstdio>
#include <cstdlib>
#include "allocators.hpp"
#include "init_data.hpp"
void test1() {
constexpr int NB = 64;
std::cout << "Result = " << d;
}
void test2() {
constexpr int NB = 64;
constexpr std::size_t ARENA_SIZE = 1024;
ARENA_SIZE, 64);
create_arena(arena_ptr, ARENA_SIZE);
ArenaVector a(NB);
ArenaVector b(NB);
ArenaVector c(NB);
init_vectors(NB,a.ptr(),b.ptr(),c.ptr());
ArenaVector d = a + b * c;
std::cout << "Result = " << d;
std::size_t offset = get_arena_offset();
std::cout << "Arena offset after computation: " << offset << "\r\n";
reset_arena();
free(arena_ptr);
}
int main() {
setvbuf(stdout, NULL, _IONBF, 0);
printf("CMSIS-DSPP C++ examples\n");
#if defined(STAT_ALLOCATOR)
reset_current_stats();
#endif
std::cout << "Test 1" << std::endl;
test1();
#if defined(STAT_ALLOCATOR)
print_map("Memory allocation statistics");
check_current_stats();
#endif
std::cout << "Test 2" << std::endl;
test2();
error:
exit(0);
}