Line data Source code
1 : /*
2 : * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
3 : * Description: ccu representation implementation file
4 : * Author: sunzhepeng
5 : * Create: 2024-06-17
6 : */
7 :
8 : #include "ccu_rep_v1.h"
9 :
10 : #include "string_util.h"
11 : #include "exception_util.h"
12 : #include "ccu_api_exception.h"
13 : #include "ccu_ins_generater_base.h"
14 : #include "ccu_kernel.h"
15 :
16 : namespace hcomm {
17 : namespace CcuRep {
18 :
19 : using namespace Hccl;
20 :
21 78 : CcuRepNop::CcuRepNop(CcuInsGeneraterBase* insGeneratorPtr) : insGeneratorPtr_(insGeneratorPtr)
22 : {
23 78 : type = CcuRepType::NOP;
24 78 : instrCount = 1;
25 78 : }
26 :
27 35 : bool CcuRepNop::Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
28 : {
29 35 : this->instrId = instrId;
30 35 : translated = true;
31 :
32 35 : CHK_RET_THROW(Hccl::CcuApiException,
33 : Hccl::StringFormat("[CcuRepNop][%s] failed to translate repNop for instrId[%u] ", __func__, instrId),
34 : insGeneratorPtr_->CcuRepNopTranslate(ccuKernel, instr, instrId, this, dep));
35 :
36 35 : instrId += instrCount;
37 :
38 35 : return translated;
39 : }
40 :
41 1 : std::string CcuRepNop::Describe()
42 : {
43 1 : return Hccl::StringFormat("Nop");
44 : }
45 :
46 : }; // namespace CcuRep
47 : }; // namespace hcomm
|