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 2.0 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * \file dnn/src/x86/conv_bias/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
  10. * implied.
  11. */
  12. #pragma once
  13. #include "src/common/utils.h"
  14. #include "src/fallback/conv_bias/opr_impl.h"
  15. namespace megdnn {
  16. namespace x86 {
  17. class ConvBiasImpl : public fallback::ConvBiasImpl {
  18. public:
  19. using fallback::ConvBiasImpl::ConvBiasImpl;
  20. using FallbackConvBiasImpl = fallback::ConvBiasImpl;
  21. bool is_thread_safe() const override { return true; }
  22. SmallVector<AlgoBase*> algo_pack() override;
  23. class AlgoDirect;
  24. class AlgoDirectStride2;
  25. class AlgoFP32WinogradF63_8x8;
  26. class AlgoFP32WinogradF23_8x8;
  27. class AlgoMatrixMul;
  28. class AlgoDirectAvx2Stride1Int8;
  29. class AlgoAVX2DirectConvStride2;
  30. class AlgoChanWiseAvx2Stride1Qint8;
  31. class AlgoChanWiseAvx2Stride2Qint8;
  32. #if MEGDNN_X86_WITH_MKL_DNN
  33. class AlgoMkldnnConv;
  34. class AlgoMkldnnQint8;
  35. class AlgoMkldnnMatmulQint8;
  36. #endif
  37. class AlgoPack;
  38. /**
  39. * \brief Adjust tensor layouts to fulfill alignment requirements.
  40. * OW2 would be 8-byte aligned.
  41. * IH2/IW2 would be adjusted to fit OH2/OW2.
  42. * The influence of padding would be incorporated in IH2/IW2.
  43. */
  44. static void get_rectified_img_size(size_t IH, size_t IW, size_t FH,
  45. size_t FW, size_t OH, size_t OW,
  46. size_t PH, size_t PW, size_t& IH2,
  47. size_t& IW2, size_t& OH2, size_t& OW2);
  48. const char* get_algorithm_set_name() const override;
  49. bool is_matmul_quantized_prefer(
  50. const ConvBiasImpl::NCBKernSizeParam& ncb_param) override;
  51. };
  52. } // namespace x86
  53. } // namespace megdnn
  54. // vim: syntax=cpp.doxygen

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