Hadronic vacuum polarization using gradient flow