| 71 | } |
| 72 | |
| 73 | void ClReshapeKernel::configure(const CLCompileContext &compile_context, const ITensorInfo *src, ITensorInfo *dst) |
| 74 | { |
| 75 | ARM_COMPUTE_ERROR_ON_NULLPTR(src, dst); |
| 76 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, dst)); |
| 77 | |
| 78 | auto padding_info = get_padding_info({src, dst}); |
| 79 | |
| 80 | // Create kernel |
| 81 | std::set<std::string> build_opts = {"-DDATA_TYPE=" + get_cl_unsigned_type_from_element_size(src->element_size())}; |
| 82 | _kernel = create_kernel(compile_context, "reshape_layer", build_opts); |
| 83 | |
| 84 | // Add static arguments |
| 85 | const cl_int2 src_shape = { |
| 86 | {static_cast<cl_int>(src->tensor_shape()[0]), static_cast<cl_int>(src->tensor_shape()[1])}}; |
| 87 | const cl_int2 dst_shape = { |
| 88 | {static_cast<cl_int>(dst->tensor_shape()[0]), static_cast<cl_int>(dst->tensor_shape()[1])}}; |
| 89 | unsigned int idx = 2 * num_arguments_per_3D_tensor(); // Skip the src and dst parameters |
| 90 | _kernel.setArg<cl_int2>(idx++, src_shape); |
| 91 | _kernel.setArg<cl_int2>(idx++, dst_shape); |
| 92 | |
| 93 | // Configure kernel window |
| 94 | Window win = calculate_max_window(*dst); |
| 95 | ICLKernel::configure_internal(win); |
| 96 | |
| 97 | ARM_COMPUTE_ERROR_ON(has_padding_changed(padding_info)); |
| 98 | } |
| 99 | |
| 100 | Status ClReshapeKernel::validate(const ITensorInfo *src, const ITensorInfo *dst) |
| 101 | { |
nothing calls this directly
no test coverage detected