ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_npu_quant.h
Go to the documentation of this file.
1
45
46#pragma once
47
48#include <stddef.h>
49#include <stdint.h>
50
51#include "ra8_err.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
77
111[[nodiscard]] ra8_err_t
112ra8_npu_quantize_i8(const float* in, int8_t* out, size_t count, float scale, int32_t zero_point);
113
142[[nodiscard]] ra8_err_t
143ra8_npu_dequantize_i8(const int8_t* in, float* out, size_t count, float scale, int32_t zero_point);
144
178[[nodiscard]] ra8_err_t
179ra8_npu_quantize_u8(const float* in, uint8_t* out, size_t count, float scale, int32_t zero_point);
180
209[[nodiscard]] ra8_err_t
210ra8_npu_dequantize_u8(const uint8_t* in, float* out, size_t count, float scale, int32_t zero_point);
211
212#ifdef __cplusplus
213}
214#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_npu_dequantize_u8(const uint8_t *in, float *out, size_t count, float scale, int32_t zero_point)
Dequantize a UINT8 tensor into a float arena (affine).
ra8_npu_quant_range_t
Saturation bounds of the supported quantized element types.
@ k_ra8_npu_quant_i8_min
INT8 lower saturation bound.
@ k_ra8_npu_quant_u8_max
UINT8 upper saturation bound.
@ k_ra8_npu_quant_i8_max
INT8 upper saturation bound.
@ k_ra8_npu_quant_u8_min
UINT8 lower saturation bound.
ra8_err_t ra8_npu_quantize_i8(const float *in, int8_t *out, size_t count, float scale, int32_t zero_point)
Quantize a float arena into an INT8 tensor (affine, saturating).
ra8_err_t ra8_npu_quantize_u8(const float *in, uint8_t *out, size_t count, float scale, int32_t zero_point)
Quantize a float arena into a UINT8 tensor (affine, saturating).
ra8_err_t ra8_npu_dequantize_i8(const int8_t *in, float *out, size_t count, float scale, int32_t zero_point)
Dequantize an INT8 tensor into a float arena (affine).