model.h 745 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "../datatypes.h"
  3. #include "runtime_op.h"
  4. namespace nncase
  5. {
  6. namespace runtime
  7. {
  8. enum model_target : uint32_t
  9. {
  10. MODEL_TARGET_CPU = 0,
  11. MODEL_TARGET_K210 = 1,
  12. };
  13. struct model_header
  14. {
  15. uint32_t identifier;
  16. uint32_t version;
  17. uint32_t flags;
  18. model_target target;
  19. uint32_t constants;
  20. uint32_t main_mem;
  21. uint32_t nodes;
  22. uint32_t inputs;
  23. uint32_t outputs;
  24. uint32_t reserved0;
  25. };
  26. constexpr uint32_t MODEL_IDENTIFIER = 'KMDL';
  27. constexpr uint32_t MODEL_VERSION = 4;
  28. struct node_header
  29. {
  30. runtime_opcode opcode;
  31. uint32_t body_size;
  32. };
  33. }
  34. }