vreducev2
Function
vreducev2 instruction abstraction.
The vreducev2 instruction determines which block-level elements of the x vector are to be stored in the z vector based on the mask data of the input y vector. Because the tensor in msKPP lacks related concepts, the reserve_num parameter is added to determine the shape of the z output.
Prototype
1 | class vreducev2(x, y, z, reserve_num) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input x-vector tensor. UINT16 and UINT32 are supported. |
y |
Input |
Tensor variable |
Input y-vector tensor. UINT16 and UINT32 are supported. |
z |
Output |
Tensor variable |
Output z-vector tensor. UINT16 and UINT32 are supported. |
reserve_num |
Input |
int |
Number of output elements. |
Example
1 2 3 4 5 6 7 8 | from mskpp import vreducev2, Tensor ub_x, ub_y, ub_z = Tensor("UB"), Tensor("UB"), Tensor("UB") gm_x, gm_y, gm_z = Tensor("GM"), Tensor("GM"), Tensor("GM") reserve_num = 16 ub_x.load(gm_x) ub_y.load(gm_y) out = vreducev2(ub_x, ub_y, ub_z, reserve_num)() gm_z.load(out[0]) |
Parent topic: Description of msKPP External APIs