ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci_interpreter::kernels::TISOKernel Class Reference

#include <TISOKernel.h>

Public Member Functions

 TISOKernel ()=delete
 
 TISOKernel (const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)
 
const circle::Tensor * input1 () const
 
const circle::Tensor * input2 () const
 
const circle::Tensor * output () const
 
BaseRuntimeGraphruntime_graph () const
 
TISOData readData ()
 
TISOData readInplaceData (uint8_t *&inplace_data_ptr, circle::Tensor *&input_inplace_tensor)
 

Detailed Description

Definition at line 35 of file TISOKernel.h.

Constructor & Destructor Documentation

◆ TISOKernel() [1/2]

luci_interpreter::kernels::TISOKernel::TISOKernel ( )
delete

◆ TISOKernel() [2/2]

luci_interpreter::kernels::TISOKernel::TISOKernel ( const circle::Operator *  cur_op,
BaseRuntimeGraph runtime_graph 
)
inlineexplicit

Definition at line 40 of file TISOKernel.h.

41 : _runtime_graph(runtime_graph)
42 {
43 const auto input1_index = cur_op->inputs()->operator[](0);
44 const auto input2_index = cur_op->inputs()->operator[](1);
45 const auto output_index = cur_op->outputs()->operator[](0);
46
47 assert(input1_index != -1);
48 assert(input2_index != -1);
49 assert(output_index != -1);
50
51 _input1_tensor = _runtime_graph->getCircleTensorByIndex(input1_index);
52 _input2_tensor = _runtime_graph->getCircleTensorByIndex(input2_index);
53 _output_tensor = _runtime_graph->getCircleTensorByIndex(output_index);
54
55 assert(_input1_tensor != nullptr);
56 assert(_input2_tensor != nullptr);
57 assert(_output_tensor != nullptr);
58 }
const circle::Tensor * getCircleTensorByIndex(int32_t index)
BaseRuntimeGraph * runtime_graph() const
Definition TISOKernel.h:64

References luci_interpreter::RuntimeGraph::getCircleTensorByIndex().

Member Function Documentation

◆ input1()

const circle::Tensor * luci_interpreter::kernels::TISOKernel::input1 ( ) const
inline

Definition at line 60 of file TISOKernel.h.

60{ return _input1_tensor; }

Referenced by luci_interpreter::kernels::CheckBinaryOpDataTypesEqual(), luci_interpreter::configure_kernel_CircleAdd(), luci_interpreter::configure_kernel_CircleBroadcastTo(), luci_interpreter::configure_kernel_CircleDiv(), luci_interpreter::configure_kernel_CircleEqual(), luci_interpreter::configure_kernel_CircleGather(), luci_interpreter::configure_kernel_CircleGatherND(), luci_interpreter::configure_kernel_CircleGreater(), luci_interpreter::configure_kernel_CircleGreaterEqual(), luci_interpreter::configure_kernel_CircleLess(), luci_interpreter::configure_kernel_CircleLessEqual(), luci_interpreter::configure_kernel_CircleLogicalAnd(), luci_interpreter::configure_kernel_CircleLogicalOr(), luci_interpreter::configure_kernel_CircleMean(), luci_interpreter::configure_kernel_CircleMirrorPad(), luci_interpreter::configure_kernel_CircleMul(), luci_interpreter::configure_kernel_CircleNotEqual(), luci_interpreter::configure_kernel_CirclePRelu(), luci_interpreter::configure_kernel_CircleReduceCommon(), luci_interpreter::configure_kernel_CircleReduceMax(), luci_interpreter::configure_kernel_CircleResizeNearestNeighbor(), luci_interpreter::configure_kernel_CircleSquaredDifference(), luci_interpreter::configure_kernel_CircleSub(), luci_interpreter::configure_kernel_CircleSum(), luci_interpreter::configure_kernel_CircleTranspose(), luci_interpreter::kernels::evalTISOInplaceKernel(), luci_interpreter::kernels::evalTISOInplaceQuantizedKernel(), luci_interpreter::kernels::evalTISOQuantizedKernel(), luci_interpreter::execute_kernel_CircleAdd(), luci_interpreter::execute_kernel_CircleArgMax(), luci_interpreter::execute_kernel_CircleArgMin(), luci_interpreter::execute_kernel_CircleBroadcastTo(), luci_interpreter::execute_kernel_CircleDiv(), luci_interpreter::execute_kernel_CircleEqual(), luci_interpreter::execute_kernel_CircleFloorDiv(), luci_interpreter::execute_kernel_CircleFloorMod(), luci_interpreter::execute_kernel_CircleGather(), luci_interpreter::execute_kernel_CircleGatherND(), luci_interpreter::execute_kernel_CircleGreater(), luci_interpreter::execute_kernel_CircleGreaterEqual(), luci_interpreter::execute_kernel_CircleLess(), luci_interpreter::execute_kernel_CircleLessEqual(), luci_interpreter::execute_kernel_CircleLogicalAnd(), luci_interpreter::execute_kernel_CircleLogicalOr(), luci_interpreter::execute_kernel_CircleMaximum(), luci_interpreter::execute_kernel_CircleMean(), luci_interpreter::execute_kernel_CircleMinimum(), luci_interpreter::execute_kernel_CircleMirrorPad(), luci_interpreter::execute_kernel_CircleMul(), luci_interpreter::execute_kernel_CircleNotEqual(), luci_interpreter::execute_kernel_CirclePRelu(), luci_interpreter::execute_kernel_CircleReduceCommon(), luci_interpreter::execute_kernel_CircleReduceMax(), luci_interpreter::execute_kernel_CircleResizeNearestNeighbor(), luci_interpreter::execute_kernel_CircleSquaredDifference(), luci_interpreter::execute_kernel_CircleSub(), luci_interpreter::execute_kernel_CircleSum(), and luci_interpreter::execute_kernel_CircleTranspose().

