You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

somas_parameter.h 1.5 kB

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