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

Function test_float64_definition

python/tests/kernel/test_kernel_float.py:105–116  ·  view source on GitHub ↗

Test that we can define float lists inside kernel functions.

()

Source from the content-addressed store, hash-verified

103
104
105def test_float64_definition():
106 """Test that we can define float lists inside kernel functions."""
107
108 f = [np.float64(1.), np.float64(2)]
109
110 # Define a list of float inside a kernel
111 @cudaq.kernel
112 def float_vec_definition(i: int) -> np.float64:
113 return [np.float64(1.), np.float64(2)][i]
114
115 for i in range(len(f)):
116 assert is_close(f[i], float_vec_definition(i))
117
118
119def test_float64_use():

Callers

nothing calls this directly

Calls 3

float_vec_definitionFunction · 0.85
is_closeFunction · 0.70
rangeFunction · 0.50

Tested by

no test coverage detected