[compute] 12/49: Update Boost macros, macros style unification

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Dec 18 17:58:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository compute.

commit 7a8d07892613caa3044e977ac6db044298f18fdd
Author: Jakub Szuppe <j.szuppe at gmail.com>
Date:   Sat Jul 18 14:11:15 2015 +0200

    Update Boost macros, macros style unification
---
 include/boost/compute/async/wait.hpp       |  8 ++++----
 include/boost/compute/config.hpp           | 27 +++++++++++++++++++--------
 include/boost/compute/container/vector.hpp |  8 +++-----
 include/boost/compute/detail/duration.hpp  |  6 +++---
 include/boost/compute/functional/bind.hpp  |  4 ++--
 include/boost/compute/kernel.hpp           |  4 ++--
 include/boost/compute/types/tuple.hpp      | 10 +++++-----
 include/boost/compute/utility/dim.hpp      |  4 ++--
 include/boost/compute/utility/extents.hpp  |  8 +++-----
 test/test_async_wait.cpp                   |  4 ++--
 test/test_kernel.cpp                       |  4 ++--
 test/test_tuple.cpp                        |  8 ++++----
 12 files changed, 51 insertions(+), 44 deletions(-)

diff --git a/include/boost/compute/async/wait.hpp b/include/boost/compute/async/wait.hpp
index 689920d..dacf0fe 100644
--- a/include/boost/compute/async/wait.hpp
+++ b/include/boost/compute/async/wait.hpp
@@ -18,7 +18,7 @@ namespace boost {
 namespace compute {
 namespace detail {
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 template<class Event>
 inline void insert_events_variadic(wait_list &l, Event&& event)
 {
@@ -32,11 +32,11 @@ inline void insert_events_variadic(wait_list &l, Event&& event, Rest&&... rest)
 
     insert_events_variadic(l, std::forward<Rest>(rest)...);
 }
-#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
 } // end detail namespace
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 /// Blocks until all events have completed. Events can either be \ref event
 /// objects or \ref future "future<T>" objects.
 ///
@@ -48,7 +48,7 @@ inline void wait_for_all(Events&&... events)
     detail::insert_events_variadic(l, std::forward<Events>(events)...);
     l.wait();
 }
-#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
 } // end compute namespace
 } // end boost namespace
diff --git a/include/boost/compute/config.hpp b/include/boost/compute/config.hpp
index aff6924..77d0d7b 100644
--- a/include/boost/compute/config.hpp
+++ b/include/boost/compute/config.hpp
@@ -20,21 +20,22 @@
 #error Boost.Compute requires Boost version 1.48 or later
 #endif
 
-// the BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES macro is defined
+// the BOOST_COMPUTE_NO_VARIADIC_TEMPLATES macro is defined
 // if the compiler does not *fully* support variadic templates
-#if defined(BOOST_NO_VARIADIC_TEMPLATES) || \
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
+    defined(BOOST_NO_VARIADIC_TEMPLATES) || \
     (defined(__GNUC__) && !defined(__clang__) && \
      __GNUC__ == 4 && __GNUC_MINOR__ <= 6)
-  #define BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
-#endif
+  #define BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
 
-// the BOOST_COMPUTE_DETAIL_NO_STD_TUPLE macro is defined if the
+// the BOOST_COMPUTE_NO_STD_TUPLE macro is defined if the
 // compiler/stdlib does not support std::tuple
 #if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
     defined(BOOST_NO_0X_HDR_TUPLE) || \
-    defined(BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES)
-  #define BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
-#endif
+    defined(BOOST_COMPUTE_NO_VARIADIC_TEMPLATES)
+  #define BOOST_COMPUTE_NO_STD_TUPLE
+#endif // BOOST_NO_CXX11_HDR_TUPLE
 
 // defines BOOST_COMPUTE_CL_CALLBACK to the value of CL_CALLBACK
 // if it is defined (it was added in OpenCL 1.1). this is used to
@@ -56,4 +57,14 @@
 #  define BOOST_COMPUTE_NO_RVALUE_REFERENCES
 #endif // BOOST_NO_CXX11_RVALUE_REFERENCES
 
+#if defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || \
+    defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#  define BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
+#endif // BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+
+#if defined(BOOST_NO_CXX11_HDR_CHRONO) || \
+    defined(BOOST_NO_0X_HDR_CHRONO)
+#  define BOOST_COMPUTE_NO_HDR_CHRONO
+#endif // BOOST_NO_CXX11_HDR_CHRONO
+
 #endif // BOOST_COMPUTE_CONFIG_HPP
diff --git a/include/boost/compute/container/vector.hpp b/include/boost/compute/container/vector.hpp
index 19aa84a..9110501 100644
--- a/include/boost/compute/container/vector.hpp
+++ b/include/boost/compute/container/vector.hpp
@@ -20,8 +20,7 @@
 
 #include <boost/compute/config.hpp>
 
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
-    !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
 #include <initializer_list>
 #endif
 
