next up previous contents
Next: Timing a kernel Up: Speeding up the Level Previous: Things you can assume,   Contents

Testing a kernel

Testing is straightforward. If your BLAS routine is <blas>, and your file in the /<blas> subdir is <rout>, then you compile and test it by:
   make <pre><blas>test urout=<rout>

On the makefile line, you can also pass N=<N> to test a particular length vector. Each tester has various flags that can be passed to them, and these can be passed to make via the opt="flags" macro.

To find out what flags a tester takes, compile it, and run the resulting executable with -help (or just look in the source, you slacker).

Alright, here's a specific example. Let's say I have just written a new AXPY implementation and put it in AXPY/myaxpy.c. I can then test it with:

   make daxpytest urout=myaxpy.c

When I fire this off, it does a bunch of compilation, and then spits out something like:

  ITST         N     alpha  incX  incY    TEST
======  ========  ========  ====  ====  ======
     0       777      1.00     1     1  PASSED
     1       777     -1.00     1     1  PASSED
     2       777      0.90     1     1  PASSED
ALL AXPY SANITY TESTS PASSED.

Now, let's say I've written a complex routine (cmyaxpy), that can handle multiple increments. To test various increments, I do:

speedy. make zaxpytest urout=cmyaxpy.c opt="-X 4 -1 1 -2 3 -Y 4 1 -1 2 -3"
  ITST         N    ralpha   ialpha  incX  incY    TEST
======  ========  ======== ========  ====  ====  ======
     0       777      1.00     0.00    -1     1  PASSED
     1       777     -1.00     0.00    -1     1  PASSED
     2       777      1.30     0.00    -1     1  PASSED
     3       777      0.90     1.10    -1     1  PASSED
     .....
     .....
    61       777     -1.00     0.00     3    -3  PASSED
    62       777      1.30     0.00     3    -3  PASSED
    63       777      0.90     1.10     3    -3  PASSED
ALL AXPY SANITY TESTS PASSED.



R. Clint Whaley 2001-08-04