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

Function test_float32_params

python/tests/kernel/test_kernel_float.py:166–177  ·  view source on GitHub ↗

Test that we can pass float lists to kernel functions.

()

Source from the content-addressed store, hash-verified

164
165
166def test_float32_params():
167 """Test that we can pass float lists to kernel functions."""
168
169 f = [np.float32(1.), np.float32(2)]
170
171 # Pass a list of float as a parameter
172 @cudaq.kernel
173 def float_vec_param(vec: list[np.float32], i: int) -> np.float32:
174 return vec[i]
175
176 for i in range(len(f)):
177 assert is_close(f[i], float_vec_param(f, i))
178
179
180def test_float32_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