Lines Matching refs:context

84 bool validate(const IOperationValidationContext* context) {  in validate()  argument
85 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
86 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
88 const OperandType inputType = context->getInputType(kInputTensor); in validate()
96 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_3)); in validate()
98 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_2)); in validate()
100 return validateInputTypes(context, in validate()
102 validateOutputTypes(context, {inputType}); in validate()
105 bool prepare(IOperationExecutionContext* context) { in prepare() argument
106 const Shape& inputShape = context->getInputShape(kInputTensor); in prepare()
110 const Shape& beginShape = context->getInputShape(kBeginTensor); in prepare()
114 const Shape& sizeShape = context->getInputShape(kSizeTensor); in prepare()
118 const int32_t* beginData = context->getInputBuffer<int32_t>(kBeginTensor); in prepare()
119 const int32_t* sizeData = context->getInputBuffer<int32_t>(kSizeTensor); in prepare()
121 Shape outputShape = context->getOutputShape(kOutputTensor); in prepare()
134 return context->setOutputShape(kOutputTensor, outputShape); in prepare()
137 bool execute(IOperationExecutionContext* context) { in execute() argument
139 if (getNumberOfElements(context->getOutputShape(kOutputTensor)) == 0) return true; in execute()
140 switch (context->getInputType(kInputTensor)) { in execute()
142 return evalGeneric(context->getInputBuffer<_Float16>(kInputTensor), in execute()
143 context->getInputShape(kInputTensor), in execute()
144 context->getInputBuffer<int32_t>(kBeginTensor), in execute()
145 context->getInputShape(kBeginTensor), in execute()
146 context->getInputBuffer<int32_t>(kSizeTensor), in execute()
147 context->getInputShape(kSizeTensor), in execute()
148 context->getOutputBuffer<_Float16>(kOutputTensor), in execute()
149 context->getOutputShape(kOutputTensor)); in execute()
151 return evalGeneric(context->getInputBuffer<float>(kInputTensor), in execute()
152 context->getInputShape(kInputTensor), in execute()
153 context->getInputBuffer<int32_t>(kBeginTensor), in execute()
154 context->getInputShape(kBeginTensor), in execute()
155 context->getInputBuffer<int32_t>(kSizeTensor), in execute()
156 context->getInputShape(kSizeTensor), in execute()
157 context->getOutputBuffer<float>(kOutputTensor), in execute()
158 context->getOutputShape(kOutputTensor)); in execute()
160 return evalGeneric(context->getInputBuffer<int32_t>(kInputTensor), in execute()
161 context->getInputShape(kInputTensor), in execute()
162 context->getInputBuffer<int32_t>(kBeginTensor), in execute()
163 context->getInputShape(kBeginTensor), in execute()
164 context->getInputBuffer<int32_t>(kSizeTensor), in execute()
165 context->getInputShape(kSizeTensor), in execute()
166 context->getOutputBuffer<int32_t>(kOutputTensor), in execute()
167 context->getOutputShape(kOutputTensor)); in execute()
169 return evalGeneric(context->getInputBuffer<uint8_t>(kInputTensor), in execute()
170 context->getInputShape(kInputTensor), in execute()
171 context->getInputBuffer<int32_t>(kBeginTensor), in execute()
172 context->getInputShape(kBeginTensor), in execute()
173 context->getInputBuffer<int32_t>(kSizeTensor), in execute()
174 context->getInputShape(kSizeTensor), in execute()
175 context->getOutputBuffer<uint8_t>(kOutputTensor), in execute()
176 context->getOutputShape(kOutputTensor)); in execute()
178 return evalGeneric(context->getInputBuffer<int8_t>(kInputTensor), in execute()
179 context->getInputShape(kInputTensor), in execute()
180 context->getInputBuffer<int32_t>(kBeginTensor), in execute()
181 context->getInputShape(kBeginTensor), in execute()
182 context->getInputBuffer<int32_t>(kSizeTensor), in execute()
183 context->getInputShape(kSizeTensor), in execute()
184 context->getOutputBuffer<int8_t>(kOutputTensor), in execute()
185 context->getOutputShape(kOutputTensor)); in execute()