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

Function test_float_capture

python/tests/kernel/test_kernel_float.py:35–46  ·  view source on GitHub ↗

Test that we can capture float lists inside kernel functions.

()

Source from the content-addressed store, hash-verified

33
34
35def test_float_capture():
36 """Test that we can capture float lists inside kernel functions."""
37
38 f = [1., 2]
39
40 # Capture a list of float
41 @cudaq.kernel
42 def float_vec_capture(i: int) -> float:
43 return f[i]
44
45 for i in range(len(f)):
46 assert is_close(f[i], float_vec_capture(i))
47
48
49def test_float_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