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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * \file dnn/src/arm_common/matrix_mul/opr_impl.h
  3. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  4. *
  5. * Copyright (c) 2014-2020 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 "src/common/utils.h"
  13. #include "src/fallback/matrix_mul/opr_impl.h"
  14. #include "src/common/algo_base.h"
  15. namespace megdnn {
  16. namespace arm_common {
  17. class MatrixMulImpl : public fallback::MatrixMulImpl {
  18. public:
  19. using fallback::MatrixMulImpl::MatrixMulImpl;
  20. bool is_thread_safe() const override { return true; }
  21. class AlgoBase : public fallback::MatrixMulImpl::AlgoBase {
  22. public:
  23. AlgoBase() : fallback::MatrixMulImpl::AlgoBase() {
  24. m_handle_type = Handle::HandleType::ARM_COMMON;
  25. }
  26. };
  27. SmallVector<fallback::MatrixMulImpl::AlgoBase*> get_all_packed_algo()
  28. override;
  29. MEGDNN_FB_DECL_GET_ALGO_FROM_DESC(MatrixMulImpl);
  30. protected:
  31. class AlgoF32Gemv; // Arm_common F32 Gemv
  32. class AlgoF32GemvMK4; // Arm_common F32 Gemv NCHW44
  33. class AlgoInt8x8x32Gemv; // Arm_common Int8x8x32 Gemv
  34. class AlgoInt8x8x32GemvMK4; // Arm_common Int8x8x32 Gemv NCHW44
  35. class AlgoGevm; // Arm_common Gevm(support int8 and fp32)
  36. #if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
  37. class AlgoF16Gemv;
  38. #endif
  39. #if __ARM_FEATURE_DOTPROD
  40. class AlgoInt8x8x32GemvMK4Dot;// Arm_common Int8x8x32 Gemv NCHW44_DOT
  41. #endif
  42. class AlgoInt8x8x16; // Arm_common Int 8x8x16
  43. class AlgoPack;
  44. public:
  45. static const AlgoPack& algo_pack();
  46. };
  47. } // namespace arm_common
  48. } // namespace megdnn
  49. // vim: syntax=cpp.doxygen

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台