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.

opr_impl.h 1.1 kB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * \file dnn/src/naive/diag/opr_impl.h
  3. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  4. *
  5. * Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  6. *
  7. * Unless required by applicable law or agreed to in writing,
  8. * software distributed under the License is distributed on an
  9. * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. */
  11. #pragma once
  12. #include "megdnn/oprs.h"
  13. namespace megdnn {
  14. namespace naive {
  15. class DiagImpl : public Diag {
  16. public:
  17. using Diag::Diag;
  18. void exec(
  19. _megdnn_tensor_in src, _megdnn_tensor_out dst,
  20. _megdnn_workspace workspace) override;
  21. size_t get_workspace_in_bytes(const TensorLayout&, const TensorLayout&) override {
  22. return 0;
  23. }
  24. private:
  25. template <typename ctype>
  26. void exec_internal(
  27. ctype* src, const TensorLayout& src_layout, ctype* dst,
  28. const TensorLayout& dst_layout, size_t input_ndim, int k);
  29. };
  30. } // namespace naive
  31. } // namespace megdnn
  32. // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}