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.

flip.cpp 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * \file dnn/test/fallback/flip.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 <gtest/gtest.h>
  12. #include "megdnn.h"
  13. #include "megdnn/oprs.h"
  14. #include "test/common/checker.h"
  15. #include "test/common/flip.h"
  16. #include "test/common/task_record_check.h"
  17. #include "test/common/tensor.h"
  18. #include "test/fallback/fixture.h"
  19. namespace megdnn {
  20. namespace test {
  21. TEST_F(FALLBACK, FLIP) {
  22. using namespace flip;
  23. std::vector<TestArg> args = get_args();
  24. Checker<Flip> checker(handle());
  25. checker.set_dtype(0, dtype::Int32());
  26. checker.set_dtype(1, dtype::Int32());
  27. for (auto&& arg : args) {
  28. checker.execs({arg.src, {}});
  29. }
  30. }
  31. TEST_F(FALLBACK, FLIP_RECORD) {
  32. using namespace flip;
  33. std::vector<TestArg> args = get_args();
  34. TaskRecordChecker<Flip> checker(0);
  35. checker.set_dtype(0, dtype::Int32());
  36. checker.set_dtype(1, dtype::Int32());
  37. for (auto&& arg : args) {
  38. checker.execs({arg.src, {}});
  39. }
  40. }
  41. } // namespace test
  42. } // namespace megdnn
  43. // vim: syntax=cpp.doxygen