def METHOD_NAME(self, graph, expr_index, sdfg, permissive=False):
    if expr_index == 0:
        map_entry = self.map_entry
        candidate_map = map_entry.map
        # Map schedules that are disallowed to transform to GPUs
        if (candidate_map.schedule in [dtypes.ScheduleType.MPI] + dtypes.GPU_SCHEDULES):
            return False
        if sd.is_devicelevel_gpu(sdfg, graph, map_entry):
            return False
        # Dynamic map ranges cannot become kernels
        if sd.has_dynamic_map_inputs(graph, map_entry):
            return False
        # Ensure that map does not include internal arrays that are
        # allocated on non-default space
        subgraph = graph.scope_subgraph(map_entry)
        for node in subgraph.nodes():
            if (isinstance(node, nodes.AccessNode) and node.desc(sdfg).storage != dtypes.StorageType.Default
                    and node.desc(sdfg).storage != dtypes.StorageType.Register):
                return False
        # If one of the outputs is a stream, do not match
        map_exit = graph.exit_node(map_entry)
        for edge in graph.out_edges(map_exit):
            dst = graph.memlet_path(edge)[-1].dst
            if (isinstance(dst, nodes.AccessNode) and isinstance(sdfg.arrays[dst.data], data.Stream)):
                return False
        return True
    elif expr_index == 1:
        reduce = self.reduce
        # Disallow GPU transformation if already in device-level code
        if sd.is_devicelevel_gpu(sdfg, graph, reduce):
            return False
        return True