#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <fp16/fp16.h>
#include "xnnpack.h"
#include "xnnpack/allocator.h"
#include "xnnpack/cache.h"
#include "xnnpack/common.h"
#include "xnnpack/compute.h"
#include "xnnpack/config.h"
#include "xnnpack/indirection.h"
#include "xnnpack/log.h"
#include "xnnpack/math.h"
#include "xnnpack/microfnptr.h"
#include "xnnpack/microkernel-type.h"
#include "xnnpack/microparams-init.h"
#include "xnnpack/microparams.h"
#include "xnnpack/operator-type.h"
#include "xnnpack/operator-utils.h"
#include "xnnpack/operator.h"
#include "xnnpack/pack.h"
#include "xnnpack/params.h"
#include "pthreadpool.h"
#ifndef XNN_ENABLE_GEMM_M_SPECIALIZATION
#error "XNN_ENABLE_GEMM_M_SPECIALIZATION is not defined"
#endif
static enum xnn_status create_deconvolution2d_nhwc(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
const void* kernel,
const void* bias,
uint32_t flags,
uint32_t log2_input_element_size,
uint32_t log2_filter_element_size,
uint32_t bias_element_size,
xnn_pack_conv_goki_w_fn pack_conv_goki_w,
xnn_pack_deconv_goki_w_fn pack_deconv_goki_w,
const void* packing_params,
int input_padding_byte,
int packed_weights_padding_byte,
size_t extra_weights_bytes,
xnn_init_qs8_qc8w_scale_params_fn init_scale_params,
const float* scale_params,
xnn_init_qs8_qc8w_scale_params_fn init_kernel_scale_params,
const float* kernel_scale_params,
const void* params,
size_t params_size,
const struct jit_gemm_params* jit_gemm_params,
const struct xnn_gemm_config* gemm_config,
const struct gemm_fused_ukernels* gemm_ukernels,
enum xnn_operator_type operator_type,
bool dynamic_quantization,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status create_deconvolution2d_nhwc_qs8_qc8w(
enum xnn_operator_type operator_type,
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
int8_t input_zero_point,
float input_scale,
const float* kernel_scale,
const int8_t* kernel,
const int32_t* bias,
int8_t output_zero_point,
float output_scale,
int8_t output_min,
int8_t output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status xnn_create_deconvolution2d_nhwc_qs8_qc8w(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
int8_t input_zero_point,
float input_scale,
const float* kernel_scale,
const int8_t* kernel,
const int32_t* bias,
int8_t output_zero_point,
float output_scale,
int8_t output_min,
int8_t output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status xnn_create_deconvolution2d_nhwc_qs8(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
int8_t input_zero_point,
float input_scale,
float kernel_scale,
const int8_t* kernel,
const int32_t* bias,
int8_t output_zero_point,
float output_scale,
int8_t output_min,
int8_t output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status xnn_create_deconvolution2d_nhwc_qu8(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
uint8_t input_zero_point,
float input_scale,
uint8_t kernel_zero_point,
float kernel_scale,
const uint8_t* kernel,
const int32_t* bias,
uint8_t output_zero_point,
float output_scale,
uint8_t output_min,
uint8_t output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status xnn_create_deconvolution2d_nhwc_f16(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
const void* kernel,
const void* bias,
float output_min,
float output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status xnn_create_deconvolution2d_nhwc_qd8_f32_qc8w(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
const float* kernel_scale,
const int8_t* kernel,
const float* bias,
float output_min,
float output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
enum xnn_status xnn_create_deconvolution2d_nhwc_f32(
uint32_t output_padding_top,
uint32_t output_padding_right,
uint32_t output_padding_bottom,
uint32_t output_padding_left,
uint32_t kernel_height,
uint32_t kernel_width,
uint32_t stride_height,
uint32_t stride_width,
uint32_t dilation_height,
uint32_t dilation_width,
uint32_t groups,
size_t group_input_channels,
size_t group_output_channels,
size_t input_pixel_stride,
size_t output_pixel_stride,
const float* kernel,
const float* bias,
float output_min,
float output_max,
uint32_t flags,
xnn_code_cache_t code_cache,
xnn_weights_cache_t weights_cache,
xnn_operator_t* deconvolution_op_out)
{ … }
static enum xnn_status reshape_conv_path(
xnn_operator_t deconvolution_op,
size_t batch_size,
uint32_t log2_input_element_size,
uint32_t log2_filter_element_size,
uint32_t extra_weights_element_size,
uint32_t log2_output_element_size,
bool dynamic_quantization,
const void* params,
size_t params_size,
size_t num_threads)
{ … }
static enum xnn_status reshape_subconv2d_path(
xnn_operator_t deconvolution_op,
size_t batch_size,
uint32_t log2_input_element_size,
uint32_t log2_filter_element_size,
uint32_t extra_weights_element_size,
uint32_t log2_output_element_size,
bool dynamic_quantization,
const void* params,
size_t params_size,
size_t num_threads)
{ … }
static enum xnn_status reshape_deconvolution2d_nhwc(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
uint32_t log2_input_element_size,
uint32_t log2_filter_element_size,
uint32_t extra_weights_element_size,
uint32_t log2_output_element_size,
bool dynamic_quantization,
const void* params,
size_t params_size,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_deconvolution2d_nhwc_qs8(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_deconvolution2d_nhwc_qs8_qc8w(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_deconvolution2d_nhwc_qu8(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_deconvolution2d_nhwc_f16(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_deconvolution2d_nhwc_qd8_f32_qc8w(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_deconvolution2d_nhwc_f32(
xnn_operator_t deconvolution_op,
size_t batch_size,
size_t input_height,
size_t input_width,
uint32_t adjustment_height,
uint32_t adjustment_width,
size_t* output_height_out,
size_t* output_width_out,
pthreadpool_t threadpool)
{ … }
static enum xnn_status setup_conv_path(
xnn_operator_t deconvolution_op,
const void* input,
void* output)
{ … }
static enum xnn_status setup_subconv2d_path(
xnn_operator_t deconvolution_op,
const void* input,
void* output)
{ … }
static enum xnn_status setup_deconvolution2d_nhwc(
xnn_operator_t deconvolution_op,
enum xnn_operator_type expected_operator_type,
const void* input,
const void* quantization_params,
void* output)
{ … }
enum xnn_status xnn_setup_deconvolution2d_nhwc_qs8(
xnn_operator_t deconvolution_op,
const int8_t* input,
int8_t* output)
{ … }
enum xnn_status xnn_setup_deconvolution2d_nhwc_qs8_qc8w(
xnn_operator_t deconvolution_op,
const int8_t* input,
int8_t* output)
{ … }
enum xnn_status xnn_setup_deconvolution2d_nhwc_qu8(
xnn_operator_t deconvolution_op,
const uint8_t* input,
uint8_t* output)
{ … }
enum xnn_status xnn_setup_deconvolution2d_nhwc_f16(
xnn_operator_t deconvolution_op,
const void* input,
void* output)
{ … }
enum xnn_status xnn_setup_deconvolution2d_nhwc_qd8_f32_qc8w(
xnn_operator_t deconvolution_op,
const int8_t* input,
float* output,
const struct xnn_dynamic_quantization_params* quantization_params)
{ … }
enum xnn_status xnn_setup_deconvolution2d_nhwc_f32(
xnn_operator_t deconvolution_op,
const float* input,
float* output)
{ … }