~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to src/testing/ATL_f77gemv.c

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-04-13 10:07:52 UTC
  • Revision ID: james.westby@ubuntu.com-20020413100752-va9zm0rd4gpurdkq
Tags: upstream-3.2.1ln
ImportĀ upstreamĀ versionĀ 3.2.1ln

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *             Automatically Tuned Linear Algebra Software v3.2
 
3
 *                   (C) Copyright 1999 Antoine P. Petitet                   
 
4
 *
 
5
 * Code contributers : Antoine P. Petitet, R. Clint Whaley
 
6
 *
 
7
 * Redistribution and use in source and binary forms, with or without
 
8
 * modification, are permitted provided that the following conditions
 
9
 * are met:
 
10
 *   1. Redistributions of source code must retain the above copyright
 
11
 *      notice, this list of conditions and the following disclaimer.
 
12
 *   2. Redistributions in binary form must reproduce the above copyright
 
13
 *      notice, this list of conditions, and the following disclaimer in the
 
14
 *      documentation and/or other materials provided with the distribution.
 
15
 *   3. The name of the University of Tennessee, the ATLAS group,
 
16
 *      or the names of its contributers may not be used to endorse
 
17
 *      or promote products derived from this software without specific
 
18
 *      written permission.
 
19
 *
 
20
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
21
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 
22
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
23
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE
 
24
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
25
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
26
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
27
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
28
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
29
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
30
 * POSSIBILITY OF SUCH DAMAGE. 
 
31
 *
 
32
 */
 
33
#include "atlas_misc.h"
 
34
#include "atlas_tst.h"
 
35
#include "atlas_f77blas.h"
 
36
 
 
37
void Mjoin( PATL, f77gemv )
 
38
(
 
39
   const enum ATLAS_TRANS    Trans,
 
40
   const int                 M,
 
41
   const int                 N,
 
42
   const SCALAR              ALPHA,
 
43
   const TYPE                * A,
 
44
   const int                 LDA,
 
45
   const TYPE                * X,
 
46
   const int                 INCX, 
 
47
   const SCALAR              BETA,
 
48
   TYPE                      * Y,
 
49
   const int                 INCY
 
50
)
 
51
{
 
52
#if defined( StringSunStyle )
 
53
   #if defined( ATL_FunkyInts )
 
54
   F77_INTEGER               ONE = 1;
 
55
   #else
 
56
   int                       ONE = 1;
 
57
   #endif
 
58
#elif defined( StringStructVal ) || defined( StringStructPtr )
 
59
   F77_CHAR                  ftran;
 
60
#elif defined( StringCrayStyle )
 
61
   F77_CHAR                  ftran;
 
62
#endif
 
63
 
 
64
   char                      ctran;
 
65
 
 
66
#ifdef ATL_FunkyInts
 
67
   const F77_INTEGER         F77m    = M,   F77n    = N,
 
68
                             F77lda  = LDA, F77incx = INCX, F77incy = INCY;
 
69
   F77_INTEGER               F77M, F77N;
 
70
#else
 
71
   #define F77m              M
 
72
   #define F77n              N
 
73
   #define F77lda            LDA
 
74
   #define F77incx           INCX
 
75
   #define F77incy           INCY
 
76
 
 
77
   int                       F77M, F77N;
 
78
#endif
 
79
 
 
80
#ifdef TCPLX
 
81
   TYPE                      alpha[2], beta[2];
 
82
 
 
83
   *alpha = *ALPHA; alpha[1] = ALPHA[1];
 
84
   *beta  = *BETA;  beta [1] = BETA [1];
 
85
#else
 
86
   TYPE                      alpha = ALPHA, beta = BETA;
 
87
#endif
 
88
 
 
89
   if( Trans == AtlasNoTrans ) { F77M = F77m; F77N = F77n; ctran = 'N'; }
 
90
   else
 
91
   {
 
92
      F77M = F77n; F77N = F77m;
 
93
      if( Trans == AtlasTrans ) ctran = 'T';
 
94
      else                      ctran = 'C';
 
95
   }
 
96
 
 
97
   if( INCX < 0 ) X -= ( ( 1 - N ) * INCX ) SHIFT;
 
98
   if( INCY < 0 ) Y -= ( ( 1 - M ) * INCY ) SHIFT;
 
99
 
 
100
#if   defined( StringSunStyle  )
 
101
   F77gemv( &ctran, &F77M, &F77N,                 SADD alpha, A, &F77lda,
 
102
            X, &F77incx, SADD beta, Y, &F77incy, ONE );
 
103
#elif defined( StringCrayStyle )
 
104
   ftran = ATL_C2F_TransChar( ctran );
 
105
   F77gemv( ftran,  &F77M, &F77N,                 SADD alpha, A, &F77lda,
 
106
            X, &F77incx, SADD beta, Y, &F77incy );
 
107
#elif defined( StringStructVal )
 
108
   ftran.len = 1; ftran.cp = &ctran;
 
109
   F77gemv( ftran,  &F77M, &F77N,                 SADD alpha, A, &F77lda,
 
110
            X, &F77incx, SADD beta, Y, &F77incy );
 
111
#elif defined( StringStructPtr )
 
112
   ftran.len = 1; ftran.cp = &ctran;
 
113
   F77gemv( &ftran, &F77M, &F77N,                 SADD alpha, A, &F77lda,
 
114
            X, &F77incx, SADD beta, Y, &F77incy );
 
115
#else
 
116
   (void) fprintf( stderr, "\n\nF77/C interface not defined!!\n\n" );
 
117
   exit( -1 );
 
118
#endif
 
119
}