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

Function test_float32_capture

python/tests/kernel/test_kernel_float.py:180–191  ·  view source on GitHub ↗

Test that we can capture float lists inside kernel functions.

()

Source from the content-addressed store, hash-verified

178
179
180def test_float32_capture():
181 """Test that we can capture float lists inside kernel functions."""
182
183 f = [np.float32(1.), np.float32(2)]
184
185 # Capture a list of float
186 @cudaq.kernel
187 def float_vec_capture(i: int) -> np.float32:
188 return f[i]
189
190 for i in range(len(f)):
191 assert is_close(f[i], float_vec_capture(i))
192
193
194def test_float32_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