| 115 | } |
| 116 | |
| 117 | void 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 | |
| 158 | Status CPPPermuteKernel::validate(const ITensorInfo *input, const ITensorInfo *output, const PermutationVector &perm) |
| 159 | { |
nothing calls this directly
no test coverage detected