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

Function test_kernel_apply_call_int_args

python/tests/mlir/call.py:146–159  ·  view source on GitHub ↗

Tests that we can call another kernel that's parameterized by an int (`other_kernel`), from a :class:`Kernel`.

()

Source from the content-addressed store, hash-verified

144
145
146def test_kernel_apply_call_int_args():
147 """
148 Tests that we can call another kernel that's parameterized
149 by an int (`other_kernel`), from a :class:`Kernel`.
150 """
151 other_kernel, other_int = cudaq.make_kernel(int)
152 other_qubit = other_kernel.qalloc()
153 # TODO:
154 # Would like to be able to test kernel operations that
155 # can accept an int.
156
157 kernel, _int = cudaq.make_kernel(int)
158 kernel.apply_call(other_kernel, _int)
159 print(kernel)
160
161
162# CHECK-LABEL: func.func @__nvqpp__mlirgen__PythonKernelBuilderInstance

Callers

nothing calls this directly

Calls 3

apply_callMethod · 0.80
printFunction · 0.50
qallocMethod · 0.45

Tested by

no test coverage detected