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.

convolution.h 2.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include <gtest/gtest.h>
  3. #include "megdnn/basic_types.h"
  4. #include "megdnn/handle.h"
  5. #include "megdnn/opr_param_defs.h"
  6. #include "test/common/checker.h"
  7. namespace megdnn {
  8. namespace test {
  9. namespace convolution {
  10. struct TestArg {
  11. param::Convolution param;
  12. TensorShape src, filter;
  13. TestArg(param::Convolution param, TensorShape src, TensorShape filter)
  14. : param(param), src(src), filter(filter) {}
  15. };
  16. std::vector<TestArg> get_args_common();
  17. std::vector<TestArg> get_args_padding();
  18. std::vector<TestArg> get_args_large_channel();
  19. std::vector<TestArg> get_args_1x1();
  20. std::vector<TestArg> get_args_large_filter();
  21. std::vector<TestArg> get_args_exhaustive_search();
  22. std::vector<TestArg> get_args_4x4();
  23. std::vector<TestArg> get_args_large_channels();
  24. std::vector<TestArg> get_args_x86_direct_case_2();
  25. std::vector<TestArg> get_args_fallback_templated_impl();
  26. std::vector<TestArg> get_args_fallback_non_templated_impl();
  27. std::vector<TestArg> get_args_cudnn_5_1_failures();
  28. std::vector<TestArg> get_args_cudnn_5_1_backward();
  29. std::vector<TestArg> get_args_x86_winograd_algorithm();
  30. std::vector<TestArg> get_args_BRAIN_481();
  31. std::vector<TestArg> get_args();
  32. std::vector<TestArg> get_args_cuda_conv_bwd_data();
  33. std::vector<TestArg> get_args_cudnn_7_5_failures();
  34. std::vector<TestArg> get_1x1_args();
  35. std::vector<TestArg> get_dilated_args();
  36. std::vector<TestArg> get_chanwise_args();
  37. std::vector<TestArg> get_args_int8_nchw4_conv_bwd_data();
  38. std::vector<TestArg> get_args_int8_nchw_conv_bwd_data();
  39. std::vector<TestArg> get_args_int8_nhwc_conv_bwd_data();
  40. //! \param stage 0 for fwd, 1 for bwd data, 2 for bwd filter
  41. using ConvEPSGetter = std::function<float(bool f16, int stage, const char* algo_name)>;
  42. //! check for various conv configurations (dilation, group, stride, padding)
  43. //! and run all usable algorithms
  44. void test_conv_config_combinations(
  45. int k_size, Handle* handle, bool test_int8, bool test_backward, bool is_cuda,
  46. ConvEPSGetter conv_eps_getter = [](bool f16, int, const char*) -> float {
  47. return f16 ? 1e-1 : 1e-3;
  48. },
  49. bool use_io16xc32 = false);
  50. } // namespace convolution
  51. } // namespace test
  52. } // namespace megdnn
  53. // vim: syntax=cpp.doxygen