This is a version of test_rv from the RV project, originally written by Simon Moll. It was altered to be used with artic instead.
-- Launching the test suite -- run ./test_rv.py in the test/ folder. test_rv optionally accepts file patterns to c/cpp system tests on the command line.
-- How test_rv works -- libRVs testing infrastructure is based on system test files in suite/. The command line tool to run these is test_rv.py. test_rv.py will take a system test file, vectorize it, and link it against a matching test launcher. The function in the test file is always called "foo". test_rv vectorizes the test using rvTool, the command line vectorizer that is build along with libRV.
-- "wfv" or "loop" mode -- The filename of each system test describes whether it is a Whole-Function Vectorization test or an Outer-Loop Vectorization test. All test files have the structure: -.c/cpp If is "wfv", test_rv will apply Whole-Function Vectorization, if is "loop>, RV test_rv will apply Outer-Loop Vectorization to the first outer most loop.
-- Test file configure line -- test_rv will parse the first line in the system test files. This line encodes how the test shall be vectorized and which test launcher it should be linked against. The line is always structured as a list of key-value pairs. The key refers to a specific option name. The value has to be written without any in-between spaces. // A: value, B: value
- Common options - // LaunchCode: Identifies the launcher module that has to be linked against this test to actually run it. All launchers are in the folder "rv/test/launchers". loopverify_.cpp (verify_.cpp) will be used for in OuterLoop (WFV mode). There are also profiling launchers when running test_rv in profiling mode.
// Width: The vectorization factor used to vectorize this function (outer loop).
- WFV options - // InputShape: The SIMD Shape Signature is a list of vector shapes sepearted by the character "_". Every shape in the list defines the kind of shape the corresponding test function argument (the first, the second, ..) will have once the test function (foo) is vectorized. We explain the syntax of shapes below. It the test function returns a value, its shape can be defined by appending "r" to the signature.
For example, "U_TrU" refers to a test function that receives a uniform input as its first argument, a varying argument as its second argument and returns a uniform value again. rvTool will automatically create a SIMD declaration from the scalar function type of the test function and its SIMD shape signature.
-- Shape syntax -- Shapes consist of a base shape specifier, optionally followed by an alignment specifier.
- base shape specifier - U : uniform C : contiguous T : varying S: the value has an affine stride of (single digit). For example, "S1" is equivalent to "C". "S0" is equivalent to "U".
- alignment specifier - "a4" indicates that the first lane will always have an alignment of "4". If the base shape is varying, the alignment independelty applies to all lanes. For example, "S4a16" encodes a stride-4 affine shape where the first lane is always a multiple of "16".