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

Method configure

src/core/CPP/kernels/CPPPermuteKernel.cpp:117–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void CPPPermuteKernel::configure(const ITensor *input, ITensor *output, const PermutationVector &perm)
118{
119 ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
120 const TensorShape output_shape = misc::shape_calculator::compute_permutation_output_shape(*input->info(), perm);
121 // Output auto inizialitation if not yet initialized
122 auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(output_shape));
123
124 // Perform validation step
125 ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), perm));
126
127 _input = input;
128 _output = output;
129 _perm = perm;
130
131 switch (input->info()->element_size())
132 {
133 case 1:
134 _func = &CPPPermuteKernel::run_permute<uint8_t>;
135 break;
136 case 2:
137 _func = &CPPPermuteKernel::run_permute<uint16_t>;
138 break;
139 case 4:
140 _func = &CPPPermuteKernel::run_permute<uint32_t>;
141 break;
142 default:
143 ARM_COMPUTE_ERROR("Element size not supported");
144 break;
145 }
146
147 // Configure kernel window
148 Window win = calculate_max_window(*input->info(), Steps());
149
150 // The CPPPermute doesn't need padding so update_window_and_padding() can be skipped
151 Coordinates coord;
152 coord.set_num_dimensions(output->info()->num_dimensions());
153 output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape()));
154
155 ICPPKernel::configure(win);
156}
157
158Status CPPPermuteKernel::validate(const ITensorInfo *input, const ITensorInfo *output, const PermutationVector &perm)
159{

Callers

nothing calls this directly

Calls 12

auto_init_if_emptyFunction · 0.85
StepsClass · 0.85
ValidRegionClass · 0.85
validate_argumentsFunction · 0.70
calculate_max_windowFunction · 0.50
infoMethod · 0.45
cloneMethod · 0.45
element_sizeMethod · 0.45
set_num_dimensionsMethod · 0.45
num_dimensionsMethod · 0.45
set_valid_regionMethod · 0.45

Tested by

no test coverage detected