Test that we can capture float lists inside kernel functions.
()
| 178 | |
| 179 | |
| 180 | def test_float32_capture(): |
| 181 | """Test that we can capture float lists inside kernel functions.""" |
| 182 | |
| 183 | f = [np.float32(1.), np.float32(2)] |
| 184 | |
| 185 | # Capture a list of float |
| 186 | @cudaq.kernel |
| 187 | def float_vec_capture(i: int) -> np.float32: |
| 188 | return f[i] |
| 189 | |
| 190 | for i in range(len(f)): |
| 191 | assert is_close(f[i], float_vec_capture(i)) |
| 192 | |
| 193 | |
| 194 | def test_float32_definition(): |
nothing calls this directly
no test coverage detected