#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.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/operator-type.h"
#include "xnnpack/operator.h"
#include "xnnpack/params.h"
#include "pthreadpool.h"
static bool is_continugous(xnn_operator_t lut_elementwise_op)
{ … }
xnn_lut_init_fn;
static enum xnn_status create_lut_elementwise_nc(
int32_t input_zero_point,
float input_scale,
int32_t input_min,
long output_zero_point,
float output_scale,
long output_min,
long output_max,
uint32_t flags,
xnn_lut_init_fn init_fn,
const void* init_params,
enum xnn_operator_type operator_type,
xnn_operator_t* lut_elementwise_op_out)
{ … }
static float calculate_elu(float x, const float* alpha_ptr) { … }
enum xnn_status xnn_create_elu_nc_qs8(
float alpha,
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* elu_op_out)
{ … }
static float calculate_sigmoid(float x, const void* params) { … }
enum xnn_status xnn_create_sigmoid_nc_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* sigmoid_op_out)
{ … }
enum xnn_status xnn_create_sigmoid_nc_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* sigmoid_op_out)
{ … }
static float calculate_tanh(float x, const void* params) { … }
enum xnn_status xnn_create_tanh_nc_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* tanh_op_out)
{ … }
enum xnn_status xnn_create_tanh_nc_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* tanh_op_out)
{ … }
static enum xnn_status reshape_lut_elementwise_nc(
xnn_operator_t lut_elementwise_op,
enum xnn_operator_type expected_operator_type,
size_t batch_size,
size_t channels,
size_t input_stride,
size_t output_stride,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_elu_nc_qs8(
xnn_operator_t elu_op,
size_t batch_size,
size_t channels,
size_t input_stride,
size_t output_stride,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_sigmoid_nc_qs8(
xnn_operator_t sigmoid_op,
size_t batch_size,
size_t channels,
size_t input_stride,
size_t output_stride,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_sigmoid_nc_qu8(
xnn_operator_t sigmoid_op,
size_t batch_size,
size_t channels,
size_t input_stride,
size_t output_stride,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_tanh_nc_qs8(
xnn_operator_t tanh_op,
size_t batch_size,
size_t channels,
size_t input_stride,
size_t output_stride,
pthreadpool_t threadpool)
{ … }
enum xnn_status xnn_reshape_tanh_nc_qu8(
xnn_operator_t tanh_op,
size_t batch_size,
size_t channels,
size_t input_stride,
size_t output_stride,
pthreadpool_t threadpool)
{ … }
static enum xnn_status setup_lut_elementwise_nc(
xnn_operator_t lut_elementwise_op,
enum xnn_operator_type expected_operator_type,
const void* input,
void* output)
{ … }
enum xnn_status xnn_setup_elu_nc_qs8(
xnn_operator_t elu_op,
const int8_t* input,
int8_t* output)
{ … }
enum xnn_status xnn_setup_sigmoid_nc_qs8(
xnn_operator_t sigmoid_op,
const int8_t* input,
int8_t* output)
{ … }
enum xnn_status xnn_setup_sigmoid_nc_qu8(
xnn_operator_t sigmoid_op,
const uint8_t* input,
uint8_t* output)
{ … }
enum xnn_status xnn_setup_tanh_nc_qs8(
xnn_operator_t tanh_op,
const int8_t* input,
int8_t* output)
{ … }
enum xnn_status xnn_setup_tanh_nc_qu8(
xnn_operator_t tanh_op,
const uint8_t* input,
uint8_t* output)
{ … }