I use Cython (CPU) to brute force 400,000 pHash's of images. It takes somewhere between 100 and 200ms to search.
cdef extern int __builtin_popcountll(unsigned long long) nogil
dist = __builtin_popcountll(key ^ phash)
It would only take a couple of minutes to fill out the rest.