forked from ztxz16/fastllm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
executor.h
42 lines (28 loc) · 1.14 KB
/
executor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Created by huangyuyang on 6/13/23.
//
#ifndef FASTLLM_EXECUTOR_H
#define FASTLLM_EXECUTOR_H
#include "device.h"
namespace fastllm {
class Executor {
private:
std::vector <BaseDevice*> devices;
std::map <std::string, float> profiler;
public:
Executor (); // 创建默认的Executor
~Executor(); // 析构
void ClearDevices(); // 清空 devices
void AddDevice(BaseDevice *device); // 增加一个device
void SetFirstDevice(const std::string &device); // 设定优先的device
std::vector <int> GetDeviceIds(const std::string &device); // 获取指定device的deviceIds
bool CanRunOnFirstDevice(const std::string &opType, const fastllm::DataDict &datas, const fastllm::FloatDict &floatParams,
const fastllm::IntDict &intParams);
// 运行一个op
void Run(const std::string &opType, const fastllm::DataDict &datas, const fastllm::FloatDict &floatParams,
const fastllm::IntDict &intParams);
void ClearProfiler();
void PrintProfiler();
};
}
#endif //FASTLLM_EXECUTOR_H