summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/correctness/tester.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/test/correctness/tester.cpp b/test/correctness/tester.cpp
index c449b09d..b1ca8122 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);