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.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * \file dnn/test/x86/gaussian_blur.cpp
  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 implied.
  10. */
  11. #include "test/common/gaussian_blur.h"
  12. #include "test/common/checker.h"
  13. #include "test/common/task_record_check.h"
  14. #include "test/x86/fixture.h"
  15. namespace megdnn {
  16. namespace test {
  17. TEST_F(X86, GAUSSIAN_BLUR) {
  18. using namespace gaussian_blur;
  19. std::vector<TestArg> args = get_args();
  20. Checker<GaussianBlur> checker(handle());
  21. for (auto&& arg : args) {
  22. checker.set_param(arg.param)
  23. .set_dtype(0, dtype::Float32())
  24. .set_dtype(1, dtype::Float32())
  25. .execs({arg.src, {}});
  26. }
  27. for (auto&& arg : args) {
  28. checker.set_param(arg.param)
  29. .set_epsilon(1 + 1e-3)
  30. .set_dtype(0, dtype::Uint8())
  31. .set_dtype(1, dtype::Uint8())
  32. .execs({arg.src, {}});
  33. }
  34. }
  35. TEST_F(X86, GAUSSIAN_BLUR_RECORD) {
  36. using namespace gaussian_blur;
  37. std::vector<TestArg> args = get_args();
  38. TaskRecordChecker<GaussianBlur> checker(0);
  39. auto arg = args[0];
  40. checker.set_param(arg.param)
  41. .set_dtype(0, dtype::Float32())
  42. .set_dtype(1, dtype::Float32())
  43. .execs({arg.src, {}});
  44. checker.set_param(arg.param)
  45. .set_epsilon(1 + 1e-3)
  46. .set_dtype(0, dtype::Uint8())
  47. .set_dtype(1, dtype::Uint8())
  48. .execs({arg.src, {}});
  49. }
  50. } // namespace test
  51. } // namespace megdnn
  52. // vim: syntax=cpp.doxygen