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

Function test_float64_capture

python/tests/kernel/test_kernel_float.py:91–102  ·  view source on GitHub ↗

Test that we can capture float lists inside kernel functions.

()

Source from the content-addressed store, hash-verified

89
90
91def test_float64_capture():
92 """Test that we can capture float lists inside kernel functions."""
93
94 f = [np.float64(1.), np.float64(2)]
95
96 # Capture a list of float
97 @cudaq.kernel
98 def float_vec_capture(i: int) -> np.float64:
99 return f[i]
100
101 for i in range(len(f)):
102 assert is_close(f[i], float_vec_capture(i))
103
104
105def test_float64_definition():

Callers

nothing calls this directly

Calls 3

float_vec_captureFunction · 0.85
is_closeFunction · 0.70
rangeFunction · 0.50

Tested by

no test coverage detected