Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 : #ifndef MC2_GLOBAL_MIRROR_TASKS_H
11 : #define MC2_GLOBAL_MIRROR_TASKS_H
12 :
13 : #include <array>
14 : #include <vector>
15 : #include <memory>
16 : #include "dfx_common.h"
17 : #include "task_info.h"
18 :
19 : namespace Hccl {
20 :
21 : class MC2GlobalMirrorTasks {
22 : public:
23 : static MC2GlobalMirrorTasks &GetInstance();
24 :
25 : void Clear();
26 : void AddTaskInfo(u32 devLogicId, std::shared_ptr<TaskInfo> taskInfo);
27 : std::shared_ptr<TaskInfo> GetTaskInfo(u32 devLogicId, u8 dieId, u8 missionId, u32 instrId) const;
28 :
29 : private:
30 1 : MC2GlobalMirrorTasks() = default;
31 1 : ~MC2GlobalMirrorTasks() = default;
32 : MC2GlobalMirrorTasks(const MC2GlobalMirrorTasks &) = delete;
33 : MC2GlobalMirrorTasks &operator=(const MC2GlobalMirrorTasks &) = delete;
34 :
35 : private:
36 : std::array<std::vector<std::shared_ptr<TaskInfo>>, DEVICE_MAX_NUM> taskQueues_;
37 : };
38 :
39 : } // namespace Hccl
40 :
41 : #endif //MC2_GLOBAL_MIRROR_TASKS_H
|