MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / detach_async

Function detach_async

test/verify/run_verify.cpp:47–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45// An improved async, that doesn't block
46template <class Function>
47static std::future<std::invoke_result_t<Function>> detach_async(Function&& f, bool parallel = true)
48{
49 if(parallel)
50 {
51 using result_type = typename std::invoke_result<Function>::type;
52 std::packaged_task<result_type()> task(std::forward<Function>(f));
53 auto fut = task.get_future();
54 std::thread(std::move(task)).detach();
55 return fut;
56 }
57 return std::async(std::launch::deferred, std::forward<Function>(f));
58}
59
60inline static void verify_load_save(const migraphx::program& p)
61{

Callers 1

verifyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected