Honestly, it WAS a surname first, so it can be a first or middle name for a boy or a girl. For years, I've known that whenever I have children, my first son will be named Iain Reilly. Reilly is my mother's maiden name. :)
I think riley is a gender neutral name but i would use it for a girl personally. It would sound more boy-ish if the two names were switched around. Patrick Riley.
It's a boy name to me but I'm hearing it on girls now.