◆ input2()

const circle::Tensor * luci_interpreter::kernels::TISOKernel::input2 ( ) const
inline

Definition at line 61 of file TISOKernel.h.

61{ return _input2_tensor; }

Referenced by luci_interpreter::kernels::CheckBinaryOpDataTypesEqual(), luci_interpreter::configure_kernel_CircleAdd(), luci_interpreter::configure_kernel_CircleArgMax(), luci_interpreter::configure_kernel_CircleArgMin(), luci_interpreter::configure_kernel_CircleBroadcastTo(), luci_interpreter::configure_kernel_CircleDiv(), luci_interpreter::configure_kernel_CircleEqual(), luci_interpreter::configure_kernel_CircleFill(), luci_interpreter::configure_kernel_CircleGather(), luci_interpreter::configure_kernel_CircleGatherND(), luci_interpreter::configure_kernel_CircleGreater(), luci_interpreter::configure_kernel_CircleGreaterEqual(), luci_interpreter::configure_kernel_CircleLess(), luci_interpreter::configure_kernel_CircleLessEqual(), luci_interpreter::configure_kernel_CircleLogicalAnd(), luci_interpreter::configure_kernel_CircleLogicalOr(), luci_interpreter::configure_kernel_CircleMean(), luci_interpreter::configure_kernel_CircleMirrorPad(), luci_interpreter::configure_kernel_CircleMul(), luci_interpreter::configure_kernel_CircleNotEqual(), luci_interpreter::configure_kernel_CirclePRelu(), luci_interpreter::configure_kernel_CircleReduceCommon(), luci_interpreter::configure_kernel_CircleReduceMax(), luci_interpreter::configure_kernel_CircleResizeNearestNeighbor(), luci_interpreter::configure_kernel_CircleSquaredDifference(), luci_interpreter::configure_kernel_CircleSub(), luci_interpreter::configure_kernel_CircleSum(), luci_interpreter::configure_kernel_CircleTranspose(), luci_interpreter::kernels::evalTISOInplaceKernel(), luci_interpreter::kernels::evalTISOInplaceQuantizedKernel(), luci_interpreter::kernels::evalTISOQuantizedKernel(), luci_interpreter::execute_kernel_CircleAdd(), luci_interpreter::execute_kernel_CircleDiv(), luci_interpreter::execute_kernel_CircleEqual(), luci_interpreter::execute_kernel_CircleFill(), luci_interpreter::execute_kernel_CircleFloorDiv(), luci_interpreter::execute_kernel_CircleFloorMod(), luci_interpreter::execute_kernel_CircleGatherND(), luci_interpreter::execute_kernel_CircleGreater(), luci_interpreter::execute_kernel_CircleGreaterEqual(), luci_interpreter::execute_kernel_CircleLess(), luci_interpreter::execute_kernel_CircleLessEqual(), luci_interpreter::execute_kernel_CircleLogicalAnd(), luci_interpreter::execute_kernel_CircleLogicalOr(), luci_interpreter::execute_kernel_CircleMaximum(), luci_interpreter::execute_kernel_CircleMean(), luci_interpreter::execute_kernel_CircleMinimum(), luci_interpreter::execute_kernel_CircleMirrorPad(), luci_interpreter::execute_kernel_CircleMul(), luci_interpreter::execute_kernel_CircleNotEqual(), luci_interpreter::execute_kernel_CirclePRelu(), luci_interpreter::execute_kernel_CircleReduceCommon(), luci_interpreter::execute_kernel_CircleReduceMax(), luci_interpreter::execute_kernel_CircleResizeNearestNeighbor(), luci_interpreter::execute_kernel_CircleSquaredDifference(), luci_interpreter::execute_kernel_CircleSub(), luci_interpreter::execute_kernel_CircleSum(), and luci_interpreter::execute_kernel_CircleTranspose().

