Navigation
API > API/Runtime > API/Runtime/Core
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ParallelForWithExistingTaskContext
(
TArrayView< ContextType > Contexts, |
General purpose parallel for that uses the taskgraph. | Async/ParallelFor.h | |
void ParallelForWithExistingTaskContext
(
const TCHAR* DebugName, |
General purpose parallel for that uses the taskgraph. | Async/ParallelFor.h |
ParallelForWithExistingTaskContext(TArrayView< ContextType >, int32, int32, const FunctionType &, EParallelForFlags)
Description
General purpose parallel for that uses the taskgraph. This variant takes an array of user-defined context objects for each task that may get spawned to do work (one task per context at most), and passes them to the loop body to give it a task-local "workspace" that can be mutated without need for synchronization primitives.
| Name | ParallelForWithExistingTaskContext |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Async/ParallelFor.h |
| Include Path | #include "Async/ParallelFor.h" |
template<typename ContextType, typename FunctionType>
void ParallelForWithExistingTaskContext
(
TArrayView < ContextType > Contexts,
int32 Num,
int32 MinBatchSize,
const FunctionType & Body,
EParallelForFlags Flags
)
Parameters
| Name | Remarks |
|---|---|
| Contexts; | User-privided array of user-defined task-level context objects |
| Num; | number of calls of Body; Body(0), Body(1)....Body(Num - 1) |
| MinBatchSize; | Minimum Size of a Batch (will only launch DivUp(Num, MinBatchSize) Workers |
| Body; | Function to call from multiple threads |
| Flags; | Used to customize the behavior of the ParallelFor if needed. Notes: Please add stats around to calls to parallel for and within your lambda as appropriate. Do not clog the task graph with long running tasks or tasks that block. |
ParallelForWithExistingTaskContext(const TCHAR *, TArrayView< ContextType >, int32, int32, const FunctionType &, EParallelForFlags)
Description
General purpose parallel for that uses the taskgraph. This variant takes an array of user-defined context objects for each task that may get spawned to do work (one task per context at most), and passes them to the loop body to give it a task-local "workspace" that can be mutated without need for synchronization primitives.
| Name | ParallelForWithExistingTaskContext |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Async/ParallelFor.h |
| Include Path | #include "Async/ParallelFor.h" |
template<typename ContextType, typename FunctionType>
void ParallelForWithExistingTaskContext
(
const TCHAR * DebugName,
TArrayView < ContextType > Contexts,
int32 Num,
int32 MinBatchSize,
const FunctionType & Body,
EParallelForFlags Flags
)
Parameters
| Name | Remarks |
|---|---|
| DebugName; | ProfilingScope and Debugname |
| Contexts; | User-privided array of user-defined task-level context objects |
| Num; | number of calls of Body; Body(0), Body(1)....Body(Num - 1) |
| MinBatchSize; | Minimum Size of a Batch (will only launch DivUp(Num, MinBatchSize) Workers |
| Body; | Function to call from multiple threads |
| Flags; | Used to customize the behavior of the ParallelFor if needed. Notes: Please add stats around to calls to parallel for and within your lambda as appropriate. Do not clog the task graph with long running tasks or tasks that block. |