/home/runner/work/HiCR/HiCR/include/hicr/frontends/tasking/task.hpp Source File
HiCR
|
task.hpp
Go to the documentation of this file.
101 __INLINE__ Task(std::shared_ptr<HiCR::ExecutionUnit> executionUnit, taskCallbackMap_t *callbackMap = nullptr)
122 __INLINE__ void sendSyncSignal() { _callbackMap->trigger(this, HiCR::tasking::Task::callback_t::onTaskSync); }
145 __INLINE__ void setExecutionUnit(std::shared_ptr<HiCR::ExecutionUnit> executionUnit) { _executionUnit = std::move(executionUnit); }
152 [[nodiscard]] __INLINE__ std::shared_ptr<HiCR::ExecutionUnit> getExecutionUnit() const { return _executionUnit; }
162 HICR_THROW_LOGIC("Attempting to initialize a task that has already been initialized (State: %d).\n", getState());
175 if (getState() != HiCR::ExecutionState::state_t::initialized && getState() != HiCR::ExecutionState::state_t::suspended)
176 HICR_THROW_RUNTIME("Attempting to run a task that is not in a initialized or suspended state (State: %d).\n", getState());
200 if (state != HiCR::ExecutionState::state_t::suspended && state != HiCR::ExecutionState::state_t::finished)
201 HICR_THROW_RUNTIME("Task has to be either in suspended or in finished state but I got State: %d. IsFinished: %b\n", state, isFinished);
207 // If the task is still running (no suspension), then the task has fully finished executing. If so,
208 // trigger the corresponding callback, if the callback map is defined. It is important that this function
219 if (getState() != HiCR::ExecutionState::state_t::running) HICR_THROW_RUNTIME("Attempting to yield a task that is not in a running state (State: %d).\n", getState());
Provides a definition for the HiCR CallbackMap class.
Definition callbackMap.hpp:40
__INLINE__ void trigger(T arg, const E callback) const
Definition callbackMap.hpp:69
Definition task.hpp:57
__INLINE__ std::shared_ptr< HiCR::ExecutionUnit > getExecutionUnit() const
Definition task.hpp:152
__INLINE__ taskCallbackMap_t * getCallbackMap()
Definition task.hpp:117
__INLINE__ void setCallbackMap(taskCallbackMap_t *callbackMap)
Definition task.hpp:110
__INLINE__ Task(std::shared_ptr< HiCR::ExecutionUnit > executionUnit, taskCallbackMap_t *callbackMap=nullptr)
Definition task.hpp:101
__INLINE__ void setExecutionUnit(std::shared_ptr< HiCR::ExecutionUnit > executionUnit)
Definition task.hpp:145
HiCR::tasking::CallbackMap< Task *, callback_t > taskCallbackMap_t
Definition task.hpp:89
__INLINE__ void initialize(std::unique_ptr< HiCR::ExecutionState > executionState)
Definition task.hpp:159
__INLINE__ const HiCR::ExecutionState::state_t getState()
Definition task.hpp:131
Provides a definition for the abstract compute manager class.
Provides a base definition for a HiCR Execution State class.
Provides a base definition for a HiCR Execution Unit class.
Provides a definition for a HiCR ProcessingUnit class.
Provides a failure model and corresponding exception classes.
This file implements variables shared among mutiple code files.
Generated by