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 :
11 : #ifndef HCCL_DFX_COMMON_H
12 : #define HCCL_DFX_COMMON_H
13 :
14 : #include "hccl/base.h"
15 : #include "circular_queue.h"
16 : #include "vector_queue.h"
17 : #include "queue.h"
18 : #include "task_info.h"
19 :
20 : namespace Hccl {
21 : constexpr u32 DEVICE_MAX_NUM = 32;
22 : constexpr u32 MAX_CIRCULAR_QUEUE_LENGTH = 2048;
23 : // aicpu先生成sqe并储存到dfx队列,后下发到rtsq(最多缓存128个sqe),为避免还未下发到rtsq的sqe覆盖dfx队列里对应rtsq队列的sqe数据,延长dfx队列128个sqe
24 : constexpr u32 MAX_AICPU_CIRCULAR_QUEUE_LENGTH = 2048 + 128;
25 :
26 75 : MAKE_ENUM(QueueType, Circular_Queue, Vector_Queue)
27 :
28 : using TaskInfoQueue = Queue<std::unique_ptr<TaskInfo>>;
29 : using TaskInfoQueueMap = std::unordered_map<u32, std::unique_ptr<TaskInfoQueue>>;
30 :
31 : } // namespace Hccl
32 :
33 : #endif // HCCL_DFX_COMMON_H
|