MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / getConstantInt

Method getConstantInt

python/cudaq/kernel/ast_bridge.py:582–589  ·  view source on GitHub ↗

Create a constant integer operation and return its MLIR result Value. Takes as input the concrete integer value. Can specify the integer bit width.

(self, value, width=64)

Source from the content-addressed store, hash-verified

580 eTy)).result
581
582 def getConstantInt(self, value, width=64):
583 """Create a constant integer operation and return its MLIR result Value.
584
585 Takes as input the concrete integer value. Can specify the integer bit
586 width.
587 """
588 ty = self.getIntegerType(width)
589 return arith.ConstantOp(ty, self.getIntegerAttr(ty, value)).result
590
591 def __arithmetic_to_bool(self, value):
592 """Converts an integer or floating point value to a bool by comparing it

Callers 14

__arithmetic_to_boolMethod · 0.95
visit_CallMethod · 0.95
visit_ListCompMethod · 0.95
visit_ConstantMethod · 0.95
fix_negative_idxMethod · 0.95
visit_SubscriptMethod · 0.95
visit_ForMethod · 0.95
process_boolean_opMethod · 0.95

Calls 2

getIntegerTypeMethod · 0.95
getIntegerAttrMethod · 0.95

Tested by

no test coverage detected