示例#1
0
std::string getCLErrorString(const cl::Error& err)
{
    std::ostringstream ss;
    ss << "Error:" << err.what() << "(" << err.err() << "), " << errorCodeToString(err.err()) << " " << getCLErrorResolveHint(
           err.err()) << std::endl;
    return ss.str();
}
示例#2
0
void util::logCLError(std::ostream &os, const cl::Error &e, const std::string &msg){
	os << "OpenCL Error! " << msg << " at: " << e.what() 
		<< " error: # " << e.err() << " - " << clErrorString(e.err())
		<< "\n";
	//Could be a really bad error that could crash the driver if we don't abort
	//such as continuing past CL_OUT_OF_RESOURCES, so exit
	exit(e.err());
}
示例#3
0
void print_exception(const string &msg, const cl::Error &e)
{
    print_error_header();
    cout << msg << ": ";
    setColor(BLUE);
    cout << e.what();
    setColor(WHITE);
    cout << " [" << e.err() << "].\n";
}
示例#4
0
文件: util.cpp 项目: nebw/gsoc2012
void handleClError(cl::Error err)
{
    std::cout << "OpenCL Error: " << err.what() << " " << oclErrorString(err.err()) << std::endl;
    throw err;
}