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_common.cpp 1.4 kB

1234567891011121314151617181920212223242526272829303132
  1. #include "src/common/warp_common.h"
  2. using namespace megdnn;
  3. bool warp::is_cv_available(
  4. const TensorLayout& src, const TensorLayout& /*mat*/,
  5. const TensorLayout& /*dst*/, param::WarpAffine::InterpolationMode imode,
  6. param::WarpAffine::Format format) {
  7. return format == param::WarpAffine::Format::NHWC &&
  8. (src[3] == 1 || src[3] == 2 || src[3] == 3) &&
  9. (src.dtype == dtype::Float32() || src.dtype == dtype::Uint8()) &&
  10. (imode == param::WarpAffine::InterpolationMode::NEAREST ||
  11. imode == param::WarpAffine::InterpolationMode::LINEAR ||
  12. imode == param::WarpAffine::InterpolationMode::CUBIC ||
  13. imode == param::WarpAffine::InterpolationMode::LANCZOS4);
  14. }
  15. bool warp::is_dnn_available(
  16. const TensorLayout& /*src*/, const TensorLayout& /*mat*/,
  17. const TensorLayout& /*dst*/, param::WarpAffine::InterpolationMode imode,
  18. param::WarpAffine::Format /*format*/) {
  19. return imode == param::WarpAffine::InterpolationMode::LINEAR;
  20. }
  21. bool warp::is_dnn_available(
  22. const TensorLayoutArray& /*src*/, const TensorLayout& /*mat*/,
  23. const TensorLayout& /*dst*/, param::WarpAffine::InterpolationMode imode,
  24. param::WarpAffine::Format /*format*/) {
  25. return imode == param::WarpAffine::InterpolationMode::LINEAR;
  26. }
  27. // vim: syntax=cpp.doxygen