API Reference Manual  1.46.0
spec/ml_quantize.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2023 Nokia
3  * Copyright (c) 2024 Marvell
4  */
5 
12 #ifndef ODP_API_SPEC_ML_QUANTIZE_H_
13 #define ODP_API_SPEC_ML_QUANTIZE_H_
14 #include <odp/visibility_begin.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <odp/api/std_types.h>
21 
40 void odp_ml_fp32_to_uint8(uint8_t *dst_u8, const float *src_fp32, uint32_t num,
41  float scale, uint8_t zerop);
42 
57 void odp_ml_fp32_from_uint8(float *dst_fp32, const uint8_t *src_u8, uint32_t num,
58  float scale, uint8_t zerop);
59 
74 void odp_ml_fp32_to_int8(int8_t *dst_i8, const float *src_fp32, uint32_t num, float scale,
75  int8_t zerop);
76 
91 void odp_ml_fp32_from_int8(float *dst_fp32, const int8_t *src_i8, uint32_t num, float scale,
92  int8_t zerop);
93 
108 void odp_ml_fp32_to_uint16(uint16_t *dst_u16, const float *src_fp32, uint32_t num, float scale,
109  uint16_t zerop);
110 
125 void odp_ml_fp32_from_uint16(float *dst_fp32, const uint16_t *src_u16, uint32_t num, float scale,
126  uint16_t zerop);
127 
142 void odp_ml_fp32_to_int16(int16_t *dst_i16, const float *src_fp32, uint32_t num, float scale,
143  int16_t zerop);
144 
159 void odp_ml_fp32_from_int16(float *dst_fp32, const int16_t *src_i16, uint32_t num, float scale,
160  int16_t zerop);
161 
171 void odp_ml_fp32_to_fp16(uint16_t *dst_fp16, const float *src_fp32, uint32_t num);
172 
182 void odp_ml_fp32_from_fp16(float *dst_fp32, const uint16_t *src_fp16, uint32_t num);
183 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #include <odp/visibility_end.h>
193 #endif
Standard C language types and definitions for ODP.
void odp_ml_fp32_from_uint16(float *dst_fp32, const uint16_t *src_u16, uint32_t num, float scale, uint16_t zerop)
De-quantize 32-bit float from uint16_t.
void odp_ml_fp32_to_fp16(uint16_t *dst_fp16, const float *src_fp32, uint32_t num)
Quantize 32-bit float to 16-bit float.
void odp_ml_fp32_to_int8(int8_t *dst_i8, const float *src_fp32, uint32_t num, float scale, int8_t zerop)
Quantize 32-bit float to int8_t.
void odp_ml_fp32_from_fp16(float *dst_fp32, const uint16_t *src_fp16, uint32_t num)
De-quantize 32-bit float from 16-bit float.
void odp_ml_fp32_from_uint8(float *dst_fp32, const uint8_t *src_u8, uint32_t num, float scale, uint8_t zerop)
De-quantize 32-bit float from uint8_t.
void odp_ml_fp32_to_uint16(uint16_t *dst_u16, const float *src_fp32, uint32_t num, float scale, uint16_t zerop)
Quantize 32-bit float to uint16_t.
void odp_ml_fp32_from_int16(float *dst_fp32, const int16_t *src_i16, uint32_t num, float scale, int16_t zerop)
De-quantize 32-bit float from int16_t.
void odp_ml_fp32_to_uint8(uint8_t *dst_u8, const float *src_fp32, uint32_t num, float scale, uint8_t zerop)
Quantize 32-bit float to uint8_t.
void odp_ml_fp32_from_int8(float *dst_fp32, const int8_t *src_i8, uint32_t num, float scale, int8_t zerop)
De-quantize 32-bit float from int8_t.
void odp_ml_fp32_to_int16(int16_t *dst_i16, const float *src_fp32, uint32_t num, float scale, int16_t zerop)
Quantize 32-bit float to int16_t.