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.

null.cpp 923 B

12345678910111213141516171819202122232425262728293031
  1. #include <gtest/gtest.h>
  2. #include "megdnn/oprs.h"
  3. #include "test/common/null_dispatcher.h"
  4. #include "test/common/tensor.h"
  5. #include "test/common/utils.h"
  6. #include "test/common/workspace_wrapper.h"
  7. namespace megdnn {
  8. namespace test {
  9. #if !MEGDNN_NO_THREAD
  10. TEST(DISPATCHER, NULL_DISPATCHER) {
  11. std::shared_ptr<MegcoreCPUDispatcher> dispatcher =
  12. std::make_shared<NullDispatcher>();
  13. auto handle = create_cpu_handle_with_dispatcher(0, dispatcher);
  14. auto opr = handle->create_operator<Convolution>();
  15. auto layout = TensorLayout({1, 1, 1, 1}, dtype::Float32());
  16. TensorND src(nullptr, layout), filter(nullptr, layout), dst(nullptr, layout);
  17. auto wsize = opr->get_workspace_in_bytes(layout, layout, layout, nullptr);
  18. Workspace workspace(nullptr, wsize);
  19. opr->exec(src, filter, dst, nullptr, workspace);
  20. }
  21. #endif
  22. } // namespace test
  23. } // namespace megdnn
  24. // vim: syntax=cpp.doxygen