Exemple #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();
}
Exemple #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());
}
Exemple #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";
}
Exemple #4
0
void handleClError(cl::Error err)
{
    std::cout << "OpenCL Error: " << err.what() << " " << oclErrorString(err.err()) << std::endl;
    throw err;
}