/* cula error status */ void checkStatus(culaStatus status) { char buf[256]; if(!status) return; culaGetErrorInfoString(status, culaGetErrorInfo(), buf, sizeof(buf)); printf("%s\n", buf); culaShutdown(); exit(EXIT_FAILURE); }
// function for cula exception handling - make sure that the char * arguments are not NULL while calling void cula_exception(culaStatus cula_err, char *cula_func, char *term) // error status, cula function that fails, term in the algorithm { int cula_info; // identifier for the cula error char cula_msg[256]; // buffer for storing the cula excepetion message if(cula_err != culaNoError) { cula_info = culaGetErrorInfo(); culaGetErrorInfoString(cula_err, cula_info, cula_msg, sizeof(cula_msg)); printf("(cula error) user message: %s for %s failed; cula message: %s\n", cula_func, term, cula_msg); fflush(stdout); culaShutdown(); exit(2); } }