2019-04-17 10:49:11 +08:00
|
|
|
|
//
|
|
|
|
|
|
// CPURuntime.hpp
|
|
|
|
|
|
// MNN
|
|
|
|
|
|
//
|
|
|
|
|
|
// Created by MNN on 2018/08/31.
|
|
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
|
|
//
|
|
|
|
|
|
#ifndef CPURuntime_hpp
|
|
|
|
|
|
#define CPURuntime_hpp
|
|
|
|
|
|
|
2021-06-11 17:17:13 +08:00
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
#include "core/Macro.h"
|
2020-07-04 01:21:30 +08:00
|
|
|
|
struct cpuinfo_arm_isa {
|
2020-03-22 20:16:29 +08:00
|
|
|
|
bool fp16arith;
|
|
|
|
|
|
bool dot;
|
2022-10-30 08:44:24 +08:00
|
|
|
|
bool i8mm;
|
2020-03-22 20:16:29 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2019-04-17 10:49:11 +08:00
|
|
|
|
/*
|
|
|
|
|
|
CPU thread mode, only effective on HMP(Heterogeneous Multi-Processing)arch CPUs
|
|
|
|
|
|
that have ARM big.LITTLE technology and on Android
|
|
|
|
|
|
*/
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
/* Compliance with Operating System Scheduling */
|
|
|
|
|
|
MNN_CPU_MODE_DEFAULT = 0,
|
|
|
|
|
|
/* Bind threads to CPU IDs according to CPU frequency, but this mode is power-friendly */
|
|
|
|
|
|
MNN_CPU_MODE_POWER_FRI = 1,
|
|
|
|
|
|
/* Bind threads to little CPUs */
|
|
|
|
|
|
MNN_CPU_MODE_LITTLE = 2,
|
|
|
|
|
|
/* Bind threads to big CPUs */
|
|
|
|
|
|
MNN_CPU_MODE_BIG = 3
|
|
|
|
|
|
} MNNCPUThreadsMode;
|
|
|
|
|
|
int MNNSetCPUThreadsMode(MNNCPUThreadsMode mode);
|
|
|
|
|
|
|
2020-03-22 20:16:29 +08:00
|
|
|
|
float MNNGetCPUFlops(uint32_t number);
|
|
|
|
|
|
void cpuinfo_arm_init(struct cpuinfo_arm_isa* cpuinfo_isa);
|
|
|
|
|
|
|
2019-04-17 10:49:11 +08:00
|
|
|
|
#endif /* CPUInfo_hpp */
|