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.

convolution3d.h 1.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 convolution3d {
  10. struct TestArg {
  11. param::Convolution3D param;
  12. TensorShape src, filter;
  13. TestArg(param::Convolution3D param, TensorShape src, TensorShape filter)
  14. : param(param), src(src), filter(filter) {}
  15. };
  16. std::vector<TestArg> get_args();
  17. std::vector<TestArg> get_1x1x1_args();
  18. std::vector<TestArg> get_dilated_args();
  19. std::vector<TestArg> get_chanwise_args();
  20. std::vector<TestArg> get_speed_test_args();
  21. //! \param stage 0 for fwd, 1 for bwd data, 2 for bwd filter
  22. using ConvEPSGetter = std::function<float(bool f16, int stage, const char* algo_name)>;
  23. //! check for various conv configurations (dilation, group, stride, padding)
  24. //! and run all usable algorithms
  25. void test_conv_config_combinations(
  26. Handle* handle, bool test_int8, bool test_backward, bool is_cuda,
  27. ConvEPSGetter conv_eps_getter = [](bool f16, int, const char*) -> float {
  28. return f16 ? 1e-1 : 1e-3;
  29. });
  30. } // namespace convolution3d
  31. } // namespace test
  32. } // namespace megdnn
  33. // vim: syntax=cpp.doxygen