summaryrefslogtreecommitdiff
path: root/test/correctness/tester.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/correctness/tester.cpp')
-rw-r--r--test/correctness/tester.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/test/correctness/tester.cpp b/test/correctness/tester.cpp
index dc0f842e..c0ed5ba4 100644
--- a/test/correctness/tester.cpp
+++ b/test/correctness/tester.cpp
@@ -248,8 +248,29 @@ template <typename T, typename U>
void Tester<T,U>::TestErrorCodes(const StatusCode clblas_status, const StatusCode clblast_status,
const Arguments<U> &args) {
+ // Either an OpenCL or CLBlast internal error occurred, fail the test immediately
+ // NOTE: the OpenCL error codes grow downwards without any declared lower bound, hence the magic
+ // number. The last error code is atm around -70, but -500 is chosen to be on the safe side.
+ if (clblast_status != StatusCode::kSuccess &&
+ (clblast_status > static_cast<StatusCode>(-500) /* matches OpenCL errors (see above) */ ||
+ clblast_status < StatusCode::kNotImplemented) /* matches CLBlast internal errors */) {
+ PrintTestResult(kErrorStatus);
+ ReportError({StatusCode::kSuccess, clblast_status, kStatusError, args});
+ if (verbose_) {
+ fprintf(stdout, "\n");
+ PrintErrorLog({{StatusCode::kSuccess, clblast_status, kStatusError, args}});
+ fprintf(stdout, " ");
+ }
+ }
+
+ // Routine is not implemented
+ else if (clblast_status == StatusCode::kNotImplemented) {
+ PrintTestResult(kSkippedCompilation);
+ ReportSkipped();
+ }
+
// Cannot compare error codes against a library other than clBLAS
- if (compare_cblas_) {
+ else if (compare_cblas_) {
PrintTestResult(kUnsupportedReference);
ReportSkipped();
}
@@ -267,13 +288,6 @@ void Tester<T,U>::TestErrorCodes(const StatusCode clblas_status, const StatusCod
ReportSkipped();
}
- // Could not compile the CLBlast kernel properly
- else if (clblast_status == StatusCode::kOpenCLBuildProgramFailure ||
- clblast_status == StatusCode::kNotImplemented) {
- PrintTestResult(kSkippedCompilation);
- ReportSkipped();
- }
-
// Error occurred
else {
PrintTestResult(kErrorStatus);
@@ -388,7 +402,9 @@ void Tester<T,U>::PrintErrorLog(const std::vector<ErrorLogEntry> &error_log) {
fprintf(stdout, " Error rate %.1lf%%: ", entry.error_percentage);
}
else {
- fprintf(stdout, " Status code %d (expected %d): ", entry.status_found, entry.status_expect);
+ fprintf(stdout, " Status code %d (expected %d): ",
+ static_cast<int>(entry.status_found),
+ static_cast<int>(entry.status_expect));
}
fprintf(stdout, "%s\n", GetOptionsString(entry.args).c_str());
}