RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
rtctk::exampleDataTask::Computation Class Reference

#include <computation.hpp>

Inheritance diagram for rtctk::exampleDataTask::Computation:
rtctk::dataTask::ComputationBase< TopicType > rtctk::dataTask::ComputationBase< TopicType > rtctk::dataTask::ComputationBase< TopicType >

Classes

struct  Result
 
struct  ResultIf
 

Public Types

enum class  Algorithm : uint8_t { Mean , Median , SimpleInversion , PythonInversion }
 
enum class  Algorithm : uint8_t { Mean , Median , SimpleInversion , PythonInversion }
 
using ServiceContainer = rtctk::componentFramework::ServiceContainer
 
template<typename T >
using MatrixBuffer = rtctk::componentFramework::MatrixBuffer<T>
 
using ServiceContainer = rtctk::componentFramework::ServiceContainer
 
using ServiceContainer = rtctk::componentFramework::ServiceContainer
 
template<typename T >
using MatrixBuffer = rtctk::componentFramework::MatrixBuffer<T>
 
- Public Types inherited from rtctk::dataTask::ComputationBase< TopicType >
enum  State
 Current state of the worker thread. More...
 
using TopicType
 
using ServiceContainer
 
using ComponentMetricsIf
 

Public Member Functions

 Computation (ServiceContainer &services, ResultIf &publisher, const std::string &shm_name, size_t to_read, size_t to_skip, std::chrono::milliseconds sample_timeout, std::optional< numapp::NumaPolicies > thread_policies, size_t n_slopes, size_t n_modes, size_t gpu)
 
 ~Computation ()
 
void SetSlopesToModesMatrix (MatrixBuffer< float > &&s2m_matrix)
 
 Computation (ServiceContainer &services, ResultIf &publisher, const std::string &shm_name, size_t to_read, size_t to_skip, std::chrono::milliseconds sample_timeout, std::optional< numapp::NumaPolicies > thread_policies)
 
 ~Computation ()
 
ResultComputeSync (Algorithm algorithm)
 One way to make result available to BusinessLogic is to return a reference here.
 
 Computation ()
 
void SetStaticConfig (size_t n_slopes, size_t n_acts)
 
void SetDynamicConfig (MatrixBuffer< float > &&data)
 
Result Compute (Algorithm algorithm)
 
 Computation (ServiceContainer &services, ResultIf &publisher, const std::string &shm_name, size_t to_read, size_t to_skip, std::chrono::milliseconds sample_timeout, std::optional< numapp::NumaPolicies > thread_policies, size_t n_slopes, size_t n_modes)
 
 ~Computation ()
 
void SetSlopesToModesMatrix (MatrixBuffer< float > &&s2m_matrix)
 
- Public Member Functions inherited from rtctk::dataTask::ComputationBase< TopicType >
 ComputationBase (ServiceContainer &services, const std::string &shm_name, size_t to_read, size_t to_skip, std::chrono::milliseconds sample_timeout, std::optional< numapp::NumaPolicies > thread_policies)
 Constructor.
 
virtual ~ComputationBase ()=default
 Destructor.
 
void SetSamplesToRead (size_t value)
 Sets the number of samples to read.
 
size_t GetSamplesToRead () const
 Gets the number of samples to read.
 
void SetSamplesToSkip (size_t value)
 Sets the number of samples to skip.
 
size_t GetSamplesToSkip () const
 Gets the number of samples to skip.
 
void Spawn ()
 Spawns the worker thread (sync method).
 
void Join ()
 Terminates the worker thread (sync method).
 
void Run (std::optional< size_t > cycles=std::nullopt)
 Commands the worker thread to perform number of computation cycles (async method).
 
void RunOnceSync (std::optional< std::chrono::milliseconds > poll_interval=std::nullopt)
 Commands the worker thread to perform a single computation cycle (sync method).
 
void Idle ()
 Commands the worker thread to stop performing computation cycles (async method).
 
State GetState () const
 Returns the current state of the worker thread.
 
size_t GetCycles () const
 Retrieves number of computation cycles performed since running.
 
void CheckErrors ()
 Checks for errors in the worker thread and rethrows them to the caller.
 

Additional Inherited Members

- Protected Member Functions inherited from rtctk::dataTask::ComputationBase< TopicType >
virtual void CopyData (size_t sample_idx, const TopicType &sample) noexcept=0
 User-hook used to copy data of a single computation cycle into user-owned sample buffer.
 

Member Typedef Documentation

◆ MatrixBuffer [1/2]

◆ MatrixBuffer [2/2]

◆ ServiceContainer [1/3]

◆ ServiceContainer [2/3]

◆ ServiceContainer [3/3]

Member Enumeration Documentation

◆ Algorithm [1/2]

Enumerator
Mean 
Median 
SimpleInversion 
PythonInversion 

◆ Algorithm [2/2]

Enumerator
Mean 
Median 
SimpleInversion 
PythonInversion 

Constructor & Destructor Documentation

◆ Computation() [1/4]

rtctk::exampleDataTask::Computation::Computation ( ServiceContainer & services,
ResultIf & publisher,
const std::string & shm_name,
size_t to_read,
size_t to_skip,
std::chrono::milliseconds sample_timeout,
std::optional< numapp::NumaPolicies > thread_policies,
size_t n_slopes,
size_t n_modes,
size_t gpu )

◆ ~Computation() [1/3]

rtctk::exampleDataTask::Computation::~Computation ( )

◆ Computation() [2/4]

rtctk::exampleDataTask::Computation::Computation ( ServiceContainer & services,
ResultIf & publisher,
const std::string & shm_name,
size_t to_read,
size_t to_skip,
std::chrono::milliseconds sample_timeout,
std::optional< numapp::NumaPolicies > thread_policies )

◆ ~Computation() [2/3]

rtctk::exampleDataTask::Computation::~Computation ( )

◆ Computation() [3/4]

rtctk::exampleDataTask::Computation::Computation ( )
inline

◆ Computation() [4/4]

rtctk::exampleDataTask::Computation::Computation ( ServiceContainer & services,
ResultIf & publisher,
const std::string & shm_name,
size_t to_read,
size_t to_skip,
std::chrono::milliseconds sample_timeout,
std::optional< numapp::NumaPolicies > thread_policies,
size_t n_slopes,
size_t n_modes )

◆ ~Computation() [3/3]

rtctk::exampleDataTask::Computation::~Computation ( )

Member Function Documentation

◆ Compute()

Result rtctk::exampleDataTask::Computation::Compute ( Algorithm algorithm)
inline

◆ ComputeSync()

Computation::Result & rtctk::exampleDataTask::Computation::ComputeSync ( Algorithm algorithm)

One way to make result available to BusinessLogic is to return a reference here.

◆ SetDynamicConfig()

void rtctk::exampleDataTask::Computation::SetDynamicConfig ( MatrixBuffer< float > && data)
inline

◆ SetSlopesToModesMatrix() [1/2]

void rtctk::exampleDataTask::Computation::SetSlopesToModesMatrix ( MatrixBuffer< float > && s2m_matrix)

◆ SetSlopesToModesMatrix() [2/2]

void rtctk::exampleDataTask::Computation::SetSlopesToModesMatrix ( MatrixBuffer< float > && s2m_matrix)

◆ SetStaticConfig()

void rtctk::exampleDataTask::Computation::SetStaticConfig ( size_t n_slopes,
size_t n_acts )
inline

The documentation for this class was generated from the following files: