📄 ppl.h
字号:
_Task_group.run(_Task_handle2);
task_handle<_Function3> _Task_handle3(_Func3);
_Task_group.run_and_wait(_Task_handle3);
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_END);
}
/// <summary>
/// Executes the function objects supplied as parameters in parallel, and blocks until they have finished executing. Each function object
/// could be a lambda expression, a pointer to function, or any object that supports the function call operator with the signature
/// <c>void operator()()</c>.
/// </summary>
/// <typeparam name="_Function1">
/// The type of the first function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function2">
/// The type of the second function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function3">
/// The type of the third function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function4">
/// The type of the fourth function object to be executed in parallel.
/// </typeparam>
/// <param name="_Func1">
/// The first function object to be executed in parallel.
/// </param>
/// <param name="_Func2">
/// The second function object to be executed in parallel.
/// </param>
/// <param name="_Func3">
/// The third function object to be executed in parallel.
/// </param>
/// <param name="_Func4">
/// The fourth function object to be executed in parallel.
/// </param>
/// <remarks>
/// Note that one or more of the function objects supplied as parameters may execute inline on the calling context.
/// <para>If one or more of the function objects passed as parameters to this function throws an exception, the
/// runtime will select one such exception of its choosing and propagate it out of the call to <c>parallel_invoke</c>.</para>
/// <para>For more information, see <see cref="Parallel Algorithms"/>.</para>
/// </remarks>
/**/
template <typename _Function1, typename _Function2, typename _Function3, typename _Function4>
void parallel_invoke(const _Function1& _Func1, const _Function2& _Func2, const _Function3& _Func3, const _Function4& _Func4)
{
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_START);
structured_task_group _Task_group;
task_handle<_Function1> _Task_handle1(_Func1);
_Task_group.run(_Task_handle1);
task_handle<_Function2> _Task_handle2(_Func2);
_Task_group.run(_Task_handle2);
task_handle<_Function3> _Task_handle3(_Func3);
_Task_group.run(_Task_handle3);
task_handle<_Function4> _Task_handle4(_Func4);
_Task_group.run_and_wait(_Task_handle4);
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_END);
}
/// <summary>
/// Executes the function objects supplied as parameters in parallel, and blocks until they have finished executing. Each function object
/// could be a lambda expression, a pointer to function, or any object that supports the function call operator with the signature
/// <c>void operator()()</c>.
/// </summary>
/// <typeparam name="_Function1">
/// The type of the first function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function2">
/// The type of the second function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function3">
/// The type of the third function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function4">
/// The type of the fourth function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function5">
/// The type of the fifth function object to be executed in parallel.
/// </typeparam>
/// <param name="_Func1">
/// The first function object to be executed in parallel.
/// </param>
/// <param name="_Func2">
/// The second function object to be executed in parallel.
/// </param>
/// <param name="_Func3">
/// The third function object to be executed in parallel.
/// </param>
/// <param name="_Func4">
/// The fourth function object to be executed in parallel.
/// </param>
/// <param name="_Func5">
/// The fifth function object to be executed in parallel.
/// </param>
/// <remarks>
/// Note that one or more of the function objects supplied as parameters may execute inline on the calling context.
/// <para>If one or more of the function objects passed as parameters to this function throws an exception, the
/// runtime will select one such exception of its choosing and propagate it out of the call to <c>parallel_invoke</c>.</para>
/// <para>For more information, see <see cref="Parallel Algorithms"/>.</para>
/// </remarks>
/**/
template <typename _Function1, typename _Function2, typename _Function3, typename _Function4, typename _Function5>
void parallel_invoke(const _Function1& _Func1, const _Function2& _Func2, const _Function3& _Func3, const _Function4& _Func4, const _Function5& _Func5)
{
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_START);
structured_task_group _Task_group;
task_handle<_Function1> _Task_handle1(_Func1);
_Task_group.run(_Task_handle1);
task_handle<_Function2> _Task_handle2(_Func2);
_Task_group.run(_Task_handle2);
task_handle<_Function3> _Task_handle3(_Func3);
_Task_group.run(_Task_handle3);
task_handle<_Function4> _Task_handle4(_Func4);
_Task_group.run(_Task_handle4);
task_handle<_Function5> _Task_handle5(_Func5);
_Task_group.run_and_wait(_Task_handle5);
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_END);
}
/// <summary>
/// Executes the function objects supplied as parameters in parallel, and blocks until they have finished executing. Each function object
/// could be a lambda expression, a pointer to function, or any object that supports the function call operator with the signature
/// <c>void operator()()</c>.
/// </summary>
/// <typeparam name="_Function1">
/// The type of the first function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function2">
/// The type of the second function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function3">
/// The type of the third function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function4">
/// The type of the fourth function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function5">
/// The type of the fifth function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function6">
/// The type of the sixth function object to be executed in parallel.
/// </typeparam>
/// <param name="_Func1">
/// The first function object to be executed in parallel.
/// </param>
/// <param name="_Func2">
/// The second function object to be executed in parallel.
/// </param>
/// <param name="_Func3">
/// The third function object to be executed in parallel.
/// </param>
/// <param name="_Func4">
/// The fourth function object to be executed in parallel.
/// </param>
/// <param name="_Func5">
/// The fifth function object to be executed in parallel.
/// </param>
/// <param name="_Func6">
/// The sixth function object to be executed in parallel.
/// </param>
/// <remarks>
/// Note that one or more of the function objects supplied as parameters may execute inline on the calling context.
/// <para>If one or more of the function objects passed as parameters to this function throws an exception, the
/// runtime will select one such exception of its choosing and propagate it out of the call to <c>parallel_invoke</c>.</para>
/// <para>For more information, see <see cref="Parallel Algorithms"/>.</para>
/// </remarks>
/**/
template <typename _Function1, typename _Function2, typename _Function3, typename _Function4, typename _Function5,
typename _Function6>
void parallel_invoke(const _Function1& _Func1, const _Function2& _Func2, const _Function3& _Func3, const _Function4& _Func4, const _Function5& _Func5,
const _Function6& _Func6)
{
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_START);
structured_task_group _Task_group;
task_handle<_Function1> _Task_handle1(_Func1);
_Task_group.run(_Task_handle1);
task_handle<_Function2> _Task_handle2(_Func2);
_Task_group.run(_Task_handle2);
task_handle<_Function3> _Task_handle3(_Func3);
_Task_group.run(_Task_handle3);
task_handle<_Function4> _Task_handle4(_Func4);
_Task_group.run(_Task_handle4);
task_handle<_Function5> _Task_handle5(_Func5);
_Task_group.run(_Task_handle5);
task_handle<_Function6> _Task_handle6(_Func6);
_Task_group.run_and_wait(_Task_handle6);
_Trace_ppl_function(PPLParallelInvokeEventGuid, _TRACE_LEVEL_INFORMATION, CONCRT_EVENT_END);
}
/// <summary>
/// Executes the function objects supplied as parameters in parallel, and blocks until they have finished executing. Each function object
/// could be a lambda expression, a pointer to function, or any object that supports the function call operator with the signature
/// <c>void operator()()</c>.
/// </summary>
/// <typeparam name="_Function1">
/// The type of the first function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function2">
/// The type of the second function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function3">
/// The type of the third function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function4">
/// The type of the fourth function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function5">
/// The type of the fifth function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function6">
/// The type of the sixth function object to be executed in parallel.
/// </typeparam>
/// <typeparam name="_Function7">
/// The type of the seventh function object to be executed in parallel.
/// </typeparam>
/// <param name="_Func1">
/// The first function object to be executed in parallel.
/// </param>
/// <param name="_Func2">
/// The second function object to be executed in parallel.
/// </param>
/// <param name="_Func3">
/// The third function object to be executed in parallel.
/// </param>
/// <param name="_Func4">
/// The fourth function object to be executed in parallel.
/// </param>
/// <param name="_Func5">
/// The fifth function object to be executed in parallel.
/// </param>
/// <param name="_Func6">
/// The sixth function object to be executed in parallel.
/// </param>
/// <param name="_Func7">
/// The seventh function object to be executed in parallel.
/// </param>
/// <remarks>
/// Note that one or more of the function objects supplied as parameters may execute inline on the calling context.
/// <para>If one or more of the function objects passed as parameters to this function throws an exception, the
/// runtime will select one such exception of its choosing and propagate it out of the call to <c>parallel_invoke</c>.</para>
/// <para>For more information, see <see cref="Parallel Algorithms"/>.</para>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -