1925{
1929 assert(dilation_width_factor >= 1);
1930 assert(dilation_height_factor >= 1);
1935 [[maybe_unused]]
const int input_depth = input_shape.
Dims(3);
1936 assert(output_depth == input_depth * depth_multiplier);
1937 assert(bias_shape.
FlatSize() == output_depth);
1938
1939
1940#if 0
1941
1942
1943#if defined(__aarch64__) && !defined(GOOGLE_L4T)
1944#if defined(__ANDROID__) && defined(__clang__)
1945 CpuFlags cpu_flags;
1946 GetCpuFlags(&cpu_flags);
1947 const bool has_dot_product_instructions = cpu_flags.neon_dotprod;
1948
1949
1950 if (has_dot_product_instructions)
1951 {
1952 using optimized_ops::depthwise_conv::DotProduct3x3KernelType;
1953 DotProduct3x3KernelType kernel_type = optimized_ops::depthwise_conv::CategorizeDotProductKernel<
1954 optimized_ops::depthwise_conv::QuantizationType::kPerChannelInt8>(
1955 input_shape, filter_shape,
output_shape, params, output_shift);
1956 if (kernel_type != DotProduct3x3KernelType::kNone)
1957 {
1959 params_copy.output_shift_per_channel = output_shift;
1960 params_copy.output_multiplier_per_channel = output_multiplier;
1961 optimized_ops::depthwise_conv::DepthwiseConvDotProduct3x3PerChannel<
1962 DepthwiseConvImplementation::kUseNeon3x3DotProduct>(
1963 params_copy, input_shape, input_data, filter_shape, filter_data, bias_shape, bias_data,
1964 output_shape, output_data, thread_start, thread_end, thread_dim);
1965 return;
1966 }
1967 }
1968
1969#endif
1970
1971
1973 const int stride_height = params.stride_height;
1974 const int pad_width = params.padding_values.width;
1975 const int pad_height = params.padding_values.height;
1976
1977
1978
1979 if (optimized_ops::depthwise_conv::Fast3x3FilterKernelSupported<
1980 optimized_ops::depthwise_conv::QuantizationType::kPerChannelInt8>(
1981 input_shape, filter_shape, stride_width, stride_height, dilation_width_factor,
1982 dilation_height_factor, pad_width, pad_height, depth_multiplier,
output_shape, 0,
1983 output_shift))
1984 {
1985 optimized_ops::depthwise_conv::DepthwiseConv3x3FilterPerChannel<
1986 DepthwiseConvOutputRounding::kUpward>(
1987 params, output_multiplier, output_shift, input_shape, input_data, filter_shape, filter_data,
1988 bias_shape, bias_data,
output_shape, output_data, thread_start, thread_end, thread_dim);
1989 return;
1990 }
1991#endif
1992
1993#endif
1994
1995 depthwise_conv::DepthwiseConvGeneral(
1996 params, output_multiplier, output_shift, input_shape, input_data, filter_shape, filter_data,
1997 bias_shape, bias_data,
output_shape, output_data, thread_start, thread_end, thread_dim);
1998}
int32_t Dims(int i) const
int MatchingDim(const Shape &shape1, int index1, const Shape &shape2, int index2)
int16_t dilation_height_factor
int16_t dilation_width_factor