chromium/third_party/xnnpack/src/src/operators/softmax-nc.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/microfnptr.h"
#include "xnnpack/microparams.h"
#include "xnnpack/operator-type.h"
#include "xnnpack/operator.h"
#include "xnnpack/params.h"
#include "pthreadpool.h"

enum xnn_status xnn_create_softmax_nc_qu8(
    float input_scale,
    uint8_t output_zero_point,
    float output_scale,
    uint32_t flags,
    xnn_operator_t* softmax_op_out)
{}

enum xnn_status xnn_reshape_softmax_nc_qu8(
    xnn_operator_t softmax_op,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t batch_size,
    pthreadpool_t threadpool)
{}

enum xnn_status xnn_setup_softmax_nc_qu8(
    xnn_operator_t softmax_op,
    const uint8_t* input,
    uint8_t* output)
{}

static enum xnn_status create_softmax_nc_floating_point(
    uint32_t flags,
    const struct xnn_raddstoreexpminusmax_config* raddstoreexpminusmax_config,
    const struct xnn_rmax_config* rmax_config,
    const struct xnn_binary_elementwise_config* vmul_config,
    enum xnn_operator_type operator_type,
    xnn_operator_t* softmax_op_out)
{}

enum xnn_status xnn_create_softmax_nc_f16(
    uint32_t flags,
    xnn_operator_t* softmax_op_out)
{}

enum xnn_status xnn_create_softmax_nc_f32(
    uint32_t flags,
    xnn_operator_t* softmax_op_out)
{}

static enum xnn_status reshape_softmax_nc_floating_point(
    xnn_operator_t softmax_op,
    enum xnn_operator_type expected_operator_type,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t batch_size,
    uint32_t log2_element_size,
    xnn_rmax_ukernel_fn rmax,
    const struct xnn_raddstoreexpminusmax_config raddstoreexpminusmax[restrict XNN_MIN_ELEMENTS(1)],
    const struct xnn_binary_elementwise_config* vmul,
    xnn_compute_reciprocal_fn compute_reciprocal,
    const void* rmax_params,
    size_t rmax_params_size,
    const void* expminus_params,
    size_t expminus_params_size,
    const void* minmax_params,
    size_t minmax_params_size)
{}

static enum xnn_status setup_softmax_nc_floating_point(
    xnn_operator_t softmax_op,
    enum xnn_operator_type expected_operator_type,
    const void* input,
    void* output)
{}

static void compute_reciprocal_f16(
    const uint16_t input[XNN_MIN_ELEMENTS(1)],
    uint16_t output[XNN_MIN_ELEMENTS(1)])
{}

enum xnn_status xnn_setup_softmax_nc_f16(
    xnn_operator_t softmax_op,
    const void* input,
    void* output)
{}

static void compute_reciprocal_f32(
    const float input[XNN_MIN_ELEMENTS(1)],
    float output[XNN_MIN_ELEMENTS(1)])
{}

enum xnn_status xnn_setup_softmax_nc_f32(
    xnn_operator_t softmax_op,
    const float* input,
    float* output)
{}

enum xnn_status xnn_reshape_softmax_nc_f16(
    xnn_operator_t softmax_op,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t batch_size,
    pthreadpool_t threadpool)
{}

enum xnn_status xnn_reshape_softmax_nc_f32(
    xnn_operator_t softmax_op,
    size_t channels,
    size_t input_stride,
    size_t output_stride,
    size_t batch_size,
    pthreadpool_t threadpool)
{}