Next: Forcing ATLAS to use Up: Contributing a complete GEMM Previous: Supplying ATLAS with what   Contents

### What to do if you don't supply all precisions

Remember that what ATLAS is doing is substituting your GEMM for its own large-case GEMM. However, ATLAS's large-case GEMM is still compiled in the library, it is just not being used. The following code will call ATLAS's large case code for all precisions:

```#include "atlas_misc.h"
#include "atlas_lvl3.h"

int Mjoin(Mjoin(ATL_U,PRE),usergemm)
(const enum ATLAS_TRANS TA, const enum ATLAS_TRANS TB,
const int M, const int N, const int K, const SCALAR alpha,
const TYPE *A, const int lda, const TYPE *B, const int ldb,
const SCALAR beta, TYPE *C, const int ldc)
{
int ierr;

if (N >= M)
{
if ( ierr = Mjoin(PATL,mmJIK)(TA, TB, M, N, K, alpha, A, lda, B, ldb,
beta, C, ldc) )
ierr = Mjoin(PATL,mmIJK)(TA, TB, M, N, K, alpha, A, lda, B, ldb,
beta, C, ldc);
}
else
{
if ( ierr = Mjoin(PATL,mmIJK)(TA, TB, M, N, K, alpha, A, lda, B, ldb,
beta, C, ldc) )
ierr = Mjoin(PATL,mmJIK)(TA, TB, M, N, K, alpha, A, lda, B, ldb,
beta, C, ldc);
}
return (ierr);
}
```

So, you can use the above code to have ATLAS call it's normal routines for those precisions you do not supply, and call your own otherwise. In order to help understand this process, ATLAS includes a ``user-supplied'' GEMM that simply calls ATLAS's own GEMM for all precisions, in ATLAS/src/blas/gemm/UMMEXAMPLE. If, for instance, you have a single precision real GEMM but nothing else, you can take this directory as a starting point, adding your own commands for single precision real in the Makefile, etc, and leaving everything else alone.

In order to do this, you should do the following (where <arch> is replaced by the ARCH string of your Make.<arch>; eg, Linux_PII, AIX_POWER3, OSF_21264, etc.):

1. In ATLAS/src/blas/gemm/UMMEXAMPLE:
• mkdir <arch>
• cp Makefile <arch>/.
• ln -s ../../../../../Make.<arch> Make.inc
• Modify <arch>/Makefile to compile your single precision routine
• Follow the instructions given in Section 5.9.3, which discusses how to make ATLAS use a contributed GEMM that config has not setup for you

Next: Forcing ATLAS to use Up: Contributing a complete GEMM Previous: Supplying ATLAS with what   Contents
R. Clint Whaley 2001-08-04