Personification is a figure of speech in which you attribute human characteristics, actions, or behaviors to something that is not able to act in such a way for not being human. In this case, the heart is thinking ("The heart can think of no devotion") but hearts are not able to think.