Lines Matching refs:context
190 bool validate(const IOperationValidationContext* context) { in validate() argument
191 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
192 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
194 auto inputType = context->getInputType(kInputTensor); in validate()
219 NN_RET_CHECK(validateInputTypes(context, inExpectedTypes)); in validate()
220 NN_RET_CHECK(validateOutputTypes(context, {inputType})); in validate()
222 return validateHalVersion(context, HalVersion::V1_3); in validate()
225 return validateHalVersion(context, HalVersion::V1_2); in validate()
229 bool prepare(IOperationExecutionContext* context) { in prepare() argument
230 bool useNchw = context->getInputValue<bool>(kLayoutScalar); in prepare()
231 Shape input = context->getInputShape(kInputTensor); in prepare()
232 Shape roiShape = context->getInputShape(kRoiTensor); in prepare()
233 Shape batchSplitShape = context->getInputShape(kBatchSplitTensor); in prepare()
245 auto outputHeight = context->getInputValue<int32_t>(kOutputHeightScalar); in prepare()
246 auto outputWidth = context->getInputValue<int32_t>(kOutputWidthScalar); in prepare()
248 if (context->getInputType(kInputTensor) == OperandType::TENSOR_FLOAT16) { in prepare()
249 heightStride = context->getInputValue<_Float16>(kHeightStrideSalar); in prepare()
250 widthStride = context->getInputValue<_Float16>(kWidthStrideScalar); in prepare()
252 heightStride = context->getInputValue<float>(kHeightStrideSalar); in prepare()
253 widthStride = context->getInputValue<float>(kWidthStrideScalar); in prepare()
273 return context->setOutputShape(kOutputTensor, output); in prepare()
276 bool execute(IOperationExecutionContext* context) { in execute() argument
277 switch (context->getInputType(kInputTensor)) { in execute()
279 return roiPooling(context->getInputBuffer<_Float16>(kInputTensor), in execute()
280 context->getInputShape(kInputTensor), in execute()
281 context->getInputBuffer<_Float16>(kRoiTensor), in execute()
282 context->getInputShape(kRoiTensor), in execute()
283 context->getInputBuffer<int32_t>(kBatchSplitTensor), in execute()
284 context->getInputShape(kBatchSplitTensor), in execute()
285 context->getInputValue<_Float16>(kHeightStrideSalar), in execute()
286 context->getInputValue<_Float16>(kWidthStrideScalar), in execute()
287 context->getInputValue<bool>(kLayoutScalar), in execute()
288 context->getOutputBuffer<_Float16>(kOutputTensor), in execute()
289 context->getOutputShape(kOutputTensor)); in execute()
291 return roiPooling(context->getInputBuffer<float>(kInputTensor), in execute()
292 context->getInputShape(kInputTensor), in execute()
293 context->getInputBuffer<float>(kRoiTensor), in execute()
294 context->getInputShape(kRoiTensor), in execute()
295 context->getInputBuffer<int32_t>(kBatchSplitTensor), in execute()
296 context->getInputShape(kBatchSplitTensor), in execute()
297 context->getInputValue<float>(kHeightStrideSalar), in execute()
298 context->getInputValue<float>(kWidthStrideScalar), in execute()
299 context->getInputValue<bool>(kLayoutScalar), in execute()
300 context->getOutputBuffer<float>(kOutputTensor), in execute()
301 context->getOutputShape(kOutputTensor)); in execute()
303 return roiPooling(context->getInputBuffer<uint8_t>(kInputTensor), in execute()
304 context->getInputShape(kInputTensor), in execute()
305 context->getInputBuffer<uint16_t>(kRoiTensor), in execute()
306 context->getInputShape(kRoiTensor), in execute()
307 context->getInputBuffer<int32_t>(kBatchSplitTensor), in execute()
308 context->getInputShape(kBatchSplitTensor), in execute()
309 context->getInputValue<float>(kHeightStrideSalar), in execute()
310 context->getInputValue<float>(kWidthStrideScalar), in execute()
311 context->getInputValue<bool>(kLayoutScalar), in execute()
312 context->getOutputBuffer<uint8_t>(kOutputTensor), in execute()
313 context->getOutputShape(kOutputTensor)); in execute()
315 return roiPooling(context->getInputBuffer<int8_t>(kInputTensor), in execute()
316 context->getInputShape(kInputTensor), in execute()
317 context->getInputBuffer<uint16_t>(kRoiTensor), in execute()
318 context->getInputShape(kRoiTensor), in execute()
319 context->getInputBuffer<int32_t>(kBatchSplitTensor), in execute()
320 context->getInputShape(kBatchSplitTensor), in execute()
321 context->getInputValue<float>(kHeightStrideSalar), in execute()
322 context->getInputValue<float>(kWidthStrideScalar), in execute()
323 context->getInputValue<bool>(kLayoutScalar), in execute()
324 context->getOutputBuffer<int8_t>(kOutputTensor), in execute()
325 context->getOutputShape(kOutputTensor)); in execute()