The stylistic device used in the sentence "he sang a solitary song that whistled in the wind" is personification. Personification is a figure of speech that attributes human qualities or actions to non-human things. In this case, the non-human element, the song, is described as "whistling in the wind," which is a human action. This personification adds a vivid and descriptive element to the sentence.