@@ -214,8 +213,7 @@ public:
         ::boost::compute::copy(vector.begin(), vector.end(), begin(), queue);
     }
 
-    #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
-        !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+    #ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
     vector(std::initializer_list<T> list,
            command_queue &queue = system::default_queue())
         : m_size(list.size()),
@@ -225,7 +223,7 @@ public:
 
         ::boost::compute::copy(list.begin(), list.end(), begin(), queue);
     }
-    #endif // !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+    #endif // BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
 
     vector<T>& operator=(const vector<T> &other)
     {
diff --git a/include/boost/compute/detail/duration.hpp b/include/boost/compute/detail/duration.hpp
index 95c6dd9..601f12d 100644
--- a/include/boost/compute/detail/duration.hpp
+++ b/include/boost/compute/detail/duration.hpp
@@ -13,7 +13,7 @@
 
 #include <boost/config.hpp>
 
-#if !defined(BOOST_NO_CXX11_HDR_CHRONO) && !defined(BOOST_NO_0X_HDR_CHRONO)
+#ifndef BOOST_COMPUTE_NO_HDR_CHRONO
 #include <chrono>
 #endif
 
@@ -23,7 +23,7 @@ namespace boost {
 namespace compute {
 namespace detail {
 
-#if !defined(BOOST_NO_CXX11_HDR_CHRONO) && !defined(BOOST_NO_0X_HDR_CHRONO)
+#ifndef BOOST_COMPUTE_NO_HDR_CHRONO
 template<class Rep, class Period>
 inline std::chrono::duration<Rep, Period>
 make_duration_from_nanoseconds(std::chrono::duration<Rep, Period>, size_t nanoseconds)
@@ -32,7 +32,7 @@ make_duration_from_nanoseconds(std::chrono::duration<Rep, Period>, size_t nanose
         std::chrono::nanoseconds(nanoseconds)
     );
 }
-#endif // BOOST_NO_CXX11_HDR_CHRONO
+#endif // BOOST_COMPUTE_NO_HDR_CHRONO
 
 template<class Rep, class Period>
 inline boost::chrono::duration<Rep, Period>
diff --git a/include/boost/compute/functional/bind.hpp b/include/boost/compute/functional/bind.hpp
index 059a55b..0c5929f 100644
--- a/include/boost/compute/functional/bind.hpp
+++ b/include/boost/compute/functional/bind.hpp
@@ -207,7 +207,7 @@ struct bound_function
 
 } // end detail namespace
 
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
+#if !defined(BOOST_COMPUTE_NO_VARIADIC_TEMPLATES) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
 /// Returns a function wrapper which invokes \p f with \p args when called.
 ///
 /// For example, to generate a unary function object which returns \c true
@@ -253,7 +253,7 @@ bind(F f, A1 a1, A2 a2, A3 a3)
 
     return detail::bound_function<F, Args>(f, boost::make_tuple(a1, a2, a3));
 }
-#endif // BOOST_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
 } // end compute namespace
 } // end boost namespace
diff --git a/include/boost/compute/kernel.hpp b/include/boost/compute/kernel.hpp
index 8fbf859..9494e46 100644
--- a/include/boost/compute/kernel.hpp
+++ b/include/boost/compute/kernel.hpp
@@ -271,7 +271,7 @@ public:
         #endif
     }
 
-    #ifndef BOOST_NO_VARIADIC_TEMPLATES
+    #ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
     /// Sets the arguments for the kernel to \p args.
     template<class... T>
     void set_args(T&&... args)
@@ -280,7 +280,7 @@ public:
 
         _set_args<0>(args...);
     }
-    #endif // BOOST_NO_VARIADIC_TEMPLATES
+    #endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
     #if defined(CL_VERSION_2_0) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
     /// Sets additional execution information for the kernel.
diff --git a/include/boost/compute/types/tuple.hpp b/include/boost/compute/types/tuple.hpp
index 4354429..095bd95 100644
--- a/include/boost/compute/types/tuple.hpp
+++ b/include/boost/compute/types/tuple.hpp
@@ -24,7 +24,7 @@
 #include <boost/compute/type_traits/type_name.hpp>
 #include <boost/compute/detail/meta_kernel.hpp>
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
+#ifndef BOOST_COMPUTE_NO_STD_TUPLE
 #include <tuple>
 #endif
 
@@ -86,7 +86,7 @@ BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_INJECT_IMPL, ~
 #undef BOOST_COMPUTE_INJECT_DECL
 #undef BOOST_COMPUTE_INJECT_TYPE
 
-#ifdef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#ifdef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 // type_name() specializations for boost::tuple (without variadic templates)
 #define BOOST_COMPUTE_PRINT_TYPE(z, n, unused)                                 \
             + type_name<T ## n>() + "_"
@@ -154,9 +154,9 @@ struct type_name_trait<boost::tuple<T...>>
         return s.str();
     }
 };
