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.

warp_affine.cpp 2.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * \file dnn/test/arm_common/warp_affine.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/warp_affine.h"
  12. #include "test/arm_common/fixture.h"
  13. #include "test/common/checker.h"
  14. #include "test/common/task_record_check.h"
  15. namespace megdnn {
  16. namespace test {
  17. TEST_F(ARM_COMMON_MULTI_THREADS, WARP_AFFINE_CV) {
  18. using namespace warp_affine;
  19. std::vector<TestArg> args = get_cv_args();
  20. Checker<WarpAffine> checker(handle());
  21. for (auto&& arg : args) {
  22. checker.set_param(arg.param)
  23. .set_epsilon(1 + 1e-3)
  24. .set_dtype(0, dtype::Uint8())
  25. .set_dtype(1, dtype::Float32())
  26. .set_dtype(2, dtype::Uint8())
  27. .execs({arg.src, arg.trans, arg.dst});
  28. }
  29. for (auto&& arg : args) {
  30. checker.set_param(arg.param)
  31. .set_dtype(0, dtype::Float32())
  32. .set_dtype(1, dtype::Float32())
  33. .set_dtype(2, dtype::Float32())
  34. .execs({arg.src, arg.trans, arg.dst});
  35. }
  36. }
  37. TEST_F(ARM_COMMON_MULTI_THREADS, WARP_AFFINE_CV_RECORD) {
  38. using namespace warp_affine;
  39. std::vector<TestArg> args = get_cv_args();
  40. TaskRecordChecker<WarpAffine> checker(0);
  41. for (auto&& arg : args) {
  42. checker.set_param(arg.param)
  43. .set_epsilon(1 + 1e-3)
  44. .set_dtype(0, dtype::Uint8())
  45. .set_dtype(1, dtype::Float32())
  46. .set_dtype(2, dtype::Uint8())
  47. .execs({arg.src, arg.trans, arg.dst});
  48. }
  49. for (auto&& arg : args) {
  50. checker.set_param(arg.param)
  51. .set_dtype(0, dtype::Float32())
  52. .set_dtype(1, dtype::Float32())
  53. .set_dtype(2, dtype::Float32())
  54. .execs({arg.src, arg.trans, arg.dst});
  55. }
  56. }
  57. } // namespace test
  58. } // namespace megdnn
  59. // vim: syntax=cpp.doxygen