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 HCCLV2_STREAM_LITE_H
11 : #define HCCLV2_STREAM_LITE_H
12 : #include <vector>
13 : #include <string>
14 : #include <memory>
15 : #include "types.h"
16 : #include "rtsq_base.h"
17 : namespace Hccl {
18 :
19 : class StreamLite {
20 : public:
21 : explicit StreamLite(std::vector<char> &uniqueId);
22 : StreamLite(u32 id, u32 sqIds, u32 phyId, u32 cqIds);
23 : StreamLite(u32 id, u32 sqIds, u32 phyId, u32 cqIds, bool launchFlag);
24 :
25 58 : inline u32 GetId() const
26 : {
27 58 : return id;
28 : }
29 :
30 120 : inline u32 GetSqId() const
31 : {
32 120 : return sqId;
33 : }
34 :
35 0 : inline u32 GetCqId() const
36 : {
37 0 : return cqId;
38 : }
39 :
40 2 : inline u32 GetDevPhyId() const
41 : {
42 2 : return devPhyId;
43 : }
44 :
45 : RtsqBase *GetRtsq() const;
46 :
47 : std::string Describe() const;
48 :
49 : private:
50 : u32 id;
51 : u32 sqId;
52 : u32 devPhyId{0};
53 : u32 cqId{0};
54 :
55 : std::unique_ptr<RtsqBase> rtsq;
56 : };
57 :
58 : } // namespace Hccl
59 :
60 : #endif
|