icl-utk-edu / lapackpp

LAPACK++ is a C++ wrapper around CPU and GPU LAPACK and LAPACK-like linear algebra libraries, developed as part of the SLATE project.
https://icl.utk.edu/slate/
BSD 3-Clause "New" or "Revised" License
51 stars 14 forks source link

Fix compilation issue since testsweeper now has half-precision datatype #52

Closed cayrols closed 1 year ago

cayrols commented 1 year ago

Problem

The introduction of the Half datatype in Testsweeper causes warnings when compiling a lot of the test files.

Solution

In this PR, we update the test files where one of the switch cases is on Integer, by removing it, and adding a default case that throw a runtime exception on the datatype.

     switch (params.datatype()) {
-        case testsweeper::DataType::Integer:
-            throw std::exception();
-            break;
-

+
+        default:
+            throw std::runtime_error( "unknown datatype" );
+            break;

Moreover, we fix a few test files that were throwing an std::exception() in the default case, by replacing it with the same runtime error, to be consistent.

         default:                                                                                                                                                                                                                                                               
-            throw std::exception();                                                                                                                                                                                                                                            
+            throw std::runtime_error( "unknown datatype" );                                                                                                                                                                                                                    
             break;