Hardware acceleration method, compiler, and device