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

Function TEST_F

dnn/test/cuda/chanwise_convolution.cpp:248–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246constexpr auto M = Convolution::Mode::CROSS_CORRELATION;
247
248TEST_F(CUDA, CHANWISE_CONVOLUTION_FORWARD) {
249 Checker<Convolution> checker(handle_cuda());
250 bool require_algo = false;
251 checker.set_before_exec_callback(AlgoChecker<ConvolutionForward>(
252 ExecutionPolicyAlgoName{
253 "DEFAULT",
254 {{ConvBiasForward::algo_name<ConvBiasForward::DirectParam>(
255 "CHANNEL_WISE", {})
256 .c_str(),
257 {}}}},
258 &require_algo));
259
260 for (auto dtype : std::vector<DType>{dtype::Float32(), dtype::Float16()}) {
261 checker.set_dtype(0, dtype).set_dtype(1, dtype).set_dtype(2, dtype);
262 if (dtype.enumv() == DTypeEnum::Float16)
263 checker.set_epsilon(2e-2);
264
265 // simple case
266 // clang-format off
267 for (uint32_t s : {1, 2})
268 for (uint32_t p : {0, 1, 2, 3})
269 for (size_t f : {2, 3, 5, 7})
270 for (size_t ocpg : {1, 3}) {
271 checker.set_param(gconv_param({M, p, p, s, s}))
272 .execs({{2, 3, 16, 16}, {3, ocpg, 1, f, f}, {}});
273 }
274 // clang-format on
275
276 checker.set_param(gconv_param({M, 2, 3, 2, 1}))
277 .execs({{32, 12, 20, 10}, {12, 2, 1, 4, 5}, {}});
278
279 // padding larger than kern
280 checker.set_param(gconv_param({M, 20, 30, 4, 5}))
281 .execs({{32, 12, 20, 10}, {12, 2, 1, 4, 5}, {}});
282 }
283}
284
285TEST_F(CUDA, CHANWISE_CONVOLUTION_FORWARD_SMALL) {
286 Checker<Convolution> checker(handle_cuda());

Callers

nothing calls this directly

Calls 15

set_dtypeMethod · 0.80
exec_convolutionMethod · 0.80
gconv_paramFunction · 0.70
check_need_full_benchFunction · 0.70
runFunction · 0.50
enumvMethod · 0.45
execsMethod · 0.45
allocMethod · 0.45
fill_srcMethod · 0.45
fill_fltMethod · 0.45
getMethod · 0.45
cmp_dstMethod · 0.45

Tested by

no test coverage detected