#ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_ADD_H_
#define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_ADD_H_
#include <algorithm>
#include <cstddef>
#include <limits>
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/types.h"
namespace tflite {
namespace reference_integer_ops {
inline void CheckArithmeticParams(const ArithmeticParams& params) { … }
template <typename T>
void BroadcastInput1(int size, const ArithmeticParams& params,
const T* input1_data, const T* input2_data, T* output_data,
void (*check_arithmetic_params)(const ArithmeticParams&),
T (*binary_func)(T, T, const ArithmeticParams&)) { … }
template <typename T>
void BroadcastInput2(int size, const ArithmeticParams& params,
const T* input1_data, const T* input2_data, T* output_data,
void (*check_arithmetic_params)(const ArithmeticParams&),
T (*binary_func)(T, T, const ArithmeticParams&)) { … }
template <typename T>
void ElementWise(int size, const ArithmeticParams& params, const T* input1_data,
const T* input2_data, T* output_data,
void (*check_arithmetic_params)(const ArithmeticParams&),
T (*binary_func)(T, T, const ArithmeticParams&)) { … }
template <typename T>
inline void BroadcastAddRecursiveDimensions(
const ArithmeticParams& params, int dimension, size_t* input1_offset_p,
size_t* input2_offset_p, size_t* output_offset,
size_t* compressed_input1_stride, size_t* compressed_input2_stride,
size_t* compressed_output_shape, const T* input1_data, const T* input2_data,
T* output_data, void (*check_arithmetic_params)(const ArithmeticParams&),
T (*binary_func)(T, T, const ArithmeticParams&)) { … }
template <typename T>
void BroadcastBinaryFunction6DSlow(
const ArithmeticParams& params, const RuntimeShape& input1_shape,
const T* input1_data, const RuntimeShape& input2_shape,
const T* input2_data, const RuntimeShape& output_shape, T* output_data,
void (*check_arithmetic_params)(const ArithmeticParams&),
T (*binary_func)(T, T, const ArithmeticParams&)) { … }
template <typename T>
void BroadcastBinaryFunction4DSlow(
const ArithmeticParams& params, const RuntimeShape& input1_shape,
const T* input1_data, const RuntimeShape& input2_shape,
const T* input2_data, const RuntimeShape& output_shape, T* output_data,
void (*check_arithmetic_params)(const ArithmeticParams&),
T (*binary_func)(T, T, const ArithmeticParams&)) { … }
inline int8_t AddFunc(int8_t x, int8_t y, const ArithmeticParams& params) { … }
inline void AddElementwise(int size, const ArithmeticParams& params,
const int8_t* input1_data, const int8_t* input2_data,
int8_t* output_data) { … }
inline void Add(const ArithmeticParams& params,
const RuntimeShape& input1_shape, const int8_t* input1_data,
const RuntimeShape& input2_shape, const int8_t* input2_data,
const RuntimeShape& output_shape, int8_t* output_data) { … }
inline void BroadcastAdd6DSlow(const ArithmeticParams& params,
const RuntimeShape& input1_shape,
const int8_t* input1_data,
const RuntimeShape& input2_shape,
const int8_t* input2_data,
const RuntimeShape& output_shape,
int8_t* output_data) { … }
inline void BroadcastAdd4DSlow(const ArithmeticParams& params,
const RuntimeShape& input1_shape,
const int8_t* input1_data,
const RuntimeShape& input2_shape,
const int8_t* input2_data,
const RuntimeShape& output_shape,
int8_t* output_data) { … }
}
}
#endif