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

Method profile

src/rdnn/impl/profiler.cpp:402–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400
401template <typename Opr>
402Maybe<typename TimedProfiler<Opr>::Result> TimedProfiler<Opr>::profile(
403 const Param& param, double& timeout) {
404 mgb_assert(timeout >= 0);
405 if (!timeout) {
406 timeout = timeout_setting;
407 } else if (timeout_setting) {
408 timeout = std::min(timeout, timeout_setting);
409 }
410 param.actual_timeout = timeout ? timeout : std::numeric_limits<double>::infinity();
411 auto res = sys::TimedFuncInvoker::ins().invoke(
412 AlgoChooserFuncId<Opr>::ID, TParam::from_pod(const_cast<Param&>(param)),
413 timeout);
414 if (res.valid())
415 return res.val().template as_single_pod<Result>();
416 return None;
417}
418
419template <typename Opr>
420void TimedProfiler<Opr>::prof_init_device(const TParam& raw_param) {

Callers

nothing calls this directly

Calls 3

minFunction · 0.50
invokeMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected