• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2024 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef MINDSPORE_CCSRC_BACKEND_COMMON_GRAPH_KERNEL_KERNEL_PACKET_KERNEL_PACKET_ENGINE_H_
17 #define MINDSPORE_CCSRC_BACKEND_COMMON_GRAPH_KERNEL_KERNEL_PACKET_KERNEL_PACKET_ENGINE_H_
18 
19 #include <string>
20 #include <memory>
21 #include "include/common/symbol_engine/symbol_engine_impl.h"
22 
23 namespace mindspore {
24 namespace graphkernel {
25 namespace packet {
26 using mindspore::symshape::SymbolEngineImpl;
27 
28 /// \brief SymbolEngine for kernel packet graph.
29 class KernelPacketEngine : public SymbolEngineImpl {
30  public:
31   using SymbolEngineImpl::SymbolEngineImpl;
32   ~KernelPacketEngine() = default;
MS_DECLARE_PARENT(KernelPacketEngine,SymbolEngineImpl)33   MS_DECLARE_PARENT(KernelPacketEngine, SymbolEngineImpl)
34 
35   std::string ToString() const override { return "KernelPacketEngine_" + name_; }
36   static std::shared_ptr<KernelPacketEngine> Build(const FuncGraphPtr &func_graph);
37 
38  protected:
39   void SetBaseNodeDepend(const CNodePtr &basenode);
40 };
41 }  // namespace packet
42 using KernelPacketEnginePtr = std::shared_ptr<packet::KernelPacketEngine>;
43 }  // namespace graphkernel
44 }  // namespace mindspore
45 #endif  // MINDSPORE_CCSRC_BACKEND_COMMON_GRAPH_KERNEL_KERNEL_PACKET_KERNEL_PACKET_ENGINE_H_
46