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