(self)
| 20 | |
| 21 | @gpu_test |
| 22 | def test_cuda_jit(self): |
| 23 | from numba import cuda |
| 24 | |
| 25 | x = np.arange(10) |
| 26 | |
| 27 | @cuda.jit |
| 28 | def increment_by_one(an_array): |
| 29 | pos = cuda.grid(1) |
| 30 | if pos < an_array.size: |
| 31 | an_array[pos] += 1 |
| 32 | |
| 33 | threadsperblock = 32 |
| 34 | blockspergrid = (x.size + (threadsperblock - 1)) |
| 35 | self.assertEqual(0, x[0]) |
| 36 | increment_by_one[blockspergrid, threadsperblock](x) |
| 37 | self.assertEqual(1, x[0]) |
nothing calls this directly
no outgoing calls
no test coverage detected