vcgadd
Function
vcgadd instruction abstraction.
Calculates the sum of each block element. There are eight blocks in total. Mixed addresses are not supported.
Prototype
1 | class vcgadd(x, y, reduce_num) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input x-vector tensor. FP16 and FP32 are supported. |
y |
Output |
Tensor variable |
Output y-vector tensor. FP16 and FP32 are supported. |
reduce_num |
Input |
int |
Reduction multiple of the shape. |
Constraints
The value of reduce_num cannot be 0.
Example
1 2 3 4 5 6 | from mskpp import vcgadd, Tensor ub_x, ub_y = Tensor("UB"), Tensor("UB") gm_x = Tensor("GM") reduce_num = 16 ub_x.load(gm_x) out = vcgadd(ub_x, ub_y, reduce_num)() |
Parent topic: Description of msKPP External APIs