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.

gaussian_blur.cpp 1.5 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "test/common/gaussian_blur.h"
  2. #include "test/common/checker.h"
  3. #include "test/common/task_record_check.h"
  4. #include "test/fallback/fixture.h"
  5. namespace megdnn {
  6. namespace test {
  7. TEST_F(FALLBACK, GAUSSIAN_BLUR) {
  8. using namespace gaussian_blur;
  9. std::vector<TestArg> args = get_args();
  10. Checker<GaussianBlur> checker(handle());
  11. for (auto&& arg : args) {
  12. checker.set_param(arg.param)
  13. .set_dtype(0, dtype::Float32())
  14. .set_dtype(1, dtype::Float32())
  15. .execs({arg.src, {}});
  16. }
  17. for (auto&& arg : args) {
  18. checker.set_param(arg.param)
  19. .set_epsilon(1 + 1e-3)
  20. .set_dtype(0, dtype::Uint8())
  21. .set_dtype(1, dtype::Uint8())
  22. .execs({arg.src, {}});
  23. }
  24. }
  25. TEST_F(FALLBACK, GAUSSIAN_BLUR_RECORD) {
  26. using namespace gaussian_blur;
  27. std::vector<TestArg> args = get_args();
  28. TaskRecordChecker<GaussianBlur> checker(1);
  29. for (auto&& arg : args) {
  30. checker.set_param(arg.param)
  31. .set_dtype(0, dtype::Float32())
  32. .set_dtype(1, dtype::Float32())
  33. .execs({arg.src, {}});
  34. }
  35. for (auto&& arg : args) {
  36. checker.set_param(arg.param)
  37. .set_epsilon(1 + 1e-3)
  38. .set_dtype(0, dtype::Uint8())
  39. .set_dtype(1, dtype::Uint8())
  40. .execs({arg.src, {}});
  41. }
  42. }
  43. } // namespace test
  44. } // namespace megdnn
  45. // vim: syntax=cpp.doxygen