xref: /aosp_15_r20/external/executorch/backends/mediatek/runtime/include/NeuronPayloadHeader.h (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) 2024 MediaTek Inc.
3  *
4  * Licensed under the BSD License (the "License"); you may not use this file
5  * except in compliance with the License. See the license file in the root
6  * directory of this source tree for more details.
7  */
8 
9 #pragma once
10 
11 #include <cstdint>
12 
13 struct __attribute__((packed)) NeuronPayloadHeader {
14   unsigned char Version;
15 
16   uint32_t InputCount;
17 
18   uint32_t OutputCount;
19 
20   uint32_t DataLen;
21 };
22 
23 struct NeuronPayload {
NeuronPayloadNeuronPayload24   NeuronPayload(const void* payload, size_t size)
25       : Header(*(struct NeuronPayloadHeader*)payload),
26         CompiledNetwork((char*)payload + sizeof(struct NeuronPayloadHeader)) {}
27 
28   NeuronPayloadHeader Header;
29 
30   void* CompiledNetwork = nullptr;
31 };
32