Implement GPU Hamming distance math function