diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc index f542cdd4e4..291f0316d4 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc @@ -498,13 +498,13 @@ Status BatchOp::UnpackPadInfo(const PadInfo &pad_info, } // Visitor accept method for NodePass -Status BatchOp::Accept(NodePass *p, bool *modified) { +Status BatchOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } // Visitor pre-accept method for NodePass -Status BatchOp::PreAccept(NodePass *p, bool *modified) { +Status BatchOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.h index b1c39ed194..baae2a384e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.h @@ -197,13 +197,13 @@ class BatchOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Base-class override for NodePass visitor acceptor. // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.cc index 7631294372..ce328efcb1 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.cc @@ -161,7 +161,7 @@ void BuildSentencePieceVocabOp::Next(std::string *sentence) { } // Pre-Visitor accept method for NodePass -Status BuildSentencePieceVocabOp::PreAccept(NodePass *p, bool *modified) { +Status BuildSentencePieceVocabOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.h index 49f3bcc39f..0ff81b9b9f 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.h @@ -169,7 +169,7 @@ class BuildSentencePieceVocabOp : public PipelineOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; private: bool read_done_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.cc index 17369e5160..f5b18c8f7c 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.cc @@ -231,7 +231,7 @@ void BuildVocabOp::Print(std::ostream &out, bool show_all) const { } // Pre-Visitor accept method for NodePass -Status BuildVocabOp::PreAccept(NodePass *p, bool *modified) { +Status BuildVocabOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.h index f6bdeb2977..757a1d12cb 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.h @@ -172,7 +172,7 @@ class BuildVocabOp : public ParallelOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; private: const int32_t interval_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.cc index 43bb3a9386..658a590267 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.cc @@ -135,7 +135,7 @@ Status CacheLookupOp::ComputeColMap() { } // Visitor accept method for NodePass -Status CacheLookupOp::Accept(NodePass *p, bool *modified) { +Status CacheLookupOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.h index 832e565c53..9905419047 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.h @@ -107,7 +107,7 @@ class CacheLookupOp : public CacheBase, public SamplerRT { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; protected: Status ComputeColMap() override; diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.cc index 87c37e9a4e..a9d1dcec41 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.cc @@ -263,13 +263,13 @@ Status CacheMergeOp::Builder::Build(std::shared_ptr *ptr) { } // Pre-Visitor accept method for NodePass -Status CacheMergeOp::PreAccept(NodePass *p, bool *modified) { +Status CacheMergeOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->PreRunOnNode(shared_from_base(), modified); } // Visitor accept method for NodePass -Status CacheMergeOp::Accept(NodePass *p, bool *modified) { +Status CacheMergeOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.h index 99bed7dae8..f3dc3a0190 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.h @@ -174,13 +174,13 @@ class CacheMergeOp : public ParallelOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass visitor acceptor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; /// \brief Base-class override for eoe handling /// \param worker_id diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.cc index f2ded2d55d..25a8c34de7 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.cc @@ -226,13 +226,13 @@ Status CacheOp::EofReceived(int32_t worker_id) { } // Pre-Visitor accept method for NodePass -Status CacheOp::PreAccept(NodePass *p, bool *modified) { +Status CacheOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->PreRunOnNode(shared_from_base(), modified); } // Visitor accept method for NodePass -Status CacheOp::Accept(NodePass *p, bool *modified) { +Status CacheOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.h index a3984bc4d8..26cce24496 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.h @@ -125,12 +125,12 @@ class CacheOp : public CacheBase, public RandomAccessOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass visitor acceptor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; /// \brief Base-class override for handling cases when an eof is received. /// \param worker_id - The worker id /// \return Status The status code returned diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.cc index a8e09514a3..9284346147 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.cc @@ -191,7 +191,7 @@ Status ConcatOp::ComputeColMap() { } // Visitor pre-accept method for NodePass -Status ConcatOp::PreAccept(NodePass *p, bool *modified) { +Status ConcatOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.h index ba2b1bedb7..79a24746b4 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.h @@ -109,7 +109,7 @@ class ConcatOp : public PipelineOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Gets the number of classes /// \param[out] num_classes the number of classes diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc index c1b42bf935..68f194d346 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc @@ -402,13 +402,13 @@ Status DatasetOp::ComputeColMap() { return Status::OK(); } -Status DatasetOp::PreAccept(NodePass *p, bool *modified) { +Status DatasetOp::PreAccept(NodePass *p, bool *const modified) { // DatasetOp is the base class of visitor target pre-visit. // This method will only be called if its derived class does not implement one. return p->PreRunOnNode(shared_from_this(), modified); } -Status DatasetOp::Accept(NodePass *p, bool *modified) { +Status DatasetOp::Accept(NodePass *p, bool *const modified) { // DatasetOp is the base class of visitor target. // This method will only be called if its derived class does not implement one. return p->RunOnNode(shared_from_this(), modified); diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.h index 811cb7ff08..bf754e352e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.h @@ -326,14 +326,14 @@ class DatasetOp : public std::enable_shared_from_this { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - virtual Status PreAccept(NodePass *p, bool *modified); + virtual Status PreAccept(NodePass *p, bool *const modified); /// \brief Base method for NodePass visit. Subclass needs to override this if it requires special node visit access. /// Check "dataset/engine/opt/pass.h" for more details. /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - virtual Status Accept(NodePass *p, bool *modified); + virtual Status Accept(NodePass *p, bool *const modified); /// Op name getter /// \return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc index d553eda16a..3b89a64e55 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc @@ -503,7 +503,7 @@ void DeviceQueueOp::Print(std::ostream &out, bool show_all) const { } // Visitor accept method for NodePass -Status DeviceQueueOp::Accept(NodePass *p, bool *modified) { +Status DeviceQueueOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.h index 846d03c396..1905b62711 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.h @@ -171,7 +171,7 @@ class DeviceQueueOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc index ab3ce93f48..4a59ecfdff 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc @@ -105,13 +105,13 @@ Status EpochCtrlOp::EoeReceived(int32_t worker_id) { } // Pre-Visitor accept method for NodePass -Status EpochCtrlOp::PreAccept(NodePass *p, bool *modified) { +Status EpochCtrlOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->PreRunOnNode(shared_from_base(), modified); } // Visitor accept method for NodePass -Status EpochCtrlOp::Accept(NodePass *p, bool *modified) { +Status EpochCtrlOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.h index 36ce8f2039..9605658cdf 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.h @@ -69,13 +69,13 @@ class EpochCtrlOp : public RepeatOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass visitor acceptor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; int64_t GetTreeRepeatCount() override; }; diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc index 81722d5a76..3bd7d13b42 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc @@ -248,13 +248,13 @@ Status FilterOp::InvokePredicateFunc(const TensorRow &input, bool *out_predicate } // Visitor accept method for NodePass -Status FilterOp::Accept(NodePass *p, bool *modified) { +Status FilterOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } // Visitor pre-accept method for NodePass -Status FilterOp::PreAccept(NodePass *p, bool *modified) { +Status FilterOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.h index 906e8a8013..89063f3198 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.h @@ -125,13 +125,13 @@ class FilterOp : public ParallelOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; // Base-class override for NodePass visitor acceptor. // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc index 13c9fa2e2c..2ae4204086 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc @@ -438,13 +438,13 @@ void MapOp::CreateFinalColMap(std::unordered_map *col_name } // Visitor accept method for NodePass -Status MapOp::Accept(NodePass *p, bool *modified) { +Status MapOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } // Visitor pre-accept method for NodePass -Status MapOp::PreAccept(NodePass *p, bool *modified) { +Status MapOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.h index 7620dbb854..80d1069adf 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.h @@ -181,13 +181,13 @@ class MapOp : public ParallelOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass visitor acceptor. /// \param[in] p Pointer to the NodePass to be accepted. /// \param[out] modified Whether this node visit modified the pipeline. /// \return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc index 393af17f4b..b149cd363a 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc @@ -130,7 +130,7 @@ Status ProjectOp::EoeReceived(int32_t worker_id) { Status ProjectOp::EofReceived(int32_t worker_id) { return Status::OK(); } // Visitor accept method for NodePass -Status ProjectOp::Accept(NodePass *p, bool *modified) { +Status ProjectOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.h index 38b6693a4b..f74957a13d 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.h @@ -105,7 +105,7 @@ class ProjectOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc index da8597c683..32dc2cf1c5 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc @@ -172,7 +172,7 @@ Status RenameOp::EoeReceived(int32_t) { } // Visitor accept method for NodePass -Status RenameOp::Accept(NodePass *p, bool *modified) { +Status RenameOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.h index d4cae49dfe..af628c1c9e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.h @@ -114,7 +114,7 @@ class RenameOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc index aef81e5526..95a858d8d6 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc @@ -176,13 +176,13 @@ int32_t RepeatOp::num_producers() const { } // Pre-Visitor accept method for NodePass -Status RepeatOp::PreAccept(NodePass *p, bool *modified) { +Status RepeatOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call the pre-visitation return p->PreRunOnNode(shared_from_base(), modified); } // Visitor accept method for NodePass -Status RepeatOp::Accept(NodePass *p, bool *modified) { +Status RepeatOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.h index 30ed4af0b7..f2fdf98cea 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.h @@ -113,13 +113,13 @@ class RepeatOp : public PipelineOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass visitor acceptor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc index e3139f5680..b4637faf5e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc @@ -293,7 +293,7 @@ Status ShuffleOp::EoeReceived(int32_t worker_id) { } // Visitor accept method for NodePass -Status ShuffleOp::Accept(NodePass *p, bool *modified) { +Status ShuffleOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.h index 320a0d00eb..58f4b6ea46 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.h @@ -159,7 +159,7 @@ class ShuffleOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc index a1986c700a..609b581926 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc @@ -125,13 +125,13 @@ Status SkipOp::EofReceived(int32_t worker_id) { } // Visitor accept method for NodePass -Status SkipOp::Accept(NodePass *p, bool *modified) { +Status SkipOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } // Visitor pre-accept method for NodePass -Status SkipOp::PreAccept(NodePass *p, bool *modified) { +Status SkipOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.h index 75c684a5b8..a8818bb486 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.h @@ -78,13 +78,13 @@ class SkipOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass pre-visit acceptor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.cc index 16ad2ca4c1..5d1a08e37f 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.cc @@ -592,7 +592,7 @@ Status AlbumOp::LaunchThreadsAndInitOp() { } // Visitor accept method for NodePass -Status AlbumOp::Accept(NodePass *p, bool *modified) { +Status AlbumOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.h index ba9346eaaa..46aece4f42 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.h @@ -196,7 +196,7 @@ class AlbumOp : public ParallelOp, public RandomAccessOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.cc index b4b6e58cf7..e5ab0472af 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.cc @@ -435,7 +435,7 @@ Status CelebAOp::Reset() { } // Visitor accept method for NodePass -Status CelebAOp::Accept(NodePass *p, bool *modified) { +Status CelebAOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.h index 36382b3d7b..9d4e31d7c4 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/celeba_op.h @@ -173,7 +173,7 @@ class CelebAOp : public ParallelOp, RandomAccessOp { /// \param[in] p Pointer to the NodePass to be accepted /// \param[out] modified Indicator if the node was changed at all /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.cc index aabf6da55e..b260f2781f 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.cc @@ -491,7 +491,7 @@ Status CifarOp::CountTotalRows(const std::string &dir, const std::string &usage, } // Visitor accept method for NodePass -Status CifarOp::Accept(NodePass *p, bool *modified) { +Status CifarOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.h index f117cf7918..484f93409f 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/cifar_op.h @@ -169,7 +169,7 @@ class CifarOp : public ParallelOp, public RandomAccessOp { /// \param[in] p Pointer to the NodePass to be accepted /// \param[out] modified Indicator if the node was changed at all /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.cc index bc2c1c67ba..a5de9f4a4d 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.cc @@ -560,7 +560,7 @@ void ClueOp::MakeSimpleProducer() { } // Visitor accept method for NodePass -Status ClueOp::Accept(NodePass *p, bool *modified) { +Status ClueOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.h index 993b549103..048db62ad1 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/clue_op.h @@ -195,7 +195,7 @@ class ClueOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; private: // The entry point for when workers are launched. diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.cc index 0fe0adf64b..6276935996 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.cc @@ -664,7 +664,7 @@ Status CocoOp::GetClassIndexing(const std::string &dir, const std::string &file, } // Visitor accept method for NodePass -Status CocoOp::Accept(NodePass *p, bool *modified) { +Status CocoOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.h index 94d976ec8b..808823721b 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/coco_op.h @@ -207,7 +207,7 @@ class CocoOp : public ParallelOp, public RandomAccessOp { /// \param[in] p Pointer to the NodePass to be accepted /// \param[out] modified Indicator if the node was changed at all /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc index c5bd29cb27..45c3f32276 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc @@ -911,7 +911,7 @@ void CsvOp::MakeSimpleProducer() { } // Visitor accept method for NodePass -Status CsvOp::Accept(NodePass *p, bool *modified) { +Status CsvOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.h index a6075a196a..02a857dcc5 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.h @@ -316,7 +316,7 @@ class CsvOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; private: // The entry point for when workers are launched. diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.cc index 4bf2205744..fa31f09156 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.cc @@ -258,7 +258,7 @@ Status GeneratorOp::Reset() { } // Visitor accept method for NodePass -Status GeneratorOp::Accept(NodePass *p, bool *modified) { +Status GeneratorOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.h index 2472f90447..609bf62a5c 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/generator_op.h @@ -128,7 +128,7 @@ class GeneratorOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.cc index 7f72ce3dce..dca8cc099e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.cc @@ -449,7 +449,7 @@ Status ImageFolderOp::CountRowsAndClasses(const std::string &path, const std::se } // Visitor accept method for NodePass -Status ImageFolderOp::Accept(NodePass *p, bool *modified) { +Status ImageFolderOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.h index 586b799902..0b91ad68d3 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/image_folder_op.h @@ -211,7 +211,7 @@ class ImageFolderOp : public ParallelOp, public RandomAccessOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.cc index 722e9124d9..b8d276eea6 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.cc @@ -436,7 +436,7 @@ Status ManifestOp::GetClassIndexing(const std::string &file, const py::dict &dic #endif // Visitor accept method for NodePass -Status ManifestOp::Accept(NodePass *p, bool *modified) { +Status ManifestOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.h index 80030366ca..0a1d4b386e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/manifest_op.h @@ -184,7 +184,7 @@ class ManifestOp : public ParallelOp, public RandomAccessOp { /// \param[in] p Pointer to the NodePass to be accepted /// \param[out] modified Indicator if the node was changed at all /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.cc index 520d69c07b..515647a65d 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.cc @@ -458,7 +458,7 @@ Status MindRecordOp::CountTotalRows(const std::vector dataset_path, } // Visitor accept method for NodePass -Status MindRecordOp::Accept(NodePass *p, bool *modified) { +Status MindRecordOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.h index ca0288d991..038e7dd496 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.h @@ -206,7 +206,7 @@ class MindRecordOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.cc index ee73e81506..c63612cfac 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.cc @@ -454,7 +454,7 @@ Status MnistOp::CountTotalRows(const std::string &dir, const std::string &usage, } // Visitor accept method for NodePass -Status MnistOp::Accept(NodePass *p, bool *modified) { +Status MnistOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.h index 41865e2f19..1f4a4cb51c 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mnist_op.h @@ -162,7 +162,7 @@ class MnistOp : public ParallelOp, public RandomAccessOp { /// \param[in] p Pointer to the NodePass to be accepted /// \param[out] modified Indicator if the node was changed at all /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc index b3d8e15c56..0ec94b5c89 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc @@ -410,7 +410,7 @@ Status RandomDataOp::Reset() { } // Visitor accept method for NodePass -Status RandomDataOp::Accept(NodePass *p, bool *modified) { +Status RandomDataOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.h index 7d48cdfee3..39fbb70113 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.h @@ -263,7 +263,7 @@ class RandomDataOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Private function for computing the assignment of the column name map. // @return - Status diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.cc index 818e485ba6..8065809022 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.cc @@ -515,7 +515,7 @@ void TextFileOp::MakeSimpleProducer() { } // Visitor accept method for NodePass -Status TextFileOp::Accept(NodePass *p, bool *modified) { +Status TextFileOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.h index 3891ebc415..b60ac40900 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/text_file_op.h @@ -196,7 +196,7 @@ class TextFileOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; private: // The entry point for when workers are launched. diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.cc index d1c5037be9..181997a0d1 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.cc @@ -1024,7 +1024,7 @@ int64_t TFReaderOp::CountTotalRowsSectioned(const std::vector &file } // Visitor accept method for NodePass -Status TFReaderOp::Accept(NodePass *p, bool *modified) { +Status TFReaderOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.h index 08cdfd88f3..6fdabf069e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.h @@ -236,7 +236,7 @@ class TFReaderOp : public ParallelOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.cc index b5db193f1d..68468f7150 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.cc @@ -493,7 +493,7 @@ Status VOCOp::GetClassIndexing(const std::string &dir, const std::string &task_t #endif // Visitor accept method for NodePass -Status VOCOp::Accept(NodePass *p, bool *modified) { +Status VOCOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.h index dd95d71989..f1e5b9fdcb 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/voc_op.h @@ -210,7 +210,7 @@ class VOCOp : public ParallelOp, public RandomAccessOp { /// \param[in] p Pointer to the NodePass to be accepted /// \param[out] modified Indicator if the node was changed at all /// \return Status of the node visit - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.cc index b64f3b3357..aecd7658dc 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.cc @@ -128,13 +128,13 @@ Status TakeOp::FillBuffer(std::unique_ptr *buffer, std::unique_ptrRunOnNode(shared_from_base(), modified); } // Visitor pre-accept method for NodePass -Status TakeOp::PreAccept(NodePass *p, bool *modified) { +Status TakeOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.h index 5160e74fc4..149cde80e3 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.h @@ -82,13 +82,13 @@ class TakeOp : public PipelineOp { // @param p - Pointer to the NodePass to be accepted. // @param modified - Whether this node visit modified the pipeline. // @return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass pre-visit acceptor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc index d8822cef5e..6c500543f6 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc @@ -237,13 +237,13 @@ Status ZipOp::EoeReceived(int32_t) { } // Visitor pre-accept method for NodePass -Status ZipOp::PreAccept(NodePass *p, bool *modified) { +Status ZipOp::PreAccept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->PreRunOnNode(shared_from_base(), modified); } // Visitor accept method for NodePass -Status ZipOp::Accept(NodePass *p, bool *modified) { +Status ZipOp::Accept(NodePass *p, bool *const modified) { // Downcast shared pointer then call visitor return p->RunOnNode(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.h b/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.h index aa9a766421..1ef13ac4d0 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.h +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.h @@ -108,13 +108,13 @@ class ZipOp : public PipelineOp { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status PreAccept(NodePass *p, bool *modified) override; + Status PreAccept(NodePass *p, bool *const modified) override; /// \brief Base-class override for NodePass visitor acceptor. /// \param[in] p Pointer to the NodePass to be accepted. /// \param[out] modified Whether this node visit modified the pipeline. /// \return - Status of the node visit. - Status Accept(NodePass *p, bool *modified) override; + Status Accept(NodePass *p, bool *const modified) override; // Op name getter // @return Name of the current Op diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.cc index ca7cd1d0cf..0cdcdaeadf 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.cc @@ -142,13 +142,13 @@ Status BatchNode::GetDatasetSize(const std::shared_ptr &size_ } // Visitor accepting method for IRNodePass -Status BatchNode::Accept(IRNodePass *const p, bool *modified) { +Status BatchNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status BatchNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status BatchNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.h index b3f9613b2b..83d0c4b28e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/batch_node.h @@ -79,13 +79,13 @@ class BatchNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: int32_t batch_size_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.cc index c1ff38d9b0..6677ec8bde 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.cc @@ -92,13 +92,13 @@ Status BuildSentenceVocabNode::ValidateParams() { } // Visitor accepting method for IRNodePass -Status BuildSentenceVocabNode::Accept(IRNodePass *const p, bool *modified) { +Status BuildSentenceVocabNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status BuildSentenceVocabNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status BuildSentenceVocabNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.h index 3904b6cbb9..3fb85c92f1 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.h @@ -63,13 +63,13 @@ class BuildSentenceVocabNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: std::shared_ptr vocab_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.cc index bb0b80bd0a..7886a0b1b4 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.cc @@ -87,13 +87,13 @@ Status BuildVocabNode::ValidateParams() { } // Visitor accepting method for IRNodePass -Status BuildVocabNode::Accept(IRNodePass *const p, bool *modified) { +Status BuildVocabNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status BuildVocabNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status BuildVocabNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.h index 62e1eaff3b..d39ce4c84b 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_vocab_node.h @@ -62,13 +62,13 @@ class BuildVocabNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: std::shared_ptr vocab_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.cc index 2349312f5d..b8d46dcf54 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.cc @@ -84,13 +84,13 @@ Status ConcatNode::Build(std::vector> *const node_ops } // Visitor accepting method for IRNodePass -Status ConcatNode::Accept(IRNodePass *const p, bool *modified) { +Status ConcatNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status ConcatNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status ConcatNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.h index 5d5f2239dd..45d238ad11 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/concat_node.h @@ -70,13 +70,13 @@ class ConcatNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; }; } // namespace dataset diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.cc index 78e298a8ff..20083280cf 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.cc @@ -376,14 +376,14 @@ Status DatasetNode::Remove() { } // In DFS tree traversal, each node is visited twice. Accept is called on the first visit. -Status DatasetNode::Accept(IRNodePass *const p, bool *modified) { +Status DatasetNode::Accept(IRNodePass *const p, bool *const modified) { // This method will only be called if its derived class does not implement one. return p->Visit(shared_from_this(), modified); } // In DFS tree traversal, each node is visited twice. AcceptAfter is called on the second visit // after all child nodes are visited. -Status DatasetNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status DatasetNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // This method will only be called if its derived class does not implement one. return p->VisitAfter(shared_from_this(), modified); } @@ -431,11 +431,11 @@ Status DatasetNode::ValidateParams() { return Status::OK(); } -Status MappableSourceNode::Accept(IRNodePass *const p, bool *modified) { +Status MappableSourceNode::Accept(IRNodePass *const p, bool *const modified) { return p->Visit(shared_from_base(), modified); } -Status NonMappableSourceNode::Accept(IRNodePass *const p, bool *modified) { +Status NonMappableSourceNode::Accept(IRNodePass *const p, bool *const modified) { return p->Visit(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.h index 8720b557e9..bdb3c5c320 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/dataset_node.h @@ -246,7 +246,7 @@ class DatasetNode : public std::enable_shared_from_this { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - virtual Status Accept(IRNodePass *p, bool *modified); + virtual Status Accept(IRNodePass *const p, bool *const modified); /// \brief Base method for IRNodePass visit on the way back up the tree after its descendants are visited. /// \notes Subclass needs to override this if it requires special node visit access. @@ -254,7 +254,7 @@ class DatasetNode : public std::enable_shared_from_this { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - virtual Status AcceptAfter(IRNodePass *p, bool *modified); + virtual Status AcceptAfter(IRNodePass *const p, bool *const modified); virtual bool IsSizeDefined() { return true; } @@ -289,7 +289,7 @@ class MappableSourceNode : public DatasetNode { descendant_of_cache_ = false; } - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Destructor ~MappableSourceNode() = default; @@ -313,7 +313,7 @@ class NonMappableSourceNode : public DatasetNode { descendant_of_cache_ = false; } - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Destructor ~NonMappableSourceNode() = default; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.cc index 9355b0b1cf..ea996a003c 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.cc @@ -62,13 +62,13 @@ Status FilterNode::ValidateParams() { } // Visitor accepting method for IRNodePass -Status FilterNode::Accept(IRNodePass *const p, bool *modified) { +Status FilterNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status FilterNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status FilterNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.h index 68e3c45df0..0eae36668f 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/filter_node.h @@ -62,13 +62,13 @@ class FilterNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: std::shared_ptr predicate_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.cc index 00e81ea395..1ac0c613a0 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.cc @@ -107,13 +107,13 @@ Status MapNode::ValidateParams() { } // Visitor accepting method for IRNodePass -Status MapNode::Accept(IRNodePass *const p, bool *modified) { +Status MapNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status MapNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status MapNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.h index b3ce43e2ce..2ab22a4c45 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/map_node.h @@ -66,13 +66,13 @@ class MapNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; /// \brief clear all callbacks void ClearCallbacks() { callbacks_.clear(); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.cc index 1825b8b968..d627bb22db 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.cc @@ -72,13 +72,13 @@ Status RepeatNode::GetDatasetSize(const std::shared_ptr &size } // Visitor accepting method for IRNodePass -Status RepeatNode::Accept(IRNodePass *const p, bool *modified) { +Status RepeatNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status RepeatNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status RepeatNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.h index e5eeb173b0..bd8d8d6e9b 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/repeat_node.h @@ -74,13 +74,13 @@ class RepeatNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: int32_t repeat_count_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.cc index 4e29b455e0..7a7eebb390 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.cc @@ -76,13 +76,13 @@ Status RootNode::ValidateParams() { } // Visitor accepting method for IRNodePass -Status RootNode::Accept(IRNodePass *const p, bool *modified) { +Status RootNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status RootNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status RootNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.h index 932c5439c6..66cc26b9d8 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/root_node.h @@ -68,13 +68,13 @@ class RootNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: int32_t num_epochs_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.cc index 13042e8e93..9abcbeb9e6 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.cc @@ -73,13 +73,13 @@ Status SkipNode::GetDatasetSize(const std::shared_ptr &size_g } // Visitor accepting method for IRNodePass -Status SkipNode::Accept(IRNodePass *const p, bool *modified) { +Status SkipNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status SkipNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status SkipNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.h index 61a8db37f9..323b50275d 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/skip_node.h @@ -72,13 +72,13 @@ class SkipNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: int32_t skip_count_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.cc index c270847900..efb14b1fda 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.cc @@ -71,13 +71,13 @@ Status TakeNode::GetDatasetSize(const std::shared_ptr &size_g } // Visitor accepting method for IRNodePass -Status TakeNode::Accept(IRNodePass *const p, bool *modified) { +Status TakeNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status TakeNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status TakeNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.h index 9760558c36..3446b73337 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/take_node.h @@ -72,13 +72,13 @@ class TakeNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: int32_t take_count_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc index c9d4f7c706..a9098a9a92 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc @@ -106,13 +106,13 @@ Status TransferNode::Build(std::vector> *const node_o } // Visitor accepting method for IRNodePass -Status TransferNode::Accept(IRNodePass *const p, bool *modified) { +Status TransferNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status TransferNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status TransferNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.h index 603333f16e..e2154c98a5 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.h @@ -62,13 +62,13 @@ class TransferNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: std::string queue_name_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.cc index 2ad16c882d..1d7ee6be5e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.cc @@ -81,13 +81,13 @@ Status ZipNode::GetDatasetSize(const std::shared_ptr &size_ge } // Visitor accepting method for IRNodePass -Status ZipNode::Accept(IRNodePass *const p, bool *modified) { +Status ZipNode::Accept(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->Visit(shared_from_base(), modified); } // Visitor accepting method for IRNodePass -Status ZipNode::AcceptAfter(IRNodePass *const p, bool *modified) { +Status ZipNode::AcceptAfter(IRNodePass *const p, bool *const modified) { // Downcast shared pointer then call visitor return p->VisitAfter(shared_from_base(), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.h b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.h index 06c8a084e2..ff29c39759 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.h +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/zip_node.h @@ -68,13 +68,13 @@ class ZipNode : public DatasetNode { /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status Accept(IRNodePass *p, bool *modified) override; + Status Accept(IRNodePass *const p, bool *const modified) override; /// \brief Base-class override for accepting IRNodePass visitor /// \param[in] p The node to visit /// \param[out] modified Indicator if the node was modified /// \return Status of the node visit - Status AcceptAfter(IRNodePass *p, bool *modified) override; + Status AcceptAfter(IRNodePass *const p, bool *const modified) override; private: std::vector> datasets_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.cc index 62efb43846..d67d7866b1 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.cc @@ -29,7 +29,7 @@ namespace mindspore { namespace dataset { -Status TensorOpFusionPass::Visit(std::shared_ptr node, bool *modified) { +Status TensorOpFusionPass::Visit(std::shared_ptr node, bool *const modified) { std::vector> ops = node->operations(); // start temporary code, to deal with pre-built TensorOperation diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.h index 80ae74ac89..4f1d2074b8 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.h @@ -30,7 +30,7 @@ class TensorOpFusionPass : public IRNodePass { /// \param[in] node The node being visited /// \param[inout] *modified indicates whether the node has been visited /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc index ecb65eb5d0..85e2d85e89 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc @@ -87,7 +87,7 @@ namespace mindspore { namespace dataset { // Driver method for TreePass -Status IRTreePass::Run(std::shared_ptr root_ir, bool *modified) { +Status IRTreePass::Run(std::shared_ptr root_ir, bool *const modified) { if (root_ir == nullptr || modified == nullptr) { return Status(StatusCode::kUnexpectedError, "Null pointer passed to TreePass"); } @@ -97,7 +97,7 @@ Status IRTreePass::Run(std::shared_ptr root_ir, bool *modified) { } // Driver method for NodePass -Status IRNodePass::Run(std::shared_ptr root_ir, bool *modified) { +Status IRNodePass::Run(std::shared_ptr root_ir, bool *const modified) { if (root_ir == nullptr || modified == nullptr) { return Status(StatusCode::kUnexpectedError, "Null pointer passed to NodePass"); } @@ -114,7 +114,7 @@ Status IRNodePass::Run(std::shared_ptr root_ir, bool *modified) { } // Helper function to perform DFS visit -Status IRNodePass::DFSNodeVisit(std::shared_ptr node_ir, bool *modified) { +Status IRNodePass::DFSNodeVisit(std::shared_ptr node_ir, bool *const modified) { bool m = false; RETURN_IF_NOT_OK(node_ir->Accept(this, &m)); @@ -129,7 +129,7 @@ Status IRNodePass::DFSNodeVisit(std::shared_ptr node_ir, bool *modi } // Helper function to perform BFS visit -Status IRNodePass::BFSNodeVisit(std::shared_ptr node_ir, bool *modified) { +Status IRNodePass::BFSNodeVisit(std::shared_ptr node_ir, bool *const modified) { bool m = false; // Initialize bfs queue with root @@ -155,126 +155,126 @@ Status IRNodePass::BFSNodeVisit(std::shared_ptr node_ir, bool *modi } // For non-leaf IR node -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } #ifdef ENABLE_PYTHON -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } #endif #ifndef ENABLE_ANDROID -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::VisitAfter(std::shared_ptr node, bool *modified) { +Status IRNodePass::VisitAfter(std::shared_ptr node, bool *const modified) { return VisitAfter(std::static_pointer_cast(node), modified); } #endif // leaf-IR Node -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } -Status IRNodePass::Visit(std::shared_ptr node, bool *modified) { +Status IRNodePass::Visit(std::shared_ptr node, bool *const modified) { return Visit(std::static_pointer_cast(node), modified); } ////////////////////////////////// // This section of code will be removed once the migration of optimizer from DatasetOp to DatasetNode is done. // Driver method for TreePass -Status TreePass::Run(ExecutionTree *tree, bool *modified) { +Status TreePass::Run(ExecutionTree *tree, bool *const modified) { if (tree == nullptr || modified == nullptr) { return Status(StatusCode::kUnexpectedError, "Null pointer passed to TreePass"); } @@ -284,7 +284,7 @@ Status TreePass::Run(ExecutionTree *tree, bool *modified) { } // Driver method for NodePass -Status NodePass::Run(ExecutionTree *tree, bool *modified) { +Status NodePass::Run(ExecutionTree *tree, bool *const modified) { if (tree == nullptr || modified == nullptr) { return Status(StatusCode::kUnexpectedError, "Null pointer passed to NodePass"); } @@ -302,7 +302,7 @@ Status NodePass::Run(ExecutionTree *tree, bool *modified) { } // Helper function to perform DFS visit -Status NodePass::DFSNodeVisit(std::shared_ptr node, bool *modified) { +Status NodePass::DFSNodeVisit(std::shared_ptr node, bool *const modified) { RETURN_IF_NOT_OK(node->PreAccept(this, modified)); for (const auto &c : node->Children()) { RETURN_IF_NOT_OK(this->DFSNodeVisit(c, modified)); @@ -311,7 +311,7 @@ Status NodePass::DFSNodeVisit(std::shared_ptr node, bool *modified) { } // Helper function to perform BFS visit -Status NodePass::BFSNodeVisit(std::shared_ptr root, bool *modified) { +Status NodePass::BFSNodeVisit(std::shared_ptr root, bool *const modified) { // Initialize bfs queue with root std::queue> bfsQueue; bfsQueue.push(root); @@ -333,220 +333,220 @@ Status NodePass::BFSNodeVisit(std::shared_ptr root, bool *modified) { return Status::OK(); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } #ifndef ENABLE_ANDROID -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } #endif #ifdef ENABLE_PYTHON -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::RunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return RunOnNode(std::static_pointer_cast(node), modified); } -Status NodePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status NodePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Fallback to base class visitor by default return PreRunOnNode(std::static_pointer_cast(node), modified); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pass.h index c9f5335743..2ac0e79dda 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pass.h @@ -118,7 +118,7 @@ class IRPass : public std::enable_shared_from_this { // Run the transformation pass against the IR tree. // @param root_ir - Pointer to the IR tree to be transformed. // @param modified - Pointer to the modified flag, - virtual Status Run(std::shared_ptr root_ir, bool *modified) = 0; + virtual Status Run(std::shared_ptr root_ir, bool *const modified) = 0; virtual ~IRPass() = default; }; @@ -129,14 +129,14 @@ class IRTreePass : public IRPass { /// \brief Run the transformation pass against the IR tree. /// \param[inout] root_ir Pointer to the IR tree to be transformed. /// \param[inout] modified Indicate if the tree was modified - Status Run(std::shared_ptr root_ir, bool *modified) final; + Status Run(std::shared_ptr root_ir, bool *const modified) final; /// \brief Derived classes may implement the runOnTree function to implement tree transformation. /// "modified" flag needs to be set to true if tree is modified during the pass execution. /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate if the tree was modified. /// \return Status The status code returned - virtual Status RunOnTree(std::shared_ptr root_ir, bool *modified) { return Status::OK(); } + virtual Status RunOnTree(std::shared_ptr root_ir, bool *const modified) { return Status::OK(); } }; // IRNodePass is a base Pass class which performs transformation on node visiting. @@ -164,21 +164,21 @@ class IRNodePass : public IRPass { /// \brief Run the transformation pass against the IR tree /// \param[inout] root_ir Pointer to the IR tree to be transformed /// \param[inout] modified Indicator if the tree was changed - Status Run(std::shared_ptr root_ir, bool *modified) final; + Status Run(std::shared_ptr root_ir, bool *const modified) final; /// \brief Derived classes may implement the Visit function to implement any initial visit work on the way down /// a tree traversal. "modified" flag needs to be set to true if node is modified during the pass execution /// \param[in] node The node being visited /// \param[out] modified Indicator if the node was changed at all /// \return Status The status code returned - virtual Status Visit(std::shared_ptr node, bool *modified) { return Status::OK(); } + virtual Status Visit(std::shared_ptr node, bool *const modified) { return Status::OK(); } /// \brief Derived classes may implement the VisitAfter function to implement node level tree transformation /// "modified" flag needs to be set to true if node is modified during the pass execution /// \param[in] node The node being visited /// \param[out] modified Indicator if the node was changed at all. /// \return Status The status code returned - virtual Status VisitAfter(std::shared_ptr node, bool *modified) { return Status::OK(); } + virtual Status VisitAfter(std::shared_ptr node, bool *const modified) { return Status::OK(); } // Visit()/VisitAfter() method to be overridden. // These pairs of Visit()/VisitAfter() for each derived class of DatasetNode are defined here. @@ -190,55 +190,55 @@ class IRNodePass : public IRPass { // Note that virtual template functions are not permitted in C++. // // Non-leaf IR node - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); #ifdef ENABLE_PYTHON - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); #endif #ifndef ENABLE_ANDROID - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status VisitAfter(std::shared_ptr node, bool *modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status VisitAfter(std::shared_ptr node, bool *const modified); #endif // leaf-IR Node - virtual Status Visit(std::shared_ptr node, bool *modified); - virtual Status Visit(std::shared_ptr node, bool *modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); + virtual Status Visit(std::shared_ptr node, bool *const modified); private: // Helper function to perform DFS visit - Status DFSNodeVisit(std::shared_ptr node_ir, bool *modified); + Status DFSNodeVisit(std::shared_ptr node_ir, bool *const modified); // Helper function to perform BFS visit - Status BFSNodeVisit(std::shared_ptr node_ir, bool *modified); + Status BFSNodeVisit(std::shared_ptr node_ir, bool *const modified); // Tree traversal order of the NodePass Order traversalOrder_; @@ -253,7 +253,7 @@ class Pass : public std::enable_shared_from_this { // Run the transformation pass against the execution tree. // @param tree - Pointer to the execution tree to be transformed. // @param modified - Pointer to the modified flag, - virtual Status Run(ExecutionTree *tree, bool *modified) = 0; + virtual Status Run(ExecutionTree *tree, bool *const modified) = 0; virtual ~Pass() = default; }; @@ -264,14 +264,14 @@ class TreePass : public Pass { /// \brief Run the transformation pass against the execution tree. /// \param[inout] tree Pointer to the execution tree to be transformed. /// \param[inout] modified Indicate if the tree was modified - Status Run(ExecutionTree *tree, bool *modified) final; + Status Run(ExecutionTree *tree, bool *const modified) final; /// \brief Derived classes may implement the runOnTree function to implement tree transformation. /// "modified" flag needs to be set to true if tree is modified during the pass execution. /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate of the tree was modified. /// \return Status The status code returned - virtual Status RunOnTree(ExecutionTree *tree, bool *modified) { return Status::OK(); } + virtual Status RunOnTree(ExecutionTree *tree, bool *const modified) { return Status::OK(); } }; // NodePass is a base Pass class which performs transformation on node visiting. @@ -299,79 +299,79 @@ class NodePass : public Pass { /// \brief Run the transformation pass against the execution tree /// \param[inout] tree Pointer to the execution tree to be transformed /// \param[inout] modified Indicator if the tree was changed - Status Run(ExecutionTree *tree, bool *modified) final; + Status Run(ExecutionTree *tree, bool *const modified) final; /// \brief Derived classes may implement the PreRunOnNode function to implement any initial visit work on the way down /// a tree traversal. "modified" flag needs to be set to true if tree is modified during the pass execution /// \param[in] node The node being visited /// \param[out] modified Indicator if the node was changed at all /// \return Status The status code returned - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified) { return Status::OK(); } + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified) { return Status::OK(); } /// \brief Derived classes may implement the RunOnNode function to implement node level tree transformation /// "modified" flag needs to be set to true if tree is modified during the pass execution /// \param[in] node The node being visited /// \param[out] modified Indicator if the node was changed at all. /// \return Status The status code returned - virtual Status RunOnNode(std::shared_ptr node, bool *modified) { return Status::OK(); } + virtual Status RunOnNode(std::shared_ptr node, bool *const modified) { return Status::OK(); } // Visit methods to be overridden. // Note that member template can not be virtual, any op which wants to work with NodePass should declare RunOnNode // of its own type and override "Accept" from DatasetOp. - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); #ifndef ENABLE_ANDROID - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); #endif #ifdef ENABLE_PYTHON - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status RunOnNode(std::shared_ptr node, bool *modified); - virtual Status PreRunOnNode(std::shared_ptr node, bool *modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status RunOnNode(std::shared_ptr node, bool *const modified); + virtual Status PreRunOnNode(std::shared_ptr node, bool *const modified); #endif private: // Helper function to perform DFS visit - Status DFSNodeVisit(std::shared_ptr node, bool *modified); + Status DFSNodeVisit(std::shared_ptr node, bool *const modified); // Helper function to perform BFS visit - Status BFSNodeVisit(std::shared_ptr root, bool *modified); + Status BFSNodeVisit(std::shared_ptr root, bool *const modified); // Tree traversal order of the NodePass Order traversalOrder_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.cc index aedcf4400a..f195686458 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.cc @@ -26,7 +26,7 @@ namespace mindspore { namespace dataset { // this will become the RootNode:DatasetNode when it is turned on -Status AutoWorkerPass::RunOnTree(std::shared_ptr root_ir, bool *modified) { +Status AutoWorkerPass::RunOnTree(std::shared_ptr root_ir, bool *const modified) { uint8_t config = GlobalContext::config_manager()->get_auto_worker_config(); OpWeightPass pass(kOpWeightConfigs[config < kOpWeightConfigs.size() ? config : 0]); @@ -71,7 +71,7 @@ Status AutoWorkerPass::RunOnTree(std::shared_ptr root_ir, bool *mod return Status::OK(); } -Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *modified) { +Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *const modified) { auto itr = weight_profile_.find(node->Name()); CHECK_FAIL_RETURN_UNEXPECTED(itr != weight_profile_.end(), node->Name() + "'s weight doesn't exist."); int32_t weight = itr->second; @@ -80,7 +80,7 @@ Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool * return Status::OK(); } -Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *modified) { +Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *const modified) { auto itr = weight_profile_.find(node->Name()); CHECK_FAIL_RETURN_UNEXPECTED(itr != weight_profile_.end(), node->Name() + "'s weight doesn't exist."); int32_t weight = itr->second; @@ -89,7 +89,7 @@ Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool return Status::OK(); } -Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *modified) { +Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *const modified) { RETURN_OK_IF_TRUE(node->Name() == kGeneratorNode); // generator is pipeline op, skip this auto itr = weight_profile_.find("MappableSource"); CHECK_FAIL_RETURN_UNEXPECTED(itr != weight_profile_.end(), @@ -100,7 +100,7 @@ Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr n return Status::OK(); } -Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *modified) { +Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *const modified) { auto itr = weight_profile_.find("NonMappableSourceNode"); CHECK_FAIL_RETURN_UNEXPECTED(itr != weight_profile_.end(), "NonLeafSource::" + node->Name() + "'s weight doesn't exist."); @@ -110,7 +110,7 @@ Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *modified) { +Status AutoWorkerPass::OpWeightPass::Visit(std::shared_ptr node, bool *const modified) { weight_sum_ += GetNodeWeightFromProfile(node); return Status::OK(); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.h index d965f103d2..683c541507 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/post/auto_worker_pass.h @@ -63,13 +63,13 @@ class AutoWorkerPass : public IRTreePass { // this is the base class function which contains the logic to handle most of the pipeline ops // pipeline ops although can't config num_workers it still runs 1 thread they need to be factored into weight - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; // these functions calculate the weights of more complex Nodes which may depend on its input arg. these functions // will also push these nodes to a vector whose num_workers will be set int the Tree Pass - Status Visit(std::shared_ptr node, bool *modified) override; - Status Visit(std::shared_ptr node, bool *modified) override; - Status Visit(std::shared_ptr node, bool *modified) override; - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; // helper function to look up weight according to the name of this Op. float GetNodeWeightFromProfile(std::shared_ptr node); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.cc index 73be7aebc3..c743ac0b95 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.cc @@ -37,7 +37,7 @@ RepeatPass::RepeatPass() cache_lookup_(nullptr) {} // Identifies the subtree below this node as being in a repeated path of the tree. -Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Create a new stack for eoe operators and push onto our stack of stacks. std::unique_ptr new_stack = std::make_unique(); eoe_op_stacks_.push(std::move(new_stack)); @@ -69,7 +69,7 @@ Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *modified) } // Identifies the subtree below this node as being in a repeated path of the tree. -Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // EpochCtrl is derived from RepeatOp. Generally it should do the identical setup // that RepeatOp does. However, epoch control is actually simpler because it can // only exist as the root node so it doesn't need all the nested code. @@ -88,21 +88,21 @@ Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *modifie } // Identifies the subtree below this node as being in a cache merge path -Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that we're under a merge op is_merge_ = true; return Status::OK(); } // Identifies the subtree below this node as being cached -Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that we're under a merge op is_cached_ = true; return Status::OK(); } // Hooks up any identified eoe nodes under this repeat. -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Pop the leaf ops from the save-area stack and add them to the repeat op's eoe node tracking std::shared_ptr leaf_op = PopFromEOEOpStack(); @@ -155,7 +155,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { } // Hooks up any identified eoe nodes under this repeat. -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Pop the leaf ops from the save-area stack and add them to the eoe node tracking std::shared_ptr leaf_op = PopFromEOEOpStack(); while (leaf_op != nullptr) { @@ -171,7 +171,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) } // CacheOp removes previous leaf ops and replaces them with itself -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { is_cached_ = false; // if we are a cache within a repeat path of the tree, then adjust the total repeats and total epochs for cached ops. @@ -191,7 +191,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { return Status::OK(); } -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { // If we are in a repeat path, then set our repeated flag if (is_repeated_) { // if infinite repeat save ourself in a stack for the repeat operator above us @@ -210,7 +210,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) } // All operators have a flag that might be set related to the repeat and any leaf nodes need to be set up // for use with a controlling repeat above it. -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { // If we are under a cache op, then save ourselves to the cached op stack. if (is_cached_) { AddToCachedOpStack(node); @@ -222,7 +222,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { } // Turns off the tracking for operations under merge op -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { // If there was not any repeat in the merge cache miss leg, then the cache_lookup // would not have been consumed yet. In that case, we need to set its total repeats for it. if (cache_lookup_) { @@ -237,7 +237,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) } // Saves the lookup up in case it needs to be referenced by a repeat -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { if (!node->IsLeaf()) { // By definition, the CacheLookup must be a leaf op. Make that clear here. RETURN_STATUS_UNEXPECTED("CacheLookupOp must be a leaf node!"); @@ -253,7 +253,7 @@ Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified return Status::OK(); } -Status RepeatPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status RepeatPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Set total repeats and total epochs for the DeviceQueueOp node->set_total_repeats(num_epochs_); node->set_num_repeats_per_epoch(1); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.h index ff175b53dd..e7778ded41 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/post/repeat_pass.h @@ -42,74 +42,74 @@ class RepeatPass : public NodePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the subtree below this node as being in a repeated path of the tree. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the subtree below this node as being in a cache merge path /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the subtree below this node as being cached /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Hooks up any identified eoe nodes under this repeat. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Hooks up any identified eoe nodes under this repeat. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief CacheOp removes previous leaf ops and replaces them with itself /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Turns of the tracking for operations under merge op /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Saves the lookup up in case it needs to be referenced by a repeat /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Set the epoch count for DeviceQueue /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Special case for GeneratorOp /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief All operators have a flag that might be set related to the repeat and any leaf nodes need to be set up /// for use with a controlling repeat above it. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; private: /// \brief Adds an operator to the eoe operator stack save area diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.cc index e709b40cae..2ab4a5ca21 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.cc @@ -27,14 +27,14 @@ namespace dataset { CacheErrorPass::CacheErrorPass() : is_cached_(false), is_mappable_(false) {} // Identifies the subtree below this node as being cached -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that we're under a merge op is_cached_ = true; return Status::OK(); } // Returns an error if ZipOp exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "ZipOp is currently not supported as a descendant operator under a cache."); @@ -44,7 +44,7 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) } // Returns an error if MapOp with non-deterministic TensorOps exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { auto tfuncs = node->TFuncs(); for (size_t i = 0; i < tfuncs.size(); i++) { @@ -58,7 +58,7 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) } // Returns an error if ConcatOp exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "ConcatOp is currently not supported as a descendant operator under a cache."); @@ -68,7 +68,7 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modifi } // Returns an error if TakeOp exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "TakeOp/SplitOp is currently not supported as a descendant operator under a cache."); @@ -78,7 +78,7 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified } // Returns an error if SkipOp exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "SkipOp is currently not supported as a descendant operator under a cache."); @@ -88,7 +88,7 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified } // Returns an error if SkipOp exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "BatchOp is currently not supported as a descendant operator under a cache."); @@ -99,7 +99,7 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modifie #ifdef ENABLE_PYTHON // Returns an error if FilterOp exists under a cache -Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "FilterOp is currently not supported as a descendant operator under a cache."); @@ -109,67 +109,67 @@ Status CacheErrorPass::PreRunOnNode(std::shared_ptr node, bool *modifi } #endif -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn on the flag that this is a tree with mappable leaf dataset is_mappable_ = true; return Status::OK(); } -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { // Turn off the flag that we're under a merge op is_cached_ = false; return Status::OK(); @@ -177,7 +177,7 @@ Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) // Currently, returns an error if RepeatOp exists under a cache // Because there is no operator in the cache hit stream to consume eoes, caching above repeat causes problem. -Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheErrorPass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_cached_ && is_mappable_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "Repeat is not supported as a descendant operator under a mappable cache."); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.h index 9ee423e0a3..a3a5d502ac 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_error_pass.h @@ -39,123 +39,123 @@ class CacheErrorPass : public NodePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if ZipOp exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if MapOp with non-deterministic TensorOps exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if ConcatOp exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if TakeOp exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if SkipOp exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if SkipOp exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; #ifdef ENABLE_PYTHON /// \brief Returns an error if FilterOp exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; #endif /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the leaf dataset as being mappable /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the subtree above this node as not being cached /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Identifies and block repeat under cache scenarios /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; private: bool is_cached_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.cc index 8f9fdfbd01..d805642945 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.cc @@ -54,7 +54,7 @@ namespace dataset { CacheTransformPass::CachePass::CachePass() : is_caching_(false), leaf_op_(nullptr) {} // Identifies the subtree below this node as a cached descendant tree. -Status CacheTransformPass::CachePass::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::PreRunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; MS_LOG(INFO) << "Cache transform pass: CacheOp found, identified descendant tree."; if (is_caching_) { @@ -66,7 +66,7 @@ Status CacheTransformPass::CachePass::PreRunOnNode(std::shared_ptr node // Resets the tracking of the cache within the tree and assigns the operators that will be involved in a cache // transformation -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; is_caching_ = false; // We a no longer in a cache subtree. clear the flag. if (leaf_op_) { @@ -138,7 +138,7 @@ Status CacheTransformPass::CachePass::NonMappableCacheLeafSetup(std::shared_ptr< #ifndef ENABLE_ANDROID // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_caching_) { // If we are a TF Reader in a caching tree, then change our config so that it becomes a basic // TF reader that parses all files. Selection of data will come from the sampler on the cache instead. @@ -148,7 +148,7 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_caching_) { // If we are a ClueOp in a caching tree, then change our config so that it becomes a basic // ClueOp that parses all files. Selection of data will come from the sampler on the cache instead. @@ -158,7 +158,7 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bo } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_caching_) { // If we are a CsvOp in a caching tree, then change our config so that it becomes a basic // CsvOp that parses all files. Selection of data will come from the sampler on the cache instead. @@ -168,7 +168,7 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, boo } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_caching_) { // If we are a TextFileOp in a caching tree, then change our config so that it becomes a basic // TextFileOp that parses all files. Selection of data will come from the sampler on the cache instead. @@ -179,43 +179,43 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node #endif // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return NonMappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } #ifndef ENABLE_ANDROID // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_caching_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "There is currently no support for MindRecordOp under cache."); @@ -226,7 +226,7 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr no #ifdef ENABLE_PYTHON // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { if (is_caching_) { return Status(StatusCode::kNotImplementedYet, __LINE__, __FILE__, "There is currently no support for GeneratorOp under cache."); @@ -235,12 +235,12 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr nod } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } // Perform leaf node cache transform identification -Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *modified) { +Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr node, bool *const modified) { return MappableCacheLeafSetup(std::static_pointer_cast(node)); } #endif @@ -255,7 +255,7 @@ void CacheTransformPass::CachePass::AddMappableCacheOperators(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Resets the tracking of the cache within the tree and assigns the operators that /// will be involved in a cache transformation /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #ifndef ENABLE_ANDROID @@ -64,95 +64,95 @@ class CacheTransformPass : public TreePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #endif /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #ifdef ENABLE_PYTHON /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #endif /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #ifndef ENABLE_ANDROID /// \brief Perform leaf node cache transform identifications /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #endif /// \brief Getter @@ -192,7 +192,7 @@ class CacheTransformPass : public TreePass { /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate of the tree was modified. /// \return Status The status code returned - Status RunOnTree(ExecutionTree *tree, bool *modified) override; + Status RunOnTree(ExecutionTree *tree, bool *const modified) override; private: /// \brief Helper function to execute the cache transformation. diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.cc index cd41ec918c..c3cff08d23 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.cc @@ -34,7 +34,7 @@ namespace dataset { CacheValidationPass::CacheValidationPass() : is_cached_(false), is_mappable_(false) {} // Returns an error if BatchNode exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (is_cached_) { RETURN_STATUS_UNEXPECTED("BatchNode is not supported as a descendant operator under a cache."); @@ -46,7 +46,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modifie } // Returns an error if ConcatNode exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (is_cached_) { RETURN_STATUS_UNEXPECTED("ConcatNode is not supported as a descendant operator under a cache."); @@ -58,7 +58,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modifi } // Returns an error if FilterNode exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (is_cached_) { RETURN_STATUS_UNEXPECTED("FilterNode is not supported as a descendant operator under a cache."); @@ -70,7 +70,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modifi } // Returns an error if SkipNode exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (is_cached_) { RETURN_STATUS_UNEXPECTED("SkipNode is not supported as a descendant operator under a cache."); @@ -82,7 +82,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified } // Returns an error if TakeNode exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (is_cached_) { RETURN_STATUS_UNEXPECTED("TakeNode (possibly from Split) is not supported as a descendant operator under a cache."); @@ -94,7 +94,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified } // Returns an error if ZipNode exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (is_cached_) { RETURN_STATUS_UNEXPECTED("ZipNode is not supported as a descendant operator under a cache."); @@ -106,7 +106,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) } // Returns an error if MapNode with non-deterministic tensor operations exists under a cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (node->IsCached()) { if (is_cached_) { @@ -126,7 +126,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) } // Flag an error if we have a cache over another cache -Status CacheValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::Visit(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::Visit(): visiting " << node->Name() << "."; if (node->IsCached()) { if (is_cached_) { @@ -143,7 +143,7 @@ Status CacheValidationPass::Visit(std::shared_ptr node, bool *modif // Returns an error if MappableSource <- Repeat <- Node with a cache // Because there is no operator in the cache hit stream to consume EoEs, caching above repeat causes problem. -Status CacheValidationPass::VisitAfter(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::VisitAfter(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::VisitAfter(): visiting " << node->Name() << "."; if (is_cached_ && is_mappable_) { RETURN_STATUS_UNEXPECTED("A cache over a RepeatNode of a mappable dataset is not supported."); @@ -151,7 +151,7 @@ Status CacheValidationPass::VisitAfter(std::shared_ptr node, bool *m return Status::OK(); } -Status CacheValidationPass::VisitAfter(std::shared_ptr node, bool *modified) { +Status CacheValidationPass::VisitAfter(std::shared_ptr node, bool *const modified) { MS_LOG(DEBUG) << "CacheValidationPass::VisitAfter(): visiting " << node->Name() << "."; // Reset the flag when all descendants are visited if (node->IsCached()) { diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.h index 126a2a9ec9..d75f8bd73b 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_validation_pass.h @@ -39,61 +39,61 @@ class CacheValidationPass : public IRNodePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if ConcatNode exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if FilterNode exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if SkipNode exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if TakeNode exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if ZipNode exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if MapNode with non-deterministic tensor operations exists under a cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Returns an error if there is a cache over another cache /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Identifies and block repeat under cache scenarios /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status VisitAfter(std::shared_ptr node, bool *modified) override; + Status VisitAfter(std::shared_ptr node, bool *const modified) override; /// \brief Identifies the subtree above this node as not being cached /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status VisitAfter(std::shared_ptr node, bool *modified) override; + Status VisitAfter(std::shared_ptr node, bool *const modified) override; private: bool is_cached_; diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc index cd20df18db..4691d201aa 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc @@ -27,7 +27,7 @@ DeepCopyPass::DeepCopyPass() { parent_ = root_.get(); } -Status DeepCopyPass::Visit(std::shared_ptr node, bool *modified) { +Status DeepCopyPass::Visit(std::shared_ptr node, bool *const modified) { *modified = true; // Do a nested-loop walk to check whether a node has the same child more than once. // This is an artificial restriction. We can support it since we will do a clone of the input tree in this pass. @@ -59,7 +59,7 @@ Status DeepCopyPass::Visit(std::shared_ptr node, bool *modified) { return Status::OK(); } -Status DeepCopyPass::VisitAfter(std::shared_ptr node, bool *modified) { +Status DeepCopyPass::VisitAfter(std::shared_ptr node, bool *const modified) { *modified = true; // After visit the node, move up to its parent parent_ = parent_->Parent(); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.h index 76daa72a71..87d9e21ee4 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.h @@ -39,13 +39,13 @@ class DeepCopyPass : public IRNodePass { /// \param[in] node The node being visited /// \param[inout] *modified indicates whether the node has been visited /// \return Status code - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Reset parent after walking its sub tree. /// \param[in] node The node being visited /// \param[inout] *modified indicates whether the node has been visited /// \return Status code - Status VisitAfter(std::shared_ptr node, bool *modified) override; + Status VisitAfter(std::shared_ptr node, bool *const modified) override; /// \brief Getter method to retrieve the root node /// \return the root node of the new cloned tree diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.cc index cbfe087bdd..014c7f0147 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.cc @@ -29,7 +29,7 @@ EpochCtrlPass::InjectionFinder::InjectionFinder(std::shared_ptr nod : injection_point_(nullptr), num_epochs_(-1) {} // Performs finder work for BuildVocabOp that has special rules about epoch control injection -Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, bool *modified) { +Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, bool *const modified) { // The injection is at the child of the root node injection_point_ = node; num_epochs_ = node->num_epochs(); @@ -37,20 +37,20 @@ Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, boo } // Performs finder work for BuildVocabOp that has special rules about epoch control injection -Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, bool *modified) { +Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, bool *const modified) { injection_point_ = nullptr; return Status::OK(); } #ifndef ENABLE_ANDROID // Performs finder work for BuildSentencePieceVocabNode that has special rules about epoch control injection -Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, bool *modified) { +Status EpochCtrlPass::InjectionFinder::Visit(std::shared_ptr node, bool *const modified) { injection_point_ = nullptr; return Status::OK(); } #endif -Status EpochCtrlPass::InjectionFinder::VisitAfter(std::shared_ptr node, bool *modified) { +Status EpochCtrlPass::InjectionFinder::VisitAfter(std::shared_ptr node, bool *const modified) { // Assumption: There is only one TransferNode in a pipeline. This assumption is not validated here. // Move the injection point to the child of this node. injection_point_ = node; @@ -61,7 +61,7 @@ Status EpochCtrlPass::InjectionFinder::VisitAfter(std::shared_ptr EpochCtrlPass::EpochCtrlPass() {} // Runs an injection pass to inject in operators needed at the pre pass stage -Status EpochCtrlPass::RunOnTree(std::shared_ptr root_ir, bool *modified) { +Status EpochCtrlPass::RunOnTree(std::shared_ptr root_ir, bool *const modified) { MS_LOG(INFO) << "Pre pass: Injection pass started."; // First, run the finder to perform any injection info before we can go ahead to drive the op injection work. diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.h index e261a5f03a..71f59f648d 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_ctrl_pass.h @@ -46,27 +46,27 @@ class EpochCtrlPass : public IRTreePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Performs finder work for BuildVocabNode that has special rules about epoch control injection. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; #ifndef ENABLE_ANDROID /// \brief Performs finder work for BuildSentenceVocabNode that has special rules about epoch control injection. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; #endif /// \brief Register the TransferNode for further action. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status VisitAfter(std::shared_ptr node, bool *modified) override; + Status VisitAfter(std::shared_ptr node, bool *const modified) override; /// \brief Getter std::shared_ptr injection_point() { return injection_point_; } @@ -90,7 +90,7 @@ class EpochCtrlPass : public IRTreePass { /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate of the tree was modified. /// \return Status The status code returned - Status RunOnTree(std::shared_ptr root_ir, bool *modified) override; + Status RunOnTree(std::shared_ptr root_ir, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_injection_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_injection_pass.cc index e3dced8932..2d279ea1fe 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_injection_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/epoch_injection_pass.cc @@ -29,20 +29,20 @@ EpochInjectionPass::InjectionFinder::InjectionFinder(std::shared_ptr #ifndef ENABLE_ANDROID // Performs finder work for BuildVocabOp that has special rules about epoch control injection -Status EpochInjectionPass::InjectionFinder::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status EpochInjectionPass::InjectionFinder::PreRunOnNode(std::shared_ptr node, bool *const modified) { injection_point_ = nullptr; return Status::OK(); } // Performs finder work for BuildSentencePieceVocabOp that has special rules about epoch control injection Status EpochInjectionPass::InjectionFinder::PreRunOnNode(std::shared_ptr node, - bool *modified) { + bool *const modified) { injection_point_ = nullptr; return Status::OK(); } #endif -Status EpochInjectionPass::InjectionFinder::RunOnNode(std::shared_ptr node, bool *modified) { +Status EpochInjectionPass::InjectionFinder::RunOnNode(std::shared_ptr node, bool *const modified) { // Assumption: There is only one DeviceQueueOp in a pipeline. This assumption is not validated here. injection_point_ = node->child(0); return Status::OK(); @@ -52,7 +52,7 @@ Status EpochInjectionPass::InjectionFinder::RunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Performs finder work for BuildSentencePieceVocabOp that has special rules about epoch control injection. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; #endif /// \brief Register the DeviceQueueOp for further action. /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Getter std::shared_ptr injection_point() { return injection_point_; } @@ -80,7 +80,7 @@ class EpochInjectionPass : public TreePass { /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate of the tree was modified. /// \return Status The status code returned - Status RunOnTree(ExecutionTree *tree, bool *modified) override; + Status RunOnTree(ExecutionTree *tree, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.cc index 14c57adf6b..942653ec30 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.cc @@ -19,7 +19,7 @@ namespace mindspore { namespace dataset { -Status GetterPass::Visit(std::shared_ptr node, bool *modified) { +Status GetterPass::Visit(std::shared_ptr node, bool *const modified) { node->ClearCallbacks(); return Status::OK(); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.h index fd9c8f5921..3e3f3af384 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/getter_pass.h @@ -36,7 +36,7 @@ class GetterPass : public IRNodePass { /// \brief Default Destructor ~GetterPass() = default; - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc index 5ede8c12d6..fda92dcd36 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc @@ -22,7 +22,7 @@ namespace mindspore { namespace dataset { -Status InputValidationPass::Visit(std::shared_ptr node, bool *modified) { +Status InputValidationPass::Visit(std::shared_ptr node, bool *const modified) { *modified = false; RETURN_IF_NOT_OK(node->ValidateParams()); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.h index fd26863c14..bfb5f72f1c 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.h @@ -31,7 +31,7 @@ class InputValidationPass : public IRNodePass { /// \param[in] node The node being visited /// \param[inout] *modified indicates whether the node has been visited /// \return Status code - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.cc index 20d72ae33b..5dc2baa893 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.cc @@ -28,7 +28,7 @@ namespace dataset { NodeRemovalPass::RemovalNodes::RemovalNodes() : is_caching_(false) {} // Identifies the subtree below this node as a cached descendant tree. -Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *modified) { +Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *const modified) { *modified = false; MS_LOG(INFO) << "Node removal pass: Operation with cache found, identified descendant tree."; if (node->IsCached()) { @@ -38,7 +38,7 @@ Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, b } // Resets the tracking of the cache within the tree -Status NodeRemovalPass::RemovalNodes::VisitAfter(std::shared_ptr node, bool *modified) { +Status NodeRemovalPass::RemovalNodes::VisitAfter(std::shared_ptr node, bool *const modified) { *modified = false; MS_LOG(INFO) << "Removal pass: Descendant walk is complete."; if (is_caching_ && node->IsLeaf()) { @@ -51,7 +51,7 @@ Status NodeRemovalPass::RemovalNodes::VisitAfter(std::shared_ptr no } // Perform RepeatNode removal check. -Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *modified) { +Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *const modified) { *modified = false; if (node->Count() == 1) { nodes_to_remove_.push_back(std::static_pointer_cast(node)); @@ -60,13 +60,13 @@ Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bo } // Perform ShuffleNode removal check. -Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *modified) { +Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *const modified) { *modified = false; return Status::OK(); } // Perform SkipNode removal check. -Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *modified) { +Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *const modified) { *modified = false; if (node->Count() == 0) { nodes_to_remove_.push_back(std::static_pointer_cast(node)); @@ -75,7 +75,7 @@ Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool } // Perform TakeNode removal check. -Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *modified) { +Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool *const modified) { *modified = false; if (node->Count() == -1) { nodes_to_remove_.push_back(std::static_pointer_cast(node)); @@ -87,7 +87,7 @@ Status NodeRemovalPass::RemovalNodes::Visit(std::shared_ptr node, bool NodeRemovalPass::NodeRemovalPass() {} // Walk the tree to collect the nodes to remove, then removes them. -Status NodeRemovalPass::RunOnTree(std::shared_ptr root_ir, bool *modified) { +Status NodeRemovalPass::RunOnTree(std::shared_ptr root_ir, bool *const modified) { MS_LOG(INFO) << "Pre pass: node removal pass started."; // Create the removal node pass which can identify which nodes need to be removed. std::unique_ptr removal_nodes = std::make_unique(); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.h index b2c23e666f..865902b9cd 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/node_removal_pass.h @@ -46,37 +46,37 @@ class NodeRemovalPass : public IRTreePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Resets the tracking of the cache within the tree /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status VisitAfter(std::shared_ptr node, bool *modified) override; + Status VisitAfter(std::shared_ptr node, bool *const modified) override; /// \brief Perform RepeatNode removal check /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Perform ShuffleNode removal check /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Perform SkipNode removal check /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Perform TakeNode removal check /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status Visit(std::shared_ptr node, bool *modified) override; + Status Visit(std::shared_ptr node, bool *const modified) override; /// \brief Getter /// \return All the nodes to be removed @@ -98,7 +98,7 @@ class NodeRemovalPass : public IRTreePass { /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate of the tree was modified. /// \return Status The status code returned - Status RunOnTree(std::shared_ptr root_ir, bool *modified) override; + Status RunOnTree(std::shared_ptr root_ir, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.cc index 5fec3f196d..688ad8adf1 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.cc @@ -27,7 +27,7 @@ RemovalPass::RemovalNodes::RemovalNodes() : is_caching_(false) {} #ifndef ENABLE_ANDROID // Identifies the subtree below this node as a cached descendant tree. -Status RemovalPass::RemovalNodes::PreRunOnNode(std::shared_ptr node, bool *modified) { +Status RemovalPass::RemovalNodes::PreRunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; MS_LOG(INFO) << "Removal pass: CacheOp found, identified descendant tree."; is_caching_ = true; @@ -35,7 +35,7 @@ Status RemovalPass::RemovalNodes::PreRunOnNode(std::shared_ptr node, bo } // Resets the tracking of the cache within the tree -Status RemovalPass::RemovalNodes::RunOnNode(std::shared_ptr node, bool *modified) { +Status RemovalPass::RemovalNodes::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; MS_LOG(INFO) << "Removal pass: cache descendant tree complete."; is_caching_ = false; @@ -44,7 +44,7 @@ Status RemovalPass::RemovalNodes::RunOnNode(std::shared_ptr node, bool #endif // Perform ShuffleOp removal check. -Status RemovalPass::RemovalNodes::RunOnNode(std::shared_ptr node, bool *modified) { +Status RemovalPass::RemovalNodes::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; // If we are in a cache descendant tree, then this shuffle op needs to be removed if (is_caching_) { @@ -58,7 +58,7 @@ Status RemovalPass::RemovalNodes::RunOnNode(std::shared_ptr node, boo RemovalPass::RemovalPass() {} // Walk the tree to collect the nodes to remove, then removes them. -Status RemovalPass::RunOnTree(ExecutionTree *tree, bool *modified) { +Status RemovalPass::RunOnTree(ExecutionTree *tree, bool *const modified) { MS_LOG(INFO) << "Pre pass: removal pass started."; // Create the removal node pass which can identify which nodes need to be removed. std::unique_ptr removal_nodes = std::make_unique(); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.h index 72d003d885..849ee23174 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/removal_pass.h @@ -47,20 +47,20 @@ class RemovalPass : public TreePass { /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status PreRunOnNode(std::shared_ptr node, bool *modified) override; + Status PreRunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Resets the tracking of the cache within the tree /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #endif /// \brief Perform ShuffleOp removal check /// \param[in] node The node being visited /// \param[inout] modified Indicator if the node was changed at all /// \return Status The status code returned - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; /// \brief Getter /// \return All the nodes to be removed @@ -82,7 +82,7 @@ class RemovalPass : public TreePass { /// \param[inout] tree The tree to operate on. /// \param[inout] Indicate of the tree was modified. /// \return Status The status code returned - Status RunOnTree(ExecutionTree *tree, bool *modified) override; + Status RunOnTree(ExecutionTree *tree, bool *const modified) override; }; } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc index 4d68558d7a..7ff2c39794 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc @@ -20,54 +20,54 @@ namespace mindspore { namespace dataset { -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting DatasetOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting BatchOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting MapOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting ProjectOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting RenameOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting SkipOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting ShuffleOp" << '\n'; return Status::OK(); } #ifndef ENABLE_ANDROID -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting MindRecordOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting TFReaderOp" << '\n'; return Status::OK(); @@ -75,44 +75,44 @@ Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) #endif #ifdef ENABLE_PYTHON -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting FilterOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting GeneratorOp" << '\n'; return Status::OK(); } #endif -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting TakeOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting ZipOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting DeviceQueueOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting ImageFolderOp" << '\n'; return Status::OK(); } -Status PrinterPass::RunOnNode(std::shared_ptr node, bool *modified) { +Status PrinterPass::RunOnNode(std::shared_ptr node, bool *const modified) { *modified = false; std::cout << "Visiting ImageFolderOp" << '\n'; return Status::OK(); diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h b/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h index 74a50e217b..62463a694e 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h @@ -25,41 +25,41 @@ namespace dataset { class PrinterPass : public NodePass { public: - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #ifndef ENABLE_ANDROID - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #endif #ifdef ENABLE_PYTHON - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; #endif - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; - Status RunOnNode(std::shared_ptr node, bool *modified) override; + Status RunOnNode(std::shared_ptr node, bool *const modified) override; }; } // namespace dataset