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

Function test_float32_definition

python/tests/kernel/test_kernel_float.py:194–205  ·  view source on GitHub ↗

Test that we can define float lists inside kernel functions.

()

Source from the content-addressed store, hash-verified

192
193
194def test_float32_definition():
195 """Test that we can define float lists inside kernel functions."""
196
197 f = [np.float32(1.), np.float32(2)]
198
199 # Define a list of float inside a kernel
200 @cudaq.kernel
201 def float_vec_definition(i: int) -> np.float32:
202 return [np.float32(1.), np.float32(2)][i]
203
204 for i in range(len(f)):
205 assert is_close(f[i], float_vec_definition(i))
206
207
208def test_float32_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