| 4 | |
| 5 | |
| 6 | class TestCupy(unittest.TestCase): |
| 7 | @gpu_test |
| 8 | def test_kernel(self): |
| 9 | import cupy as cp |
| 10 | x = cp.arange(6, dtype='f').reshape(2, 3) |
| 11 | y = cp.arange(3, dtype='f') |
| 12 | kernel = cp.ElementwiseKernel( |
| 13 | 'float32 x, float32 y', 'float32 z', |
| 14 | '''if (x - 2 > y) { |
| 15 | z = x * y; |
| 16 | } else { |
| 17 | z = x + y; |
| 18 | }''', |
| 19 | 'my_kernel') |
| 20 | r = kernel(x, y) |
| 21 | |
| 22 | self.assertEqual((2, 3), r.shape) |
nothing calls this directly
no outgoing calls
no test coverage detected