vcmpv_xxx
Function
vcmpv_[eq|ge|gt|le|lt|ne] instruction abstraction. The following six instructions have the same performance.
vcmpv_eq: z = (x == y), where z can be obtained when x is equal to y by element-wise comparison.
vcmpv_ge: z = (x >= y), where z can be obtained when x is greater than or equal to y by element-wise comparison.
vcmpv_gt: z = (x > y), where z can be obtained when x is greater than y by element-wise comparison.
vcmpv_le: z = (x <= y), where z can be obtained when x is less than or equal to y by element-wise comparison.
vcmpv_lt: z = (x < y), where z can be obtained when x is smaller than y by element-wise comparison.
vcmpv_ne: z = (x != y), where z can be obtained when x is not equal to y by element-wise comparison.
Prototype
1 | class vcmpv(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 vcmpv, 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 = vcmpv(ub_x, ub_y, ub_z)() |