type_definition.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #ifndef BOOST_COMPUTE_TYPE_TRAITS_TYPE_DEFINITION_HPP
  11. #define BOOST_COMPUTE_TYPE_TRAITS_TYPE_DEFINITION_HPP
  12. #include <string>
  13. namespace boost {
  14. namespace compute {
  15. namespace detail {
  16. template<class T>
  17. struct type_definition_trait
  18. {
  19. static std::string value() { return std::string(); }
  20. };
  21. } // end detail namespace
  22. /// Returns the OpenCL type definition for \c T.
  23. ///
  24. /// \return a string containing the type definition for \c T
  25. ///
  26. /// \see type_name<T>()
  27. template<class T>
  28. inline std::string type_definition()
  29. {
  30. return detail::type_definition_trait<T>::value();
  31. }
  32. } // end compute namespace
  33. } // end boost namespace
  34. #endif // BOOST_COMPUTE_TYPE_TRAITS_TYPE_DEFINITION_HPP