chromium/third_party/xnnpack/src/src/operators/global-average-pooling-nwc.c

// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// Copyright 2019 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <fp16/fp16.h>
#include "xnnpack.h"
#include "xnnpack/allocator.h"
#include "xnnpack/common.h"
#include "xnnpack/compute.h"
#include "xnnpack/config-types.h"
#include "xnnpack/config.h"
#include "xnnpack/log.h"
#include "xnnpack/math.h"
#include "xnnpack/microparams.h"
#include "xnnpack/operator-type.h"
#include "xnnpack/operator.h"
#include "xnnpack/params.h"
#include "pthreadpool.h"

static enum xnn_status create_global_average_pooling_nwc(
    uint32_t flags,
    uint32_t log2_element_size,
    size_t params_offset,
    const void* params,
    size_t params_size,
    enum xnn_operator_type operator_type,
    const struct xnn_gavgpool_config* gavgpool_config,
    xnn_operator_t* global_average_pooling_op_out)
{}

enum xnn_status xnn_create_global_average_pooling_nwc_qu8(
    uint8_t input_zero_point,
    float input_scale,
    uint8_t output_zero_point,
    float output_scale,
    uint8_t output_min,
    uint8_t output_max,
    uint32_t flags,
    xnn_operator_t* global_average_pooling_op_out)
{}

enum xnn_status xnn_create_global_average_pooling_nwc_qs8(
    int8_t input_zero_point,
    float input_scale,
    int8_t output_zero_point,
    float output_scale,
    int8_t output_min,
    int8_t output_max,
    uint32_t flags,
    xnn_operator_t* global_average_pooling_op_out)
{}

enum xnn_status xnn_create_global_average_pooling_nwc_f16(
    float output_min,
    float output_max,
    uint32_t flags,
    xnn_operator_t* global_average_pooling_op_out)
{}

enum xnn_status xnn_create_global_average_pooling_nwc_f32(
    float output_min,
    float output_max,
    uint32_t flags,
    xnn_operator_t* global_average_pooling_op_out)
{}

enum xnn_status xnn_create_global_sum_pooling_nwc_f16(
    float output_min,
    float output_max,
    uint32_t flags,
    xnn_operator_t* global_sum_pooling_op_out)
{}

enum xnn_status xnn_create_global_sum_pooling_nwc_f32(
    float output_min,
    float output_max,
    uint32_t flags,
    xnn_operator_t* global_sum_pooling_op_out)
{}

static enum xnn_status reshape_global_average_pooling_nwc(
    xnn_operator_t global_average_pooling_op,
    size_t batch_size,
    size_t width,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t* workspace_size,
    size_t* workspace_alignment,
    size_t log2_data_element_size,
    size_t log2_accumulator_element_size,
    const struct xnn_gavgpool_config gavgpool[restrict XNN_MIN_ELEMENTS(1)],
    enum xnn_operator_type expected_operator_type,
    const void* params,
    size_t params_size,
    void (*update_params)(xnn_operator_t, size_t),
    pthreadpool_t threadpool)
{}

static void update_params_qu8(
  xnn_operator_t global_average_pooling_op,
  size_t width)
{}

enum xnn_status xnn_reshape_global_average_pooling_nwc_qu8(
    xnn_operator_t global_average_pooling_op,
    size_t batch_size,
    size_t width,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t* workspace_size,
    size_t* workspace_alignment,
    pthreadpool_t threadpool)
{}

static void update_params_qs8(
  xnn_operator_t global_average_pooling_op,
  size_t width)
{}

enum xnn_status xnn_reshape_global_average_pooling_nwc_qs8(
    xnn_operator_t global_average_pooling_op,
    size_t batch_size,
    size_t width,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t* workspace_size,
    size_t* workspace_alignment,
    pthreadpool_t threadpool)
{}

static void update_params_f16(
  xnn_operator_t global_average_pooling_op,
  size_t width)
{}

enum xnn_status xnn_reshape_global_average_pooling_nwc_f16(
    xnn_operator_t global_average_pooling_op,
    size_t batch_size,
    size_t width,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t* workspace_size,
    size_t* workspace_alignment,
    pthreadpool_t threadpool)
{}

static void update_params_f32(
  xnn_operator_t global_average_pooling_op,
  size_t width)
{}

enum xnn_status xnn_reshape_global_average_pooling_nwc_f32(
    xnn_operator_t global_average_pooling_op,
    size_t batch_size,
    size_t width,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t* workspace_size,
    size_t* workspace_alignment,
    pthreadpool_t threadpool)
{}

static enum xnn_status setup_global_average_pooling_nwc(
    xnn_operator_t global_average_pooling_op,
    enum xnn_operator_type expected_operator_type,
    void* workspace,
    const void* input,
    void* output)
{}

enum xnn_status xnn_setup_global_average_pooling_nwc_qu8(
    xnn_operator_t global_average_pooling_op,
    void* workspace,
    const uint8_t* input,
    uint8_t* output)
{}

enum xnn_status xnn_setup_global_average_pooling_nwc_qs8(
  xnn_operator_t global_average_pooling_op,
  void* workspace,
  const int8_t* input,
  int8_t* output)
{}

enum xnn_status xnn_setup_global_average_pooling_nwc_f16(
  xnn_operator_t global_average_pooling_op,
  void* workspace,
  const void* input,
  void* output)
{}

enum xnn_status xnn_setup_global_average_pooling_nwc_f32(
    xnn_operator_t global_average_pooling_op,
    void* workspace,
    const float* input,
    float* output)
{}

enum xnn_status xnn_reshape_global_sum_pooling_nwc_f16(
  xnn_operator_t global_sum_pooling_op,
  size_t batch_size,
  size_t width,
  size_t channels,
  size_t input_stride,
  size_t output_stride,
  size_t* workspace_size,
  size_t* workspace_alignment,
  pthreadpool_t threadpool)
{}

enum xnn_status xnn_reshape_global_sum_pooling_nwc_f32(
  xnn_operator_t global_sum_pooling_op,
  size_t batch_size,
  size_t width,
  size_t channels,
  size_t input_stride,
  size_t output_stride,
  size_t* workspace_size,
  size_t* workspace_alignment,
  pthreadpool_t threadpool)
{}

enum xnn_status xnn_setup_global_sum_pooling_nwc_f16(
  xnn_operator_t global_sum_pooling_op,
  void* workspace,
  const void* input,
  void* output)
{}

enum xnn_status xnn_setup_global_sum_pooling_nwc_f32(
  xnn_operator_t global_sum_pooling_op,
  void* workspace,
  const float* input,
  float* output)
{}