MNN/source/backend/cpu/CPURuntime.hpp

35 lines
713 B
C++
Raw Permalink Normal View History

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
#include <stdint.h>
2024-07-22 19:51:53 +08:00
#include <vector>
#include "core/Macro.h"
2024-07-22 19:51:53 +08:00
struct CPUGroup {
uint32_t minFreq;
uint32_t maxFreq;
std::vector<int> ids;
};
struct MNNCPUInfo {
bool fp16arith;
bool dot;
2022-10-30 08:44:24 +08:00
bool i8mm;
2024-07-22 19:51:53 +08:00
bool sve2;
bool sme2;
2024-07-22 19:51:53 +08:00
std::vector<CPUGroup> groups;
int cpuNumber = 0;
};
using cpu_mask_t = unsigned long;
2024-07-22 19:51:53 +08:00
int MNNSetSchedAffinity(const int* cpuIDs, int size);
int MNNGetCurrentPid();
cpu_mask_t MNNGetCPUMask(const std::vector<int>& cpuIds);
2024-07-22 19:51:53 +08:00
const MNNCPUInfo* MNNGetCPUInfo();
2019-04-17 10:49:11 +08:00
#endif /* CPUInfo_hpp */