You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new structure for unit tests was (mostly) implemented for the dot product. The basic structure to allow for maximum maintainability is as follows:
In the unit_test directory contains a number of directories:
openmp
cuda
serial
threads
blas
sparse
graph
Other than that only one file Test_Main.cpp is included. That file will not generally be changed.
Inside of the blast,sparse and graph subdirectories header files with the actual tests will be defined using a naming scheme of:
Test_CATEGORY_FUNCTION.hpp
where CATEGORY is for example: Blas1, Blas2, Sparse, Graph and FUNCTION is for example Dot, AXPBY, Update, GEMV etc.. An example is
Test_Blas1_Dot.hpp
The execution space directories contain one header file Test_EXECSPACE.hpp which generally is not touched, and the actual cpp files to instantiate the tests:
Test_EXECSPACE_CATEGORY_FUNCTION.cpp
for example
Test_OpenMP_Blas1_Dot.cpp
These cpp files will only have to include lines for example:
In the actual Test header file the tests are defined through there internal implementation and the gtest macros. The Test_EXECSPACE.hpp files define two things to be used inside the test file:
Note the explicit scalar type instantiation as well as the inclusion of the scalar type into the test name (dot_int). The ETI guards make sure that the tests are only instantiated if either any instantiation is allowed (KOKKOSKERNELS_ETI_ONLY not defined) or the appropriate type is included in the ETI list.
A systematic new unit test framework shall be defined laying out how to add new unit tests.
The text was updated successfully, but these errors were encountered: