optimizing matching on gpu