Common implementation for `mz` / `mx` / `my`. Emits the measurement op of class `opClass` against `target`, optionally tagging the result with `regName`, and returns the result as a :class:`QuakeValue`.
(self, opClass, target, regName)
| 1126 | ) |
| 1127 | |
| 1128 | def __measure(self, opClass, target, regName): |
| 1129 | """Common implementation for `mz` / `mx` / `my`. Emits the measurement |
| 1130 | op of class `opClass` against `target`, optionally tagging the result |
| 1131 | with `regName`, and returns the result as a :class:`QuakeValue`.""" |
| 1132 | with self.ctx, self.insertPoint, self.loc: |
| 1133 | measTy = cc.MeasureHandleType.get() |
| 1134 | if quake.VeqType.isinstance(target.mlirValue.type): |
| 1135 | measTy = cc.StdvecType.get(measTy) |
| 1136 | if regName is not None: |
| 1137 | res = opClass(measTy, [], [target.mlirValue], |
| 1138 | registerName=StringAttr.get(regName, |
| 1139 | context=self.ctx)) |
| 1140 | else: |
| 1141 | res = opClass(measTy, [], [target.mlirValue]) |
| 1142 | return self.__createQuakeValue(res.measOut) |
| 1143 | |
| 1144 | def mz(self, target, regName=None): |
| 1145 | """ |
no test coverage detected