N-BVH: Neural ray queries with bounding volume hierarchies