Computing Néron-Severi groups and cycle class groups