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

Method exec

dnn/src/naive/svd/opr_impl.cpp:367–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367void SVDForwardImpl::exec(
368 _megdnn_tensor_in src, _megdnn_tensor_out u, _megdnn_tensor_out s,
369 _megdnn_tensor_out vt, _megdnn_workspace workspace) {
370#if !MGE_BUILD_WITHOUT_NAIVE_EXEC
371 check_exec(src.layout, u.layout, s.layout, vt.layout, workspace.size);
372
373 Param p = param();
374 megdnn_assert(
375 !p.compute_uv || !p.full_matrices,
376 "Computing full singular vectors is not supported in naive "
377 "implementation.");
378 size_t block_cnt, m, n;
379 canonize_params(src.layout, &block_cnt, &m, &n);
380 if (src.layout.dtype == dtype::Float32()) {
381 using ctype = typename DTypeTrait<dtype::Float32>::ctype;
382 auto wbundle = get_workspace_bundle(m, n, sizeof(ctype), workspace.raw_ptr);
383 MEGDNN_DISPATCH_CPU_KERN_OPR(
384 exec_internal<ctype>(src, u, s, vt, p, wbundle, block_cnt, m, n));
385 return;
386 }
387 megdnn_assert_internal(0);
388#else
389 __builtin_trap();
390#endif
391}
392
393} // namespace naive
394} // namespace megdnn

Callers

nothing calls this directly

Calls 2

paramFunction · 0.50
get_workspace_bundleFunction · 0.50

Tested by

no test coverage detected