File indexing completed on 2025-01-30 09:34:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_COMPUTE_ASYNC_WAIT_HPP
0012 #define BOOST_COMPUTE_ASYNC_WAIT_HPP
0013
0014 #include <boost/compute/config.hpp>
0015 #include <boost/compute/utility/wait_list.hpp>
0016
0017 namespace boost {
0018 namespace compute {
0019 namespace detail {
0020
0021 #ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
0022 template<class Event>
0023 inline void insert_events_variadic(wait_list &l, Event&& event)
0024 {
0025 l.insert(std::forward<Event>(event));
0026 }
0027
0028 template<class Event, class... Rest>
0029 inline void insert_events_variadic(wait_list &l, Event&& event, Rest&&... rest)
0030 {
0031 l.insert(std::forward<Event>(event));
0032
0033 insert_events_variadic(l, std::forward<Rest>(rest)...);
0034 }
0035 #endif
0036
0037 }
0038
0039 #ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
0040
0041
0042
0043
0044 template<class... Events>
0045 inline void wait_for_all(Events&&... events)
0046 {
0047 wait_list l;
0048 detail::insert_events_variadic(l, std::forward<Events>(events)...);
0049 l.wait();
0050 }
0051 #endif
0052
0053 }
0054 }
0055
0056 #endif