-#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
+#ifndef BOOST_COMPUTE_NO_STD_TUPLE
 // type_name<> specialization for std::tuple<T...>
 template<class... T>
 struct type_name_trait<std::tuple<T...>>
@@ -181,7 +181,7 @@ struct type_name_trait<std::tuple<T...>>
         return s.str();
     }
 };
-#endif // BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
+#endif // BOOST_COMPUTE_NO_STD_TUPLE
 
 // get<N>() result type specialization for boost::tuple<>
 #define BOOST_COMPUTE_GET_RESULT_TYPE(z, n, unused)                            \
diff --git a/include/boost/compute/utility/dim.hpp b/include/boost/compute/utility/dim.hpp
index 26979da..210c09c 100644
--- a/include/boost/compute/utility/dim.hpp
+++ b/include/boost/compute/utility/dim.hpp
@@ -17,7 +17,7 @@
 namespace boost {
 namespace compute {
 
-#ifndef BOOST_NO_VARIADIC_TEMPLATES
+#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 /// The variadic \c dim() function provides a concise syntax for creating
 /// \ref extents objects.
 ///
@@ -61,7 +61,7 @@ BOOST_PP_REPEAT(BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_DETAIL_DEFINE_DIM, ~)
 #undef BOOST_COMPUTE_DETAIL_ASSIGN_DIM
 #undef BOOST_COMPUTE_DETAIL_DEFINE_DIM
 
-#endif // BOOST_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
 /// \internal_
 template<size_t N>
diff --git a/include/boost/compute/utility/extents.hpp b/include/boost/compute/utility/extents.hpp
index daf78e6..9666d47 100644
--- a/include/boost/compute/utility/extents.hpp
+++ b/include/boost/compute/utility/extents.hpp
@@ -16,8 +16,7 @@
 
 #include <boost/compute/config.hpp>
 
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
-    !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
 #include <initializer_list>
 #endif
 
@@ -61,8 +60,7 @@ public:
         m_extents.fill(value);
     }
 
-    #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
-        !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+    #ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
     /// Creates an extents object with \p values.
     extents(std::initializer_list<size_t> values)
     {
@@ -70,7 +68,7 @@ public:
 
         std::copy(values.begin(), values.end(), m_extents.begin());
     }
-    #endif
+    #endif // BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
 
     /// Returns the size (i.e. dimensionality) of the extents array.
     size_type size() const
diff --git a/test/test_async_wait.cpp b/test/test_async_wait.cpp
index f89d1e2..0b9eeba 100644
--- a/test/test_async_wait.cpp
+++ b/test/test_async_wait.cpp
@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(empty)
 {
 }
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 BOOST_AUTO_TEST_CASE(wait_for_copy)
 {
     // wait list
@@ -67,6 +67,6 @@ BOOST_AUTO_TEST_CASE(wait_for_copy)
     // check data on the device
     CHECK_RANGE_EQUAL(int, 8, vector, (1, 2, 3, 4, 5, 6, 7, 8));
 }
-#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/test/test_kernel.cpp b/test/test_kernel.cpp
index 0175664..c4f3c68 100644
--- a/test/test_kernel.cpp
+++ b/test/test_kernel.cpp
@@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(get_work_group_info)
     BOOST_CHECK(work_group_size >= 1);
 }
 
-#ifndef BOOST_NO_VARIADIC_TEMPLATES
+#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 BOOST_AUTO_TEST_CASE(kernel_set_args)
 {
     compute::kernel k = compute::kernel::create_with_source(
@@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE(kernel_set_args)
 
     k.set_args(4, 2.4f, 'a');
 }
-#endif
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
 #ifdef CL_VERSION_1_2
 BOOST_AUTO_TEST_CASE(get_arg_info)
diff --git a/test/test_tuple.cpp b/test/test_tuple.cpp
index 89044a7..1a1ff85 100644
--- a/test/test_tuple.cpp
+++ b/test/test_tuple.cpp
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(fill_tuple_vector)
     BOOST_CHECK_EQUAL(host_output[4], boost::make_tuple('z', 4, 3.14f));
 }
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 BOOST_AUTO_TEST_CASE(variadic_tuple)
 {
     BOOST_CHECK_EQUAL(
@@ -124,9 +124,9 @@ BOOST_AUTO_TEST_CASE(variadic_tuple)
         "boost_tuple_char_short_int_float_t"
     );
 }
-#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
+#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
 
-#ifndef BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
+#ifndef BOOST_COMPUTE_NO_STD_TUPLE
 BOOST_AUTO_TEST_CASE(std_tuple)
 {
     BOOST_CHECK_EQUAL(
@@ -134,6 +134,6 @@ BOOST_AUTO_TEST_CASE(std_tuple)
         "std_tuple_char_short_int_float_t"
     );
 }
-#endif // BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
+#endif // BOOST_COMPUTE_NO_STD_TUPLE
 
 BOOST_AUTO_TEST_SUITE_END()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/compute.git



More information about the debian-science-commits mailing list