Vector API 快速访问链接
下表列出了向量API的函数。"EW"列指示操作是否逐元素执行。
"签名"列旨在快速传达操作的概念输入和输出的类型。这些签名仅旨在传达有多少(概念上的)输入和输出以及它们的维度。
这些函数本身通常需要比这些签名所示的更多的参数。例如,大多数函数接受向量长度作为输入,并且许多函数接受用于控制元素位深度增长的移位值。请查阅对应函数的完整文档以获取更详细的信息。
以下符号在签名中使用:
| 符号 | 描述 |
|---|---|
| 标量输入或输出值。 | |
| 向量值输入或输出。 | |
| 矩阵值输入或输出。 | |
| 占位符,表示无输入或输出。 |
例如,操作签名 表示该操作接受两个向量输入和一个标量输入,并且输出为一个向量。
32位向量操作
16位向量操作
8位向量操作
| 函数 | EW | 签名 | Brief |
|---|---|---|---|
vect_s8_is_negative() | x | Identify negative elements |
32位复数向量操作
16位复数向量操作
定点数向量操作
| 函数 | EW | 签名 |
|---|---|---|
vect_q30_power_series() | x | |
vect_q30_exp_small() | x | |
chunk_q30_power_series() | x | |
chunk_q30_exp_small() | x |
浮点数向量操作
Note that several of the functions below take vectors of the split_acc_s32_t type. This is a 32-bit vector type used for accumulating results of 8- or 16-bit operations in a manner optimized for the XS3 VPU.
其他向量操作
| 函数 | EW | 签名 |
|---|---|---|
vect_split_acc_s32_shr() | x | |
vect_s32_merge_accs() | x | |
vect_s32_split_accs() | x | |
chunk_s16_accumulate() | x | |
mat_mul_s8_x_s8_yield_s32() | ||
mat_mul_s8_x_s16_yield_s32() |
向量类型转换
| 函数 | 输入元素的类型 | 输出元素的类型 |
|---|---|---|
vect_s16_to_vect_s32() | int16_t | int32_t |
vect_s32_to_vect_s16() | int32_t | int16_t |
vect_s32_to_vect_f32() | int32_t | float |
vect_f32_to_vect_s32() | float | int32_t |
vect_complex_s16_to_vect_complex_s32() | complex_s16_t | complex_s32_t |
vect_complex_s32_to_vect_complex_s16() | complex_s32_t | complex_s16_t |