A homogeneous set of a graph G is a set X of vertices such that 2 <= vertical bar X vertical bar < vertical bar V(G)vertical bar and no vertex in V(G) - X has both a neighbor and a non-neighbor in X. A graph is prime if it has no homogeneous set. We present an algorithm to decide whether a class of graphs given by a finite set of forbidden induced subgraphs contains infinitely many non-isomorphic prime graphs. (C) 2018 Elsevier B.V. All rights reserved.