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.

algos.h 2.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * \file dnn/src/arm_common/convolution/quint8/algos.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
  10. * implied.
  11. */
  12. #pragma once
  13. #include "src/arm_common/convolution/opr_impl.h"
  14. namespace megdnn {
  15. namespace arm_common {
  16. #if MGB_ENABLE_DOT
  17. /* ===================== ConvolutionBackwardData ===================== */
  18. class ConvolutionBackwardDataImpl::AlgoUdot8DirectStride1 final
  19. : public AlgoBase {
  20. public:
  21. AlgoAttribute attribute() const override {
  22. return AlgoAttribute::REPRODUCIBLE;
  23. }
  24. const char* name() const override {
  25. return "ARM_COMMON_QUINT8_DIRECT_DECONV_STRIDE1";
  26. }
  27. bool usable(fallback::ConvolutionBackwardDataImpl*,
  28. const NCBKernSizeParam& param) const override;
  29. size_t get_workspace(fallback::ConvolutionBackwardDataImpl*,
  30. const NCBKernSizeParam& param) const override;
  31. ncb_kern_t dispatch_kern(fallback::ConvolutionBackwardDataImpl*,
  32. const NCBKernSizeParam&) const override;
  33. MEGDNN_DECL_ALGO_TYPE(ARM_COMMON_DIRECT_STRD1_DOT_QU8)
  34. };
  35. class ConvolutionBackwardDataImpl::AlgoUdot8DirectStride2 final
  36. : public AlgoBase {
  37. public:
  38. AlgoAttribute attribute() const override {
  39. return AlgoAttribute::REPRODUCIBLE;
  40. }
  41. const char* name() const override {
  42. return "ARM_COMMON_QUINT8_DIRECT_DECONV_STRIDE2";
  43. }
  44. bool usable(fallback::ConvolutionBackwardDataImpl*,
  45. const NCBKernSizeParam& param) const override;
  46. size_t get_workspace(fallback::ConvolutionBackwardDataImpl*,
  47. const NCBKernSizeParam& param) const override;
  48. ncb_kern_t dispatch_kern(fallback::ConvolutionBackwardDataImpl*,
  49. const NCBKernSizeParam&) const override;
  50. MEGDNN_DECL_ALGO_TYPE(ARM_COMMON_DIRECT_STRD2_DOT_QU8)
  51. };
  52. #endif
  53. } // namespace arm_common
  54. } // namespace megdnn
  55. // vim: syntax=cpp.doxygen

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