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 1.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * \file dnn/test/cpu/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/common/checker.h"
  13. #include "test/cpu/fixture.h"
  14. namespace megdnn {
  15. namespace test {
  16. TEST_F(CPU, WARP_AFFINE_CV) {
  17. using namespace warp_affine;
  18. std::vector<TestArg> args = get_cv_args();
  19. Checker<WarpAffine> checker(handle());
  20. for (auto&& arg : args) {
  21. checker.set_param(arg.param)
  22. .set_dtype(0, dtype::Uint8())
  23. .set_dtype(1, dtype::Float32())
  24. .set_dtype(2, dtype::Uint8())
  25. .execs({arg.src, arg.trans, arg.dst});
  26. }
  27. for (auto&& arg : args) {
  28. checker.set_param(arg.param)
  29. .set_dtype(0, dtype::Float32())
  30. .set_dtype(1, dtype::Float32())
  31. .set_dtype(2, dtype::Float32())
  32. .execs({arg.src, arg.trans, arg.dst});
  33. }
  34. }
  35. } // namespace test
  36. } // namespace megdnn
  37. // vim: syntax=cpp.doxygen