Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:00

0001 //---------------------------------------------------------------------------//
0002 // Copyright (c) 2017 Kristian Popov <kristian.popov@outlook.com>
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 // See http://boostorg.github.com/compute for more information.
0009 //---------------------------------------------------------------------------//
0010 #ifndef BOOST_COMPUTE_EXCEPTION_PROGRAM_BUILD_FAILURE_HPP
0011 #define BOOST_COMPUTE_EXCEPTION_PROGRAM_BUILD_FAILURE_HPP
0012 
0013 #include <string>
0014 
0015 #include <boost/compute/exception/opencl_error.hpp>
0016 
0017 namespace boost {
0018 namespace compute {
0019 
0020 /// \class program_build_failure
0021 /// \brief A failure when building OpenCL program
0022 ///
0023 /// Instances of this class are thrown when OpenCL program build fails.
0024 /// Extends opencl_error by saving a program build log so it can be used
0025 /// for testing, debugging, or logging purposes.
0026 ///
0027 /// \see opencl_error
0028 class program_build_failure : public opencl_error
0029 {
0030 public:
0031     /// Creates a new program_build_failure exception object for \p error
0032     /// and \p build_log.
0033     explicit program_build_failure(cl_int error, const std::string& build_log)
0034         throw()
0035         : opencl_error(error),
0036           m_build_log(build_log)
0037     {
0038     }
0039 
0040     /// Destroys the program_build_failure object.
0041     ~program_build_failure() throw()
0042     {
0043     }
0044 
0045     /// Retrieve the log of a failed program build.
0046     std::string build_log() const throw()
0047     {
0048         return m_build_log;
0049     }
0050 
0051 private:
0052     std::string m_build_log;
0053 };
0054 
0055 } // end compute namespace
0056 } // end boost namespace
0057 
0058 #endif // BOOST_COMPUTE_EXCEPTION_PROGRAM_BUILD_FAILURE_HPP