Assuming the Tate conjecture and the computability of étale cohomology with finite coefficients, we give an algorithm that computes the Néron–Severi group of any smooth projective geometrically integral variety, and also the rank of the group of numerical equivalence classes of codimension $p$ cycles for any $p$.