no_device_found.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013-2015 Kyle Lutz <[email protected]>
  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_EXCEPTION_NO_DEVICE_FOUND_HPP
  11. #define BOOST_COMPUTE_EXCEPTION_NO_DEVICE_FOUND_HPP
  12. #include <exception>
  13. namespace boost {
  14. namespace compute {
  15. /// \class no_device_found
  16. /// \brief Exception thrown when no OpenCL device is found
  17. ///
  18. /// This exception is thrown when no valid OpenCL device can be found.
  19. ///
  20. /// \see opencl_error
  21. class no_device_found : public std::exception
  22. {
  23. public:
  24. /// Creates a new no_device_found exception object.
  25. no_device_found() throw()
  26. {
  27. }
  28. /// Destroys the no_device_found exception object.
  29. ~no_device_found() throw()
  30. {
  31. }
  32. /// Returns a string containing a human-readable error message.
  33. const char* what() const throw()
  34. {
  35. return "No OpenCL device found";
  36. }
  37. };
  38. } // end compute namespace
  39. } // end boost namespace
  40. #endif // BOOST_COMPUTE_EXCEPTION_NO_DEVICE_FOUND_HPP