MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / validate

Method validate

src/core/NEON/kernels/NELogicalKernel.cpp:297–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297Status NELogicalKernel::validate(const ITensorInfo *input1,
298 const ITensorInfo *input2,
299 const ITensorInfo *output,
300 LogicalOperation op)
301{
302 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input1);
303 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(input1);
304 ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input1, 1, DataType::U8);
305 ARM_COMPUTE_RETURN_ERROR_ON(op == LogicalOperation::Unknown);
306
307 TensorShape out_shape = input1->tensor_shape();
308 if (op != LogicalOperation::Not)
309 {
310 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input2);
311 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(input2);
312 out_shape = TensorShape::broadcast_shape(input1->tensor_shape(), input2->tensor_shape());
313 ARM_COMPUTE_RETURN_ERROR_ON_MSG(out_shape.total_size() == 0, "Inputs are not broadcast compatible");
314 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input1, input2);
315 }
316
317 // Checks performed when output is configured
318 if ((output != nullptr) && (output->total_size() != 0))
319 {
320 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(output);
321 ARM_COMPUTE_RETURN_ERROR_ON(detail::have_different_dimensions(out_shape, output->tensor_shape(), 0));
322 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input1, output);
323 }
324 else
325 {
326 const TensorInfo output_info(out_shape, input1->num_channels(), input1->data_type());
327 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(&output_info);
328 }
329
330 return Status{};
331}
332
333void NELogicalKernel::run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info)
334{

Callers

nothing calls this directly

Calls 4

total_sizeMethod · 0.45
num_channelsMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected