 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
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;
86 static void setProfilingMode(ProfilingMode mode);
87 static ProfilingMode getProfilingMode();
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) {}
430 Vector<BindPath> m_bindPaths;
431 Path m_bindContextPath;
435 class DisableHelper :
public Referenced
438 DisableHelper(Task *task);
442 void registerSubtask(Task* subtask);
443 void removeSubtask(Task* subtask);
446 virtual ~DisableHelper();
455 UInt32 m_oldNumPostDependencies;
460 DisableHelperRef m_disableHelper;
462 static ProfilingMode s_profilingMode;
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::UInt getNumAccumulationSamples() const
A representation of a task/kernel parameter, which can be bound using a string path or explicitly to ...
bool isSequential() const
Abstract representation of a value.
agx::Thread * getDispatchThread()
agx::observer_ptr< Object > ObjectObserver
ExecutionEvent startEvent
Triggered before the task begins.
agx::Parameter * getParameter(const agx::Name &name)
ParameterEvent addParameterEvent
Triggered when a parameter is added.
agx::Real32 getOverheadTime() const
Representation of a path, a list of name components.
virtual void parameterRemovedCallback(Parameter *)
agx::Real32 getAccumulatedComputeCost() const
Event2< Task *, Parameter * > ParameterEvent
static CpuDevice * instance()
const agx::TaskPtrVector & getChildren() const
An abstract job/workblock representation, which allows work threads to execute arbitrary tasks.
ParameterMatch
Used for tracing mismatched parameter bindings.
agx::TaskGroup * getGroup()
Callback1< Value * > CallbackType
Vector containing 'raw' data.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ScalarParameter * getScalarParameter(const agx::Name &name)
A model is an abstract representation of the class of an agx::Object.
Event1< Task * > ExecutionEvent
#define AGX_DECLARE_VECTOR_TYPES(type)
A representation of a generic task.
ParameterEvent removeParameterEvent
Triggered when a parameter is removed.
static ProfilingMode getProfilingMode()
ExecutionEvent completionEvent
Triggered after the task has completed.
const agx::TaskPtrVector & getParents() const
virtual void subtaskAddedCallback(Task *)
virtual void run()
Execution callback.
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::ref_ptr< Object > ObjectRef
Representation of a name string.
agx::Real32 getAccumulatedOverheadTime() const
agx::Object is a refcounted object with a name.
A component is an object containing other objects, enabling hierarchical structuring.
Templated callback with one argument.
VectorPOD< class Job * > JobPtrVector
const agx::TaskRefVector & getSubtasks() const
agx::Real32 getAccumulatedWallTime() const
#define AGX_DECLARE_POINTER_TYPES(type)
const agx::ParameterPtrVector & getParameters() const
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
agxData::Val< Bool > enableParameter
Enable/disable the task, normally use setEnable/isEnabled instead.
agx::Thread is a representation of an OS specific implementation of a computational thread.
agx::PointerParameter * getPointerParameter(const agx::Name &name)
An agx::Device is an abstract representation of a device on which data can be stored and processed.
agx::ArrayParameter * getArrayParameter(const agx::Name &name)
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
const AGXCORE_EXPORT InvalidIndexStruct InvalidIndex
agx::Real32 getComputeCost() const
virtual void parameterAddedCallback(Parameter *)
agx::Real32 getWallTime() const
Performance statistics.
agx::Thread * getTargetThread()