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

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * \file dnn/test/cuda/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/cuda/fixture.h"
  14. namespace megdnn {
  15. namespace test {
  16. TEST_F(CUDA, GAUSSIAN_BLUR) {
  17. using namespace gaussian_blur;
  18. std::vector<TestArg> args = get_args();
  19. Checker<GaussianBlur> checker(handle_cuda());
  20. for (auto&& arg : args) {
  21. checker.set_param(arg.param)
  22. .set_dtype(0, dtype::Float32())
  23. .set_dtype(1, dtype::Float32())
  24. .execs({arg.src, {}});
  25. }
  26. for (auto&& arg : args) {
  27. checker.set_param(arg.param)
  28. .set_epsilon(1 + 1e-3)
  29. .set_dtype(0, dtype::Uint8())
  30. .set_dtype(1, dtype::Uint8())
  31. .execs({arg.src, {}});
  32. }
  33. }
  34. } // namespace test
  35. } // namespace megdnn
  36. // vim: syntax=cpp.doxygen