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

Method configure

src/gpu/cl/kernels/ClReshapeKernel.cpp:73–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void 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
100Status ClReshapeKernel::validate(const ITensorInfo *src, const ITensorInfo *dst)
101{

Callers

nothing calls this directly

Calls 7

get_padding_infoFunction · 0.85
create_kernelFunction · 0.85
has_padding_changedFunction · 0.85
validate_argumentsFunction · 0.70
calculate_max_windowFunction · 0.50
element_sizeMethod · 0.45

Tested by

no test coverage detected