def METHOD_NAME(ctx_factory, spec):
    ctx = ctx_factory()
    queue = cl.CommandQueue(ctx)
    n = 4
    a = np.random.rand(n, n)
    arg_names = ("a",)
    knl = lp.make_einsum(spec, arg_names)
    evt, (out,) = knl(queue, a=a)
    ans = np.einsum(spec, a)
    assert np.linalg.norm(out - ans) <= 1e-15