• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2021 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 
17 #ifndef MINDSPORE_CCSRC_RUNTIME_FRAMEWORK_ACTOR_DEBUG_AWARE_ACTOR_H_
18 #define MINDSPORE_CCSRC_RUNTIME_FRAMEWORK_ACTOR_DEBUG_AWARE_ACTOR_H_
19 
20 #include <string>
21 #include "runtime/framework/actor/memory_aware_actor.h"
22 
23 namespace mindspore {
24 namespace runtime {
25 // The actor represents a set of common debug related operations of actor.
26 class DebugAwareActor : public MemoryAwareActor {
27  public:
DebugAwareActor(const std::string & name,KernelTransformType type,const AID * recorder_aid,const AID & memory_manager_aid,const AID * debug_aid)28   explicit DebugAwareActor(const std::string &name, KernelTransformType type, const AID *recorder_aid,
29                            const AID &memory_manager_aid, const AID *debug_aid)
30       : MemoryAwareActor(name, type, recorder_aid, memory_manager_aid), debug_aid_(debug_aid) {}
31   virtual ~DebugAwareActor() = default;
32 
SendDebugReq(OpContext<DeviceTensor> * const context)33   virtual void SendDebugReq(OpContext<DeviceTensor> *const context) {}
OnDebugFinish(OpContext<DeviceTensor> * const context)34   virtual void OnDebugFinish(OpContext<DeviceTensor> *const context) {}
35 
36  protected:
37   // The id of debug actor. Send message to it for debug.
38   const AID *debug_aid_;
39 };
40 }  // namespace runtime
41 }  // namespace mindspore
42 
43 #endif  // MINDSPORE_CCSRC_RUNTIME_FRAMEWORK_ACTOR_DEBUG_AWARE_ACTOR_H_
44