◆ output()

const circle::Tensor * luci_interpreter::kernels::TISOKernel::output ( ) const
inline

Definition at line 62 of file TISOKernel.h.

62{ return _output_tensor; }

Referenced by luci_interpreter::kernels::CheckBinaryOpDataTypesEqual(), luci_interpreter::configure_kernel_CircleAdd(), luci_interpreter::configure_kernel_CircleArgMax(), luci_interpreter::configure_kernel_CircleArgMin(), luci_interpreter::configure_kernel_CircleBroadcastTo(), luci_interpreter::configure_kernel_CircleEqual(), luci_interpreter::configure_kernel_CircleFill(), luci_interpreter::configure_kernel_CircleGatherND(), luci_interpreter::configure_kernel_CircleGreater(), luci_interpreter::configure_kernel_CircleGreaterEqual(), luci_interpreter::configure_kernel_CircleLess(), luci_interpreter::configure_kernel_CircleLessEqual(), luci_interpreter::configure_kernel_CircleLogicalAnd(), luci_interpreter::configure_kernel_CircleLogicalOr(), luci_interpreter::configure_kernel_CircleMean(), luci_interpreter::configure_kernel_CircleMirrorPad(), luci_interpreter::configure_kernel_CircleMul(), luci_interpreter::configure_kernel_CircleNotEqual(), luci_interpreter::configure_kernel_CirclePRelu(), luci_interpreter::configure_kernel_CircleReduceMax(), luci_interpreter::configure_kernel_CircleResizeNearestNeighbor(), luci_interpreter::configure_kernel_CircleSquaredDifference(), luci_interpreter::configure_kernel_CircleSub(), luci_interpreter::configure_kernel_CircleSum(), luci_interpreter::kernels::evalTISOInplaceKernel(), luci_interpreter::kernels::evalTISOInplaceQuantizedKernel(), luci_interpreter::kernels::evalTISOQuantizedKernel(), luci_interpreter::execute_kernel_CircleAdd(), luci_interpreter::execute_kernel_CircleArgMax(), luci_interpreter::execute_kernel_CircleArgMin(), luci_interpreter::execute_kernel_CircleBroadcastTo(), luci_interpreter::execute_kernel_CircleDiv(), luci_interpreter::execute_kernel_CircleEqual(), luci_interpreter::execute_kernel_CircleFill(), luci_interpreter::execute_kernel_CircleFloorDiv(), luci_interpreter::execute_kernel_CircleFloorMod(), luci_interpreter::execute_kernel_CircleGatherND(), luci_interpreter::execute_kernel_CircleGreater(), luci_interpreter::execute_kernel_CircleGreaterEqual(), luci_interpreter::execute_kernel_CircleLess(), luci_interpreter::execute_kernel_CircleLessEqual(), luci_interpreter::execute_kernel_CircleLogicalAnd(), luci_interpreter::execute_kernel_CircleLogicalOr(), luci_interpreter::execute_kernel_CircleMaximum(), luci_interpreter::execute_kernel_CircleMean(), luci_interpreter::execute_kernel_CircleMinimum(), luci_interpreter::execute_kernel_CircleMirrorPad(), luci_interpreter::execute_kernel_CircleMul(), luci_interpreter::execute_kernel_CircleNotEqual(), luci_interpreter::execute_kernel_CirclePRelu(), luci_interpreter::execute_kernel_CircleReduceCommon(), luci_interpreter::execute_kernel_CircleReduceMax(), luci_interpreter::execute_kernel_CircleResizeNearestNeighbor(), luci_interpreter::execute_kernel_CircleSquaredDifference(), luci_interpreter::execute_kernel_CircleSub(), luci_interpreter::execute_kernel_CircleSum(), and luci_interpreter::execute_kernel_CircleTranspose().

