def test_global_inc(self, backend, elems, x, g):
        """Increment each value of a Dat by one and a Global at the same time."""
        kernel_global_inc = """void kernel_global_inc(unsigned int* x, unsigned int* inc) {
          (*x) = (*x) + 1; (*inc) += (*x);
        }"""
        op2.par_loop(op2.Kernel(kernel_global_inc, "kernel_global_inc"),
                     elems, x(op2.RW), g(op2.INC))
        _nelems = elems.size
        assert g.data[0] == _nelems * (_nelems + 1) / 2
dataset/ETHPy150Open OP2/PyOP2/test/unit/test_direct_loop.py/TestDirectLoop.test_global_inc/original