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.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 "base/base.h"
  17. namespace mindspore {
  18. namespace somas {
  19. class SomasParameter {
  20. public:
  21. SomasParameter(size_t id, AnfNodePtr source_node, size_t index, const void *addr, size_t size)
  22. : id_(id), source_node_(source_node), output_index_(index), addr_(const_cast<void *>(addr)), size_(size) {}
  23. ~SomasParameter() = default;
  24. const size_t id_{0};
  25. AnfNodePtr source_node_;
  26. size_t output_index_;
  27. void *addr_;
  28. size_t size_;
  29. };
  30. using SomasParameterPtr = std::shared_ptr<SomasParameter>;
  31. } // namespace somas
  32. } // namespace mindspore
  33. #endif // MINDSPORE_CCSRC_BACKEND_OPTIMIZER_SOMAS_SOMAS_PARAMETER_H_