ConfigDataFlow#

Fully qualified name: cupva::ConfigDataFlow

Defined in src/host/cpp_api/include/cupva_host.hpp

class ConfigDataFlow : public cupva::BaseDataFlow#

The ConfigDataFlow is used to change dataflows settings in the runtime.

Deprecated:

This class is deprecated. Use cupva::GatherScatterDataFlow or cupva::SequenceDataFlow instead.

The disadvantage of the StatiDataFlow is that the pre-defined memory-access-pattern lacks the flexibility. In some PVA applications, the memory-access-address is decided in the runtime. To support these cases, ConfigDataFlow is designed to enable the VPU code changing the dataflow settings in the runtime.

All DataFlows should be created by invoking methods on cupva::CmdProgram. DataFlows are owned by CmdProgram objects. User should only operate on DataFlows via non-owning references returned by CmdProgram objects.

Public Functions

template<typename T, typename std::enable_if<T::isPrimitive, bool>::type = true>
inline ConfigDataFlow &link(
T &next,
)#

Link a level0 dataflow.

Link a level0 dataflow (StaticDataFlow or ConfigDataFlow) to the tail of the dataflow-list holding by current dataflow. Check example in the StaticDataFlow::link() method.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Template Parameters:
  • T – The dataflow type of the node to be linked

  • std::enable_if<T::isPrimitive, bool>::type – Check if the node type is primitive

Parameters:

next – The dataflow/dataflow-list to be linked

Throws:

cupva::Exception(InvalidState) – The object is not instantiated correctly

Returns:

ConfigDataFlow& The reference of head dataflow which holding the list

template<typename T, typename std::enable_if<T::isPrimitive, bool>::type = true>
inline ConfigDataFlow &append(
T &next,
)#

Append a level0 dataflow.

append() has the almost same effect with link(), except it removes the boundary of the dataflows. The appended dataflow will be executable once the previous dataflow is done, without the need of a VPU-DMA-handshake in between.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Template Parameters:
  • T – The dataflow type of the node to be appended

  • std::enable_if<T::isPrimitive, bool>::type – Check if the node type is primitive

Parameters:

next – The dataflow/dataflow-list to be appended

Throws:

cupva::Exception(InvalidState) – The object is not instantiated correctly

Returns:

ConfigDataFlow& The reference of head dataflow which holding the list

ConfigDataFlow &src(const void *const ptr)#

Set ConfigDataFlow’s configuration-table pointer.

The ConfigDataFlow works with a configuration-table in the VMEM. After the VPU code writing the address-value pairs to the table, triggering the ConfigDataFlow can update the memory space (pointing by the address) with corresponding value.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:

ptr – The device pointer to the configuration-table in VMEM

Throws:
  • cupva::Exception(InvalidArgument) – The ptr is not pointing to the VMEM

  • cupva::Exception(InvalidState) – The object is not instantiated correctly

Returns:

ConfigDataFlow& The reference of current object

int32_t id() const#

Get ConfigDataFlow’s id.

The id is only valid after the ConfigDataFlow is compiled.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Throws:
  • cupva::Exception(InvalidState) – Can’t get a valid id before it is compiled

  • cupva::Exception(InvalidState) – The object is not instantiated correctly

Returns:

ConfigDataFlow id

ConfigDataFlow &handler(const Parameter &handler)#

Assign the handler to the ConfigDataFlow object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:

handler – The handler defined in vmem and represented by the host parameter

Throws:
  • cupva::Exception(InvalidArgument) – The handler is not from VMEM

  • cupva::Exception(InvalidState) – The object is not instantiated correctly

Returns:

ConfigDataFlow& The reference to current object

void copy(const ConfigDataFlow &rhs)#

Copy attribute from another ConfigDataFlow.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:

rhs – The source of copy

Public Static Attributes

static constexpr bool isPrimitive = {true}#

Only primitive dataflow can be linked/appended.