Heat Rock only works with the pokemon that is holding it. If you switch out and that pokemon has the Heat Rock as well, if Sunny Day is still going it will still activate. I hope this helped.
Just to clarify...so, say I use Sunny Day and switch pokemon on turn 4. The new one is holding a Heat Rock. Then and only then it gets the turn boost?