Compute Library
 22.08
ClWorkload Struct Reference

Workload for Cl backend. More...

#include <ClWorkload.h>

Collaboration diagram for ClWorkload:
[legend]

Public Member Functions

Tid add_workload_tensor (ITensorInfo *info, MemoryType memory_type, const AuxMemoryInfo &memory_info, const ClKernelArgDescriptor &kernel_arg, Tid merge_point)
 
UnitWorkId add_unit_workload (UnitWorkloadStage stage, const ClKernelCode &code, const std::vector< Tid > &inputs, const std::vector< Tid > &outputs)
 
- Public Member Functions inherited from IWorkload
 IWorkload ()=default
 
virtual ~IWorkload ()=default
 

Data Fields

ClWorkloadContext context {}
 Workload context. More...
 
std::map< UnitWorkId, ClUnitWorkloadunit_workloads {}
 Unit workloads to run. More...
 
std::map< Tid, ClWorkloadTensortensors {}
 Workload tensors. More...
 
std::map< Tid, OpTensor::Idop_tensor_id_lut {}
 Map from ClWorkloadTensor to SRC and DST Operator Tensors (no need to store "intermediate" Operator Tensors) More...
 
Status status {}
 For compatibility with the IOperator validate method. More...
 
- Data Fields inherited from IWorkload
DependencyGraph graph {}
 Dependency graph of the workload tensors and the unit workloads. More...
 

Friends

bool operator== (const ClWorkload &workload0, const ClWorkload &workload1)
 

Additional Inherited Members

- Public Types inherited from IWorkload
using UnitWorkId = UnitWorkload::Id
 
using Tid = WorkloadTensor::Id
 

Detailed Description

Workload for Cl backend.

Examples:
dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp.

Definition at line 173 of file ClWorkload.h.

Member Function Documentation

◆ add_unit_workload()

UnitWorkId add_unit_workload ( UnitWorkloadStage  stage,
const ClKernelCode code,
const std::vector< Tid > &  inputs,
const std::vector< Tid > &  outputs 
)
inline

Definition at line 184 of file ClWorkload.h.

Referenced by arm_compute::experimental::dynamic_fusion::generate().

185  {
186  auto op = graph.add_operator(inputs, outputs);
187  auto id = op.second;
188  unit_workloads[id] = ClUnitWorkload(id, stage, code);
189  return id;
190  }
DependencyGraph graph
Dependency graph of the workload tensors and the unit workloads.
Definition: IWorkload.h:125
std::pair< Status, DependencyGraph::Id > add_operator(const std::vector< Id > &inputs, const std::vector< Id > &outputs)
Add a new operator.
std::map< UnitWorkId, ClUnitWorkload > unit_workloads
Unit workloads to run.
Definition: ClWorkload.h:199

◆ add_workload_tensor()

Tid add_workload_tensor ( ITensorInfo info,
MemoryType  memory_type,
const AuxMemoryInfo memory_info,
const ClKernelArgDescriptor kernel_arg,
Tid  merge_point 
)
inline

Definition at line 175 of file ClWorkload.h.

Referenced by arm_compute::experimental::dynamic_fusion::generate().

176  {
177  Tid id = graph.add_tensor(merge_point);
178  if(tensors.find(id) == tensors.end())
179  {
180  tensors[id] = ClWorkloadTensor(id, info, memory_type, memory_info, kernel_arg);
181  }
182  return id;
183  }
Id add_tensor(Id merge_tensor=empty_id())
Add a new tensor.
DependencyGraph graph
Dependency graph of the workload tensors and the unit workloads.
Definition: IWorkload.h:125
std::map< Tid, ClWorkloadTensor > tensors
Workload tensors.
Definition: ClWorkload.h:200
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

Friends And Related Function Documentation

◆ operator==

bool operator== ( const ClWorkload workload0,
const ClWorkload workload1 
)
friend

Definition at line 191 of file ClWorkload.h.

192  {
193  return std::make_tuple(
194  workload0.graph, workload0.context, workload0.unit_workloads, workload0.tensors, workload0.op_tensor_id_lut)
195  == std::make_tuple(
196  workload1.graph, workload1.context, workload1.unit_workloads, workload1.tensors, workload1.op_tensor_id_lut);
197  }

Field Documentation

◆ context

◆ op_tensor_id_lut

std::map<Tid, OpTensor::Id> op_tensor_id_lut {}

Map from ClWorkloadTensor to SRC and DST Operator Tensors (no need to store "intermediate" Operator Tensors)

Definition at line 201 of file ClWorkload.h.

Referenced by arm_compute::experimental::dynamic_fusion::bind_tensors(), and arm_compute::experimental::dynamic_fusion::build().

◆ status

Status status {}

For compatibility with the IOperator validate method.

Store if the workload is valid or not.

Definition at line 202 of file ClWorkload.h.

Referenced by arm_compute::experimental::dynamic_fusion::build(), and ClCompositeOperator::validate().

◆ tensors

std::map<Tid, ClWorkloadTensor> tensors {}

Workload tensors.

Definition at line 200 of file ClWorkload.h.

Referenced by arm_compute::experimental::dynamic_fusion::bind_tensors().

◆ unit_workloads

std::map<UnitWorkId, ClUnitWorkload> unit_workloads {}

Unit workloads to run.

Definition at line 199 of file ClWorkload.h.

Referenced by ClCompositeOperator::configure().


The documentation for this struct was generated from the following file: