MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TEST_F

Function TEST_F

src/opr/test/dnn/convolution.cpp:2564–2586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2562};
2563
2564TEST_F(TestWeightPreprocess, NoPreprocessNeeded) {
2565 using ::testing::_;
2566 using ::testing::Return;
2567 auto& mock = mock_conv();
2568
2569 MockAlgorithm algo;
2570 EXPECT_CALL(mock, get_algorithm_heuristic(_, _, _, _, _, _))
2571 .WillRepeatedly(Return(&algo));
2572 EXPECT_CALL(mock, get_algorithm_from_desc(_)).WillRepeatedly(Return(&algo));
2573 EXPECT_CALL(mock, get_workspace_in_bytes(_, _, _, _)).WillRepeatedly(Return(0));
2574 EXPECT_CALL(mock, get_preprocess_workspace_in_bytes(_, _, _))
2575 .WillRepeatedly(Return(0));
2576
2577 {
2578 ::testing::InSequence seq;
2579 // Return empty preprocess filters, indicating no need to preprocess
2580 EXPECT_CALL(mock, deduce_preprocessed_filter_layout(_, _, _))
2581 .WillRepeatedly(Return(SmallVector<TensorLayout>{}));
2582 EXPECT_CALL(mock, exec_preprocess(_, _, _, _, _)).Times(0);
2583 EXPECT_CALL(mock, exec(_, _, _, nullptr, _));
2584 run();
2585 }
2586}
2587
2588TEST_F(TestWeightPreprocess, PreprocessCalledOnlyOnce) {
2589 megdnn::AlgorithmCache::instance().clear();

Callers

nothing calls this directly

Calls 7

runFunction · 0.70
get_workspace_in_bytesFunction · 0.50
execFunction · 0.50
clearMethod · 0.45
sizeMethod · 0.45
eq_shapeMethod · 0.45
raw_ptrMethod · 0.45

Tested by

no test coverage detected