• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2021 Huawei Technologies Co., Ltd
3 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7 
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15 */
16 
17 #ifndef MINDSPORE_CCSRC_BACKEND_OPTIMIZER_SOMAS_SOMAS_PARAMETER_H_
18 #define MINDSPORE_CCSRC_BACKEND_OPTIMIZER_SOMAS_SOMAS_PARAMETER_H_
19 
20 #include <memory>
21 #include <string>
22 #include "base/base.h"
23 
24 namespace mindspore {
25 namespace somas {
26 class SomasParameter {
27  public:
SomasParameter(size_t id,std::string source_node_name,size_t index,const void * addr,size_t size)28   SomasParameter(size_t id, std::string source_node_name, size_t index, const void *addr, size_t size)
29       : id_(id),
30         source_node_name_(source_node_name),
31         output_index_(index),
32         addr_(const_cast<void *>(addr)),
33         size_(size) {}
34   ~SomasParameter() = default;
35 
36   const size_t id_{0};
37   std::string source_node_name_;
38   size_t output_index_;
39   void *addr_;
40   size_t size_;
41 };
42 using SomasParameterPtr = std::shared_ptr<SomasParameter>;
43 }  // namespace somas
44 }  // namespace mindspore
45 
46 #endif  // MINDSPORE_CCSRC_BACKEND_OPTIMIZER_SOMAS_SOMAS_PARAMETER_H_
47