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

Method configure

src/gpu/cl/kernels/ClDepthConcatenateKernel.cpp:71–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void ClDepthConcatenateKernel::configure(const CLCompileContext &compile_context,
72 ITensorInfo *src,
73 unsigned int depth_offset,
74 ITensorInfo *dst)
75{
76 ARM_COMPUTE_ERROR_ON_NULLPTR(src, dst);
77 ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, depth_offset, dst));
78
79 auto padding_info = get_padding_info({src, dst});
80
81 _depth_offset = depth_offset;
82
83 const unsigned int num_elems_processed_per_iteration = adjust_vec_size(16 / src->element_size(), src->dimension(0));
84
85 // Add build options
86 CLBuildOptions build_opts;
87 build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(src->data_type()));
88 build_opts.add_option("-DVEC_SIZE=" + support::cpp11::to_string(num_elems_processed_per_iteration));
89 build_opts.add_option("-DVEC_SIZE_LEFTOVER=" +
90 support::cpp11::to_string(src->dimension(0) % num_elems_processed_per_iteration));
91 if (is_data_type_quantized_asymmetric(src->data_type()) && src->quantization_info() != dst->quantization_info())
92 {
93 const UniformQuantizationInfo iq_info = src->quantization_info().uniform();
94 const UniformQuantizationInfo oq_info = dst->quantization_info().uniform();
95
96 build_opts.add_option("-DOFFSET_IN1=" + float_to_string_with_full_precision(iq_info.offset));
97 build_opts.add_option("-DOFFSET_OUT=" + float_to_string_with_full_precision(oq_info.offset));
98 build_opts.add_option("-DSCALE_IN1=" + float_to_string_with_full_precision(iq_info.scale));
99 build_opts.add_option("-DSCALE_OUT=" + float_to_string_with_full_precision(oq_info.scale));
100 }
101
102 std::string kernel_name = "concatenate";
103
104 // A macro guard to compile ONLY the kernel of interest
105 build_opts.add_option("-D" + upper_string(kernel_name));
106
107 // Create kernel
108 _kernel = create_kernel(compile_context, kernel_name, build_opts.options());
109
110 // Configure kernel window
111 auto win = calculate_max_window(*dst, Steps(num_elems_processed_per_iteration));
112 win.set(Window::DimZ, Window::Dimension(0, src->tensor_shape().z(), 1));
113 ICLKernel::configure_internal(win);
114
115 ARM_COMPUTE_ERROR_ON(has_padding_changed(padding_info));
116}
117
118Status ClDepthConcatenateKernel::validate(const arm_compute::ITensorInfo *src,
119 unsigned int depth_offset,

Callers

nothing calls this directly

Calls 15

get_padding_infoFunction · 0.85
adjust_vec_sizeFunction · 0.85
upper_stringFunction · 0.85
create_kernelFunction · 0.85
StepsClass · 0.85
has_padding_changedFunction · 0.85
validate_argumentsFunction · 0.70
to_stringFunction · 0.50
calculate_max_windowFunction · 0.50

Tested by

no test coverage detected