def test_rw(self, backend, elems, x):
        """Increment each value of a Dat by one with op2.RW."""
        kernel_rw = """void kernel_rw(unsigned int* x) { (*x) = (*x) + 1; }"""
        op2.par_loop(op2.Kernel(kernel_rw, "kernel_rw"),
                     elems, x(op2.RW))
        _nelems = elems.size
        assert sum(x.data_ro) == _nelems * (_nelems + 1) / 2
        if _nelems == nelems:
            assert sum(x.data_ro_with_halos) == nelems * (nelems + 1) / 2
dataset/ETHPy150Open OP2/PyOP2/test/unit/test_direct_loop.py/TestDirectLoop.test_rw/original