def METHOD_NAME(sdfg, impl):
    implementation_to_env = {
        "MKL": blas.environments.IntelMKL.full_class_path(),
        "cuBLAS": blas.environments.cuBLAS.full_class_path()
    }
    all_tasklets = (n for n, _ in sdfg.all_nodes_recursive() if isinstance(n, dace.nodes.Tasklet))
    environments = {env for n in all_tasklets for env in n.environments}
    assert implementation_to_env[impl] in environments