10 #include <type_traits>
17 template<
typename TCallable>
20 auto const start = std::chrono::high_resolution_clock::now();
21 std::forward<TCallable>(callable)();
22 auto const end = std::chrono::high_resolution_clock::now();
23 return std::chrono::duration_cast<std::chrono::milliseconds>(
end - start).count();
27 template<
typename TQueue,
typename TTask>
30 #if ALPAKA_DEBUG >= ALPAKA_DEBUG_MINIMAL
31 std::cout <<
"measureKernelRunTime("
32 <<
" queue: " << core::demangled<TQueue> <<
" task: " << core::demangled<std::decay_t<TTask>> <<
")"
auto measureTaskRunTimeMs(TQueue &queue, TTask &&task) -> std::chrono::milliseconds::rep
auto measureRunTimeMs(TCallable &&callable) -> std::chrono::milliseconds::rep
Measures and returns the runtime in ms of the passed callable.
ALPAKA_FN_HOST auto end(TView &view) -> Iterator< TView >
ALPAKA_FN_HOST auto enqueue(TQueue &queue, TTask &&task) -> void
Queues the given task in the given queue.
ALPAKA_FN_HOST auto wait(TAwaited const &awaited) -> void
Waits the thread for the completion of the given awaited action to complete.