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

Function validate_arguments

src/core/CL/kernels/CLTileKernel.cpp:40–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace
39{
40Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, const Multiples &multiples)
41{
42 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output);
43 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(input);
44 ARM_COMPUTE_RETURN_ERROR_ON(input->data_type() == DataType::UNKNOWN);
45 ARM_COMPUTE_RETURN_ERROR_ON(multiples.size() > 4);
46 ARM_COMPUTE_RETURN_ERROR_ON(multiples.empty());
47 ARM_COMPUTE_RETURN_ERROR_ON(std::any_of(multiples.begin(), multiples.end(), [](uint32_t e) { return e == 0; }));
48
49 const TensorShape output_shape = misc::shape_calculator::compute_tiled_shape(input->tensor_shape(), multiples);
50
51 // Validate output if initialized
52 if (output->total_size() != 0)
53 {
54 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(output);
55 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output_shape, output->tensor_shape());
56 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
57 }
58 else
59 {
60 const TensorInfo output_info(output_shape, input->num_channels(), input->data_type());
61 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(&output_info);
62 }
63
64 return Status{};
65}
66} // namespace
67
68CLTileKernel::CLTileKernel() : _input(nullptr), _output(nullptr)

Callers 2

configureMethod · 0.70
validateMethod · 0.70

Calls 8

compute_tiled_shapeFunction · 0.85
data_typeMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
total_sizeMethod · 0.45
num_channelsMethod · 0.45

Tested by

no test coverage detected