Browse Source

cleancode

pull/648/head
songmingyang 3 years ago
parent
commit
d15109756c
3 changed files with 6 additions and 12 deletions
  1. +2
    -2
      parser/common/pass_manager.cc
  2. +3
    -9
      parser/common/pass_manager.h
  3. +1
    -1
      parser/common/pre_checker.cc

+ 2
- 2
parser/common/pass_manager.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright 2020 Huawei Technologies Co., Ltd
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,11 +15,11 @@
*/

#include "common/util.h"
#include "parser/common/pass_manager.h"
#include "framework/omg/parser/parser_types.h"
#include "parser/common/acl_graph_parser_util.h"
#include "graph/utils/node_utils.h"
#include "omg/omg_inner_types.h"
#include "parser/common/pass_manager.h"

namespace ge {
namespace parser {


+ 3
- 9
parser/common/pass_manager.h View File

@@ -30,30 +30,24 @@ namespace parser {
///
class PassManager {
public:
///
/// get graph passes
/// @author
///
const std::vector<std::pair<std::string, GraphPass *>> &GraphPasses() const;

///
/// Add graph pass
/// @param [in] pass Pass to be added, it will be destroyed when pass manager destroys.
/// @author
///
Status AddPass(const string &pass_name, GraphPass *const pass);

///
/// Optimize graph with added pass
/// @param [inout] graph graph to be optimized
/// @return SUCCESS optimize successfully
/// @return NOT_CHANGED not optimized
/// @return others optimize failed
/// @author
///
Status Run(const ge::ComputeGraphPtr &graph);

///
/// Optimize graph with specified pass
/// @param [inout] graph graph to be optimized
/// @param [in] passes passes to be used
@@ -61,8 +55,8 @@ public:
/// @return NOT_CHANGED not optimized
/// @return others optimized failed
/// @author
///
static Status Run(const ge::ComputeGraphPtr &graph, std::vector<std::pair<std::string, GraphPass *>> &names_to_passes);
static Status Run(const ge::ComputeGraphPtr &graph,
std::vector<std::pair<std::string, GraphPass *>> &names_to_passes);

~PassManager();



+ 1
- 1
parser/common/pre_checker.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright 2020 Huawei Technologies Co., Ltd
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.


Loading…
Cancel
Save