MCPcopy Create free account
hub / github.com/MegEngine/MegCC / init_device

Function init_device

runtime/src/device.c:29–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29TinyNNStatus 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
45RuntimeOpt create_runtime_opt(Device* device) {
46 if (!device) {

Callers 3

SimpleVMMethod · 0.85
SimpleCombineModelMethod · 0.85
parse_modelFunction · 0.85

Calls

no outgoing calls

Tested by 2

SimpleVMMethod · 0.68
SimpleCombineModelMethod · 0.68