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

Function test_float_use

python/tests/kernel/test_kernel_float.py:63–71  ·  view source on GitHub ↗

Test that we can use floats inside kernel functions.

()

Source from the content-addressed store, hash-verified

61
62
63def test_float_use():
64 """Test that we can use floats inside kernel functions."""
65
66 # Use a float inside np in a kernel
67 @cudaq.kernel
68 def float_np_use() -> float:
69 return np.sin(np.pi / 2 + 1)
70
71 assert is_close(np.sin(np.pi / 2 + 1), float_np_use())
72
73
74# np.float64

Callers

nothing calls this directly

Calls 2

float_np_useFunction · 0.85
is_closeFunction · 0.70

Tested by

no test coverage detected