mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
integrated optional (experimentl) CLBlast support
This commit is contained in:
parent
c9f18082fd
commit
23c675b2e6
53 changed files with 22095 additions and 151 deletions
70
CL/Utils/Error.hpp
Normal file
70
CL/Utils/Error.hpp
Normal file
|
@ -0,0 +1,70 @@
|
|||
#pragma once
|
||||
|
||||
// OpenCL Utils includes
|
||||
#include "OpenCLUtilsCpp_Export.h"
|
||||
|
||||
// OpenCL Utils includes
|
||||
#include <CL/Utils/ErrorCodes.h>
|
||||
|
||||
// OpenCL includes
|
||||
#include <CL/opencl.hpp>
|
||||
|
||||
namespace cl {
|
||||
namespace util {
|
||||
#if defined(CL_HPP_ENABLE_EXCEPTIONS)
|
||||
/*! \brief Exception class
|
||||
*
|
||||
* This may be thrown by SDK utility functions when
|
||||
* CL_HPP_ENABLE_EXCEPTIONS is defined.
|
||||
*/
|
||||
class Error : public std::exception {
|
||||
private:
|
||||
int err_;
|
||||
const char* errStr_;
|
||||
|
||||
public:
|
||||
/*! \brief Create a new SDK error exception for a given error code
|
||||
* and corresponding message.
|
||||
*
|
||||
* \param err error code value.
|
||||
*
|
||||
* \param errStr a descriptive string that must remain in scope until
|
||||
* handling of the exception has concluded. If set, it
|
||||
* will be returned by what().
|
||||
*/
|
||||
Error(cl_int err, const char* errStr = NULL): err_(err), errStr_(errStr)
|
||||
{}
|
||||
|
||||
~Error() throw() {}
|
||||
|
||||
/*! \brief Get error string associated with exception
|
||||
*
|
||||
* \return A memory pointer to the error message string.
|
||||
*/
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
if (errStr_ == NULL)
|
||||
{
|
||||
return "empty";
|
||||
}
|
||||
else
|
||||
{
|
||||
return errStr_;
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief Get error code associated with exception
|
||||
*
|
||||
* \return The error code.
|
||||
*/
|
||||
cl_int err(void) const { return err_; }
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace detail {
|
||||
UTILSCPP_EXPORT cl_int errHandler(cl_int err, cl_int* errPtr,
|
||||
const char* errStr = nullptr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue