#ifndef BOOST_COMPUTE_ASYNC_WAIT_HPP
#define BOOST_COMPUTE_ASYNC_WAIT_HPP
#include <boost/compute/config.hpp>
#include <boost/compute/utility/wait_list.hpp>
namespace boost {
namespace compute {
namespace detail {
#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
template<class Event>
inline void insert_events_variadic(wait_list &l, Event&& event)
{
l.insert(std::forward<Event>(event));
}
template<class Event, class... Rest>
inline void insert_events_variadic(wait_list &l, Event&& event, Rest&&... rest)
{
l.insert(std::forward<Event>(event));
insert_events_variadic(l, std::forward<Rest>(rest)...);
}
#endif
}
#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
template<class... Events>
inline void wait_for_all(Events&&... events)
{
wait_list l;
detail::insert_events_variadic(l, std::forward<Events>(events)...);
l.wait();
}
#endif
} }
#endif