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