vcmpvs_xxx
Function
vcmpvs_[eq|ge|gt|le|lt|ne] instruction abstraction. The following six instructions have the same performance.
vcmpvs_eq: z = (x == y), where z can be obtained when x is equal to scalar stored in y by element-wise comparison.
vcmpvs_ge: z = (x >= y), where z can be obtained when x is greater than or equal to scalar stored in y by element-wise comparison.
vcmpvs_gt: z = (x > y), where z can be obtained when x is greater than scalar stored in y by element-wise comparison.
vcmpvs_le: z = (x <= y), where z can be obtained when x is less than or equal to scalar stored in y by element-wise comparison.
vcmpvs_lt: z = (x < y), where z can be obtained when x is smaller than scalar stored in y by element-wise comparison.
vcmpvs_ne: z = (x != y), where z can be obtained when x is not equal to scalar stored in y by element-wise comparison.
Prototype
1 | class vcmpvs(x, y, z) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input x-vector tensor. FP16 and FP32 are supported. |
y |
Input |
Tensor variable |
Input y-vector tensor. FP16 and FP32 are supported. |
z |
Output |
Tensor variable |
Output vector tensor. |
Constraints
The tensors of all input and output data of vector instructions are in the UB space, and their shapes must be the same.
Example
1 2 3 4 5 6 | from mskpp import vcmpvs, Tensor ub_x, ub_y, ub_z = Tensor("UB"), Tensor("UB"), Tensor("UB") gm_x, gm_y = Tensor("GM"), Tensor("GM") ub_x.load(gm_x) ub_y.load(gm_y) out = vcmpvs(ub_x, ub_y, ub_z)() |