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

Function test_float_definition

python/tests/kernel/test_kernel_float.py:49–60  ·  view source on GitHub ↗

Test that we can define float lists inside kernel functions.

()

Source from the content-addressed store, hash-verified

47
48
49def test_float_definition():
50 """Test that we can define float lists inside kernel functions."""
51
52 f = [1., 2]
53
54 # Define a list of float inside a kernel
55 @cudaq.kernel
56 def float_vec_definition(i: int) -> float:
57 return [1., 2][i]
58
59 for i in range(len(f)):
60 assert is_close(f[i], float_vec_definition(i))
61
62
63def test_float_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