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

Function test_float_params

python/tests/kernel/test_kernel_float.py:21–32  ·  view source on GitHub ↗

Test that we can pass float lists to kernel functions.

()

Source from the content-addressed store, hash-verified

19
20
21def test_float_params():
22 """Test that we can pass float lists to kernel functions."""
23
24 f = [1., 2]
25
26 # Pass a list of float as a parameter
27 @cudaq.kernel
28 def float_vec_param(vec: list[float], i: int) -> float:
29 return vec[i]
30
31 for i in range(len(f)):
32 assert is_close(f[i], float_vec_param(f, i))
33
34
35def test_float_capture():

Callers

nothing calls this directly

Calls 3

float_vec_paramFunction · 0.85
is_closeFunction · 0.70
rangeFunction · 0.50

Tested by

no test coverage detected