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

Function test_float64_params

python/tests/kernel/test_kernel_float.py:77–88  ·  view source on GitHub ↗

Test that we can pass float lists to kernel functions.

()

Source from the content-addressed store, hash-verified

75
76
77def test_float64_params():
78 """Test that we can pass float lists to kernel functions."""
79
80 f = [np.float64(1.), np.float64(2)]
81
82 # Pass a list of float as a parameter
83 @cudaq.kernel
84 def float_vec_param(vec: list[np.float64], i: int) -> np.float64:
85 return vec[i]
86
87 for i in range(len(f)):
88 assert is_close(f[i], float_vec_param(f, i))
89
90
91def test_float64_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