◆ readData()

TISOData luci_interpreter::kernels::TISOKernel::readData ( )
inline

Definition at line 66 of file TISOKernel.h.

67 {
68 auto *input1_data = _runtime_graph->getDataByTensor(_input1_tensor);
69 if (input1_data == nullptr)
70 input1_data = _runtime_graph->getConstDataByTensor(_input1_tensor);
71 assert(input1_data);
72
73 auto *input2_data = _runtime_graph->getDataByTensor(_input2_tensor);
74 if (input2_data == nullptr)
75 input2_data = _runtime_graph->getConstDataByTensor(_input2_tensor);
76 assert(input2_data);
77
78 auto *output_data = _runtime_graph->getDataByTensor(_output_tensor);
79 assert(output_data);
80
82 }
uint8_t * getConstDataByTensor(const circle::Tensor *raw_tensor)
uint8_t * getDataByTensor(const circle::Tensor *raw_tensor)

References luci_interpreter::RuntimeGraph::getConstDataByTensor(), and luci_interpreter::RuntimeGraph::getDataByTensor().

Referenced by luci_interpreter::execute_kernel_CircleAdd(), luci_interpreter::execute_kernel_CircleArgMax(), luci_interpreter::execute_kernel_CircleArgMin(), luci_interpreter::execute_kernel_CircleDiv(), luci_interpreter::execute_kernel_CircleFill(), luci_interpreter::execute_kernel_CircleMean(), luci_interpreter::execute_kernel_CircleMirrorPad(), luci_interpreter::execute_kernel_CircleMul(), luci_interpreter::execute_kernel_CirclePRelu(), luci_interpreter::execute_kernel_CircleReduceCommon(), luci_interpreter::execute_kernel_CircleReduceMax(), luci_interpreter::execute_kernel_CircleResizeNearestNeighbor(), luci_interpreter::execute_kernel_CircleSub(), luci_interpreter::execute_kernel_CircleSum(), and luci_interpreter::execute_kernel_CircleTranspose().

◆ readInplaceData()

TISOData luci_interpreter::kernels::TISOKernel::readInplaceData ( uint8_t *&  inplace_data_ptr,
circle::Tensor *&  input_inplace_tensor 
)
inline

Definition at line 84 of file TISOKernel.h.

85 {
86 auto *input1_data = _runtime_graph->getDataByTensor(_input1_tensor);
87 if (input1_data != nullptr)
88 {
89 inplace_data_ptr = const_cast<uint8_t *>(input1_data);
90 input_inplace_tensor = const_cast<circle::Tensor *>(_input1_tensor);
91 }
92 if (input1_data == nullptr)
93 input1_data = _runtime_graph->getConstDataByTensor(_input1_tensor);
94
95 assert(input1_data);
96
97 auto *input2_data = _runtime_graph->getDataByTensor(_input2_tensor);
98 if (inplace_data_ptr == nullptr)
99 {
100 assert(input2_data != nullptr);
101 inplace_data_ptr = const_cast<uint8_t *>(input2_data);
102 input_inplace_tensor = const_cast<circle::Tensor *>(_input2_tensor);
103 }
104 if (input2_data == nullptr)
105 input2_data = _runtime_graph->getConstDataByTensor(_input2_tensor);
106 assert(input2_data);
107
108 assert(_runtime_graph->getDataByTensor(_output_tensor) == nullptr);
109
110 auto *output_data = inplace_data_ptr;
111 assert(output_data);
112
114 }

References luci_interpreter::RuntimeGraph::getConstDataByTensor(), and luci_interpreter::RuntimeGraph::getDataByTensor().

Referenced by luci_interpreter::kernels::evalTISOInplaceKernel(), and luci_interpreter::kernels::evalTISOInplaceQuantizedKernel().

◆ runtime_graph()

BaseRuntimeGraph * luci_interpreter::kernels::TISOKernel::runtime_graph ( ) const
inline

Definition at line 64 of file TISOKernel.h.

64{ return _runtime_graph; }

Referenced by luci_interpreter::kernels::evalTISOInplaceKernel(), and luci_interpreter::kernels::evalTISOInplaceQuantizedKernel().


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