Use thrust::detail::wrapped_function in locate_merge_path.