27 #ifndef EMBB_MTAPI_TASK_CONTEXT_H_ 28 #define EMBB_MTAPI_TASK_CONTEXT_H_ 30 #include <embb/mtapi/c/mtapi.h> 31 #include <embb/mtapi/internal/check_status.h> 48 mtapi_task_context_t * task_context
51 : context_(task_context) {
70 mtapi_status_t status;
71 mtapi_task_state_t result =
73 internal::CheckStatus(status);
83 mtapi_status_t status;
85 internal::CheckStatus(status);
95 mtapi_status_t status;
97 internal::CheckStatus(status);
107 mtapi_status_t status;
109 internal::CheckStatus(status);
119 mtapi_status_t error_code
123 mtapi_status_t status;
125 internal::CheckStatus(status);
143 mtapi_task_context_t * context_;
149 #endif // EMBB_MTAPI_TASK_CONTEXT_H_ Definition: lock_free_mpmc_queue.h:40
mtapi_uint_t mtapi_context_corenum_get(const mtapi_task_context_t *task_context, mtapi_status_t *status)
This function can be called from an action function to query the current core number for debugging pu...
mtapi_uint_t mtapi_context_numinst_get(const mtapi_task_context_t *task_context, mtapi_status_t *status)
This function can be called from an action function to query the total number of parallel task instan...
mtapi_uint_t GetInstanceNumber()
Queries the current instance of the currently executing Task.
Definition: task_context.h:94
mtapi_uint_t mtapi_context_instnum_get(const mtapi_task_context_t *task_context, mtapi_status_t *status)
This function can be called from an action function to query the instance number of the associated ta...
mtapi_task_context_t * GetInternal() const
Returns the internal representation of this object.
Definition: task_context.h:135
mtapi_task_state_t GetTaskState()
Queries the current Task state.
Definition: task_context.h:69
mtapi_task_state_t mtapi_context_taskstate_get(const mtapi_task_context_t *task_context, mtapi_status_t *status)
An action function may call this function to obtain the state of the task that is associated with the...
TaskContext(mtapi_task_context_t *task_context)
Constructs a TaskContext from the given C representation.
Definition: task_context.h:47
void SetStatus(mtapi_status_t error_code)
Sets the return status of the running Task.
Definition: task_context.h:118
mtapi_uint_t GetNumberOfInstances()
Queries the number of instances of the currently executing Task.
Definition: task_context.h:106
bool ShouldCancel()
Queries whether the Task running in the TaskContext should finish.
Definition: task_context.h:60
mtapi_uint_t GetCurrentWorkerNumber()
Queries the index of the worker thread the Task is running on.
Definition: task_context.h:82
void mtapi_context_status_set(mtapi_task_context_t *task_context, const mtapi_status_t error_code, mtapi_status_t *status)
This function can be called from an action function to set the status that can be obtained by a subse...
Provides information about the status of the currently running Task.
Definition: task_context.h:41