()
| 1872 | |
| 1873 | |
| 1874 | def test_cast_error_1451(): |
| 1875 | |
| 1876 | @cudaq.kernel |
| 1877 | def test_kernel(N: int) -> float: |
| 1878 | return N / 2 |
| 1879 | |
| 1880 | # Test is that this compiles |
| 1881 | out = test_kernel(5) |
| 1882 | assert out == 2.5 |
| 1883 | |
| 1884 | @cudaq.kernel |
| 1885 | def test_kernel(N: int): |
| 1886 | q = cudaq.qvector(N) |
| 1887 | # range fails for non-integer values, |
| 1888 | # matching Python behavior |
| 1889 | for i in range(0, int(N / 2)): |
| 1890 | swap(q[i], q[N - i - 1]) |
| 1891 | |
| 1892 | # Test is that this compiles |
| 1893 | test_kernel.compile() |
| 1894 | |
| 1895 | |
| 1896 | def test_bad_attr_call_error(): |
nothing calls this directly
no test coverage detected