

def test_change_constant_doesnt_require_parloop_regen(self, backend, set, dat):
    k = '\n        void k(int *x) { *x = myconstant; }\n        '
    cache = op2.base.JITModule._cache
    cache.clear()
    constant = op2.Const(1, 10, dtype=numpy.int32, name='myconstant')
    op2.par_loop(op2.Kernel(backend, 'k'), set, dat(op2.WRITE))
    assert all((dat.data == constant.data))
    assert (len(cache) == 1)
    (constant.data == 11)
    op2.par_loop(op2.Kernel(k, 'k'), set, dat(op2.WRITE))
    constant.remove_from_namespace()
    assert all((dat.data == constant.data))
    assert (len(cache) == 1)

dataset/ETHPy150Open OP2/PyOP2/test/unit/test_constants.py TestConstant.test_change_constant_doesnt_require_parloop_regen/VarMisuse@65/116 `k`->`backend`