1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #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
|