def METHOD_NAME(implementation, dtype, storage=dace.StorageType.Default):
    n = dace.symbol("n")
    suffix = "_device" if storage != dace.StorageType.Default else ""
    transient = storage != dace.StorageType.Default
    sdfg = dace.SDFG("matrix_choleskyfact_potrf_{}_{}".format(implementation, str(dtype)))
    state = sdfg.add_state("dataflow")
    xhost_arr = sdfg.add_array("x", [n, n], dtype, storage=dace.StorageType.Default)
    if transient:
        x_arr = sdfg.add_array("x" + suffix, [n, n], dtype, storage=storage, transient=transient)
        xt_arr = sdfg.add_array('xt' + suffix, [n, n], dtype, storage=storage, transient=transient)
    sdfg.add_array("result" + suffix, [1], dace.dtypes.int32, storage=storage, transient=transient)
    if transient:
        xhi = state.add_read("x")
        xho = state.add_write("x")
        xi = state.add_access("x" + suffix)
        xo = state.add_access("x" + suffix)
        xin = state.add_access("xt" + suffix)
        xout = state.add_access("xt" + suffix)
        transpose_in = std.Transpose("transpose_in", dtype=dtype)
        transpose_in.implementation = "cuBLAS"
        transpose_out = std.Transpose("transpose_out", dtype=dtype)
        transpose_out.implementation = "cuBLAS"
        state.add_nedge(xhi, xi, Memlet.from_array(*xhost_arr))
        state.add_nedge(xo, xho, Memlet.from_array(*xhost_arr))
        state.add_memlet_path(xi, transpose_in, dst_conn='_inp', memlet=Memlet.from_array(*x_arr))
        state.add_memlet_path(transpose_in, xin, src_conn='_out', memlet=Memlet.from_array(*xt_arr))
        state.add_memlet_path(xout, transpose_out, dst_conn='_inp', memlet=Memlet.from_array(*xt_arr))
        state.add_memlet_path(transpose_out, xo, src_conn='_out', memlet=Memlet.from_array(*x_arr))
    else:
        xin = state.add_access("x" + suffix)
        xout = state.add_access("x" + suffix)
    result = state.add_access("result" + suffix)
    potrf_node = lapack.Potrf("potrf")
    potrf_node.implementation = implementation
    state.add_memlet_path(xin, potrf_node, dst_conn="_xin", memlet=Memlet.simple(xin, "0:n, 0:n", num_accesses=n * n))
    state.add_memlet_path(potrf_node, result, src_conn="_res", memlet=Memlet.simple(result, "0", num_accesses=1))
    state.add_memlet_path(potrf_node,
                          xout,
                          src_conn="_xout",
                          memlet=Memlet.simple(xout, "0:n, 0:n", num_accesses=n * n))
    return sdfg