| 27 | } |
| 28 | |
| 29 | TinyNNStatus init_device(Device* device) { |
| 30 | if (!device) { |
| 31 | return TinyNN_ERROR_NULL_PTR; |
| 32 | } |
| 33 | if (device->device_type == TinyNN_ARM64 || device->device_type == TinyNN_ARM32 || |
| 34 | device->device_type == TinyNN_BARE_METAL) { |
| 35 | device->alignment = CPU_ALIGNMENT; |
| 36 | device->malloc = cpu_aligned_malloc; |
| 37 | device->free = cpu_aligned_free; |
| 38 | } else { |
| 39 | LOG_ERROR("not support device.\n"); |
| 40 | return TinyNN_ERROR_NO_IMPLEMENT; |
| 41 | } |
| 42 | return TinyNN_SUCCESS; |
| 43 | } |
| 44 | |
| 45 | RuntimeOpt create_runtime_opt(Device* device) { |
| 46 | if (!device) { |
no outgoing calls