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