40 class TaskTimingReportHandle;
66 static Task* load(TiXmlElement *eTask,
Device* device);
74 virtual void configure(TiXmlElement* eTask)
override;
75 void configure(TiXmlElement* eTask,
bool loadParameters);
77 void save(agx::TiXmlElement* parent)
const override;
115 EMPTY_BINDING_LIST = (1<<0),
116 PARAMETER_VALID = (1<<1),
117 PARAMETER_NOT_REQUIRED = (1<<2),
118 PARAMETER_BOUND = (1<<3),
119 PARAMETER_HAS_BOUND_PATH = (1<<4),
120 FORMATS_MATCH = (1<<5),
121 NEED_DEVICE_TRANSFORM = (1<<6),
124 MISSING_BINDING = (1<<7),
125 BINDING_LACKS_TYPE = (1<<8),
126 FORMATS_MISSMATCH = (1<<9),
127 EXTRA_BINDING = (1<<10),
128 INCONSISTEN_PARAMETERS = (1<<11),
132 MATCH_MASK = EMPTY_BINDING_LIST | PARAMETER_VALID | PARAMETER_NOT_REQUIRED | PARAMETER_BOUND | PARAMETER_HAS_BOUND_PATH | FORMATS_MATCH | NEED_DEVICE_TRANSFORM,
135 NO_MATCH_MASK = MISSING_BINDING | BINDING_LACKS_TYPE | FORMATS_MISSMATCH | EXTRA_BINDING | INCONSISTEN_PARAMETERS
137 static void printParameterMatch(
UInt32 parameterMatch );
159 bool isRunning()
const;
164 void setEnable(
bool flag);
169 bool isEnabled()
const;
196 void removeParameter(
size_t index);
256 void addDependency(
const agx::Path& path);
263 void removeDependency(
agx::Task* parent);
266 bool hasDependency(
agx::Task *parent)
const;
276 void print(std::ostream& stream)
const;
277 void printBindings();
278 void printBindings(std::ostream& stream);
280 virtual void setContext(
agx::Object* context )
override;
297 virtual void rebind()
override;
299 void addTriggerPath(
const agx::Path& path);
301 void addResolvePath(
const agx::Path& path);
321 agx::UInt getNumAccumulationSamples()
const;
324 void resetAccumulationTimers(
bool recursive =
true);
327 void beginCallback();
338 static void addConnection(
Task *parent,
Task *child);
339 static void removeConnection(
Task *parent,
Task *child);
346 void prepareGlobalResultSorting(
size_t numJobs);
357 void registerBufferReadersAndWriters();
358 void unregisterBufferReadersAndWriters();
359 void verifyParameters();
360 void disconnectFromParent(
Task* ancestor);
361 void disconnectFromChild(
Task* descendant);
362 void connectToParent(
Task* ancestor);
363 void connectToChild(
Task* descendant);
364 void dispatchBlocking(
Thread *thread);
371 static void signalUnhandledException();
372 static bool hasUnhandledException();
380 std::atomic<bool> m_running;
384 Timer m_overheadTimer;
396 Real32 m_accumulatedWallTime;
397 Real32 m_accumulatedComputeCost;
398 Real32 m_accumulatedOverheadTime;
399 UInt m_numAccumulations;
423 BindPath(
const Path& _path,
Type _type) : path(_path), type(_type), binding(nullptr) {}
431 Path m_bindContextPath;
438 DisableHelper(
Task *task);
442 void registerSubtask(
Task* subtask);
443 void removeSubtask(
Task* subtask);
446 virtual ~DisableHelper();
455 UInt32 m_oldNumPostDependencies;
490 virtual agx::Job *getPreJob()
override;
491 virtual agx::Job *getPostJob()
override;
492 virtual void setTargetThread(
agx::Thread *thread)
override;
498 class SerialJob :
public Job 501 virtual ~SerialJob();
504 virtual void implementation()
override;
529 void removeAllJobs();
531 Job *getDispatchJob();
535 virtual agx::Job *getPreJob()
override;
536 virtual agx::Job *getPostJob()
override;
537 virtual void setTargetThread(
agx::Thread *thread)
override;
546 class PreJob :
public Job 552 virtual void implementation()
override;
555 class PostJob :
public Job 561 virtual void implementation()
override;
564 class DispatchJob :
public Job 567 virtual ~DispatchJob();
570 virtual void implementation()
override;
576 DispatchJob m_dispatchJob;
578 Index m_jobIndexCounter;
591 bool isSequential()
const;
593 void setSequential(
bool flag);
623 void removeSubtask(
const agx::Name& name);
628 void removeAllSubtasks();
633 void serialize(
bool recursive =
false);
646 virtual void traverse(
const Callback1<Task *>& callback,
bool breadthFirst =
true);
648 void writeDependencyDotGraph()
const;
651 virtual agx::Job* getPreJob()
override;
652 virtual agx::Job* getPostJob()
override;
653 virtual void setTargetThread(
agx::Thread* thread)
override;
660 void registerSubtask(
Task* subtask);
664 class PreJob :
public Job 670 virtual void implementation()
override;
673 class PostJob :
public Job 679 virtual void implementation()
override;
agx::Thread * getDispatchThread()
Representation of a path, a list of name components.
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
virtual void parameterRemovedCallback(Parameter *)
agx::Real32 getAccumulatedComputeCost() const
ParameterEvent addParameterEvent
Triggered when a parameter is added.
const agx::TaskRefVector & getSubtasks() const
agx::Thread is a representation of an OS specific implementation of a computational thread...
agx::UInt getNumAccumulationSamples() const
ExecutionEvent startEvent
Triggered before the task begins.
A component is an object containing other objects, enabling hierarchical structuring.
A model is an abstract representation of the class of an agx::Object.
Abstract representation of a value.
An abstract job/workblock representation, which allows work threads to execute arbitrary tasks...
agx::Real32 getOverheadTime() const
Generalized callback, using std::function.
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
#define AGX_DECLARE_POINTER_TYPES(type)
agx::ScalarParameter * getScalarParameter(const agx::Name &name)
A representation of a generic task.
Representation of a name string.
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
ParameterMatch
Used for tracing mismatched parameter bindings.
agx::TaskGroup * getGroup()
Event2< Task *, Parameter * > ParameterEvent
const agx::TaskPtrVector & getParents() const
Base class providing referencing counted objects.
static ProfilingMode getProfilingMode()
const agx::TaskPtrVector & getChildren() const
static CpuDevice * instance()
agx::Real32 getAccumulatedOverheadTime() const
Vector containing 'raw' data.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
virtual void subtaskAddedCallback(Task *)
Templated callback with one argument.
virtual void run()
Execution callback.
A representation of a task/kernel parameter, which can be bound using a string path or explicitly to ...
Event1< Task * > ExecutionEvent
ParameterEvent removeParameterEvent
Triggered when a parameter is removed.
agx::Real32 getAccumulatedWallTime() const
const agx::ParameterPtrVector & getParameters() const
ExecutionEvent completionEvent
Triggered after the task has completed.
bool isSequential() const
agx::PointerParameter * getPointerParameter(const agx::Name &name)
virtual void parameterAddedCallback(Parameter *)
agx::ArrayParameter * getArrayParameter(const agx::Name &name)
agx::Real32 getWallTime() const
Performance statistics.
agxData::Val< Bool > enableParameter
Enable/disable the task, normally use setEnable/isEnabled instead.
agx::Thread * getTargetThread()
#define AGX_DECLARE_VECTOR_TYPES(type)
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::Real32 getComputeCost() const
An agx::Device is an abstract representation of a device on which data can be stored and processed...
agx::Parameter * getParameter(const agx::Name &name)
agx::Object is a refcounted object with a name.