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 : #include "hcclCommProfilingLite.h"
12 : #include "dfx_profiling_reporter_lite.h"
13 : #include "log.h"
14 :
15 : namespace hccl {
16 32 : HcclCommProfilingLite::HcclCommProfilingLite(u32 deviceId) { (void)deviceId; }
17 :
18 32 : HcclCommProfilingLite::~HcclCommProfilingLite()
19 : {
20 32 : delete profilingReporterLite_;
21 32 : profilingReporterLite_ = nullptr;
22 32 : }
23 :
24 28 : HcclResult HcclCommProfilingLite::Init()
25 : {
26 28 : if (initializedFlag_) {
27 1 : return HCCL_SUCCESS;
28 : }
29 27 : CHK_RET(Hccl::DfxProfilingHandlerLite::GetInstance().Init());
30 27 : profilingReporterLite_ = new Hccl::DfxProfilingReporterLite(&Hccl::DfxProfilingHandlerLite::GetInstance());
31 27 : CHK_RET(profilingReporterLite_->Init());
32 27 : initializedFlag_ = true;
33 27 : return HCCL_SUCCESS;
34 : }
35 :
36 2 : void HcclCommProfilingLite::ReportAllTasks(const std::vector<hccl::Thread*>& threads)
37 : {
38 2 : profilingReporterLite_->ReportAllTasks(threads);
39 2 : }
40 :
41 0 : void HcclCommProfilingLite::ReportStreamTask(Hccl::TaskInfoCircularQueue* taskQueue)
42 : {
43 0 : profilingReporterLite_->ReportStreamTask(taskQueue);
44 0 : }
45 :
46 1 : void HcclCommProfilingLite::UpdateProfStat() { profilingReporterLite_->UpdateProfStat(); }
47 : } // namespace hccl
|