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

« back to all changes in this revision

Viewing changes to src/blas/level2/kernel/ATL_symvU.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
 *
 
3
 * -- Automatically Tuned Linear Algebra Software (ATLAS)
 
4
 *    (C) Copyright 2000 All Rights Reserved
 
5
 *
 
6
 * -- ATLAS routine -- Version 3.0 -- April 1, 2000
 
7
 *
 
8
 * -- Suggestions,  comments,  bugs reports should be sent to the follo-
 
9
 *    wing e-mail address: atlas@cs.utk.edu
 
10
 *
 
11
 * Author         : Antoine P. Petitet
 
12
 * Contributor(s) : R. Clint Whaley
 
13
 * University of Tennessee - Innovative Computing Laboratory
 
14
 * Knoxville TN, 37996-1301, USA.
 
15
 *
 
16
 * ---------------------------------------------------------------------
 
17
 *
 
18
 * -- Copyright notice and Licensing terms:
 
19
 *
 
20
 *  Redistribution  and  use in  source and binary forms, with or without
 
21
 *  modification, are  permitted provided  that the following  conditions
 
22
 *  are met:
 
23
 *
 
24
 * 1. Redistributions  of  source  code  must retain the above copyright
 
25
 *    notice, this list of conditions and the following disclaimer.
 
26
 * 2. Redistributions in binary form must reproduce  the above copyright
 
27
 *    notice,  this list of conditions, and the  following disclaimer in
 
28
 *    the documentation and/or other materials provided with the distri-
 
29
 *    bution.
 
30
 * 3. The name of the University,  the ATLAS group,  or the names of its
 
31
 *    contributors  may not be used to endorse or promote products deri-
 
32
 *    ved from this software without specific written permission.
 
33
 *
 
34
 * -- Disclaimer:
 
35
 *
 
36
 * THIS  SOFTWARE  IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
37
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING,  BUT NOT
 
38
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
39
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
 
40
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,  INDIRECT, INCIDENTAL, SPE-
 
41
 * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 
42
 * TO,  PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 
43
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
 
44
 * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (IN-
 
45
 * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
46
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
47
 *
 
48
 * ---------------------------------------------------------------------
 
49
 */
 
50
/*
 
51
 * Include files
 
52
 */
 
53
#include "atlas_misc.h"
 
54
#include "atlas_mv.h"
 
55
#include "atlas_r1.h"
 
56
#include "atlas_level1.h"
 
57
#include "atlas_kernel2.h"
 
58
#include "atlas_reflvl2.h"
 
59
#include "atlas_lvl2.h"
 
60
 
 
61
void Mjoin( PATL, symvU )
 
62
(
 
63
   const int                  N,
 
64
   const TYPE                 * A,
 
65
   const int                  LDA,
 
66
   const TYPE                 * X,
 
67
   const SCALAR               BETA,
 
68
   TYPE                       * Y
 
69
)
 
70
{
 
71
/*
 
72
 * Purpose
 
73
 * =======
 
74
 *
 
75
 * Mjoin( PATL, symvU ) performs the matrix-vector operation
 
76
 *
 
77
 *    y := alpha * A * x + beta * y,
 
78
 *
 
79
 * where alpha and beta are scalars, x and y are n-element vectors and A
 
80
 * is an n by n symmetric matrix.
 
81
 *
 
82
 * This is a  recursive  version of the  algorithm.  For a more detailed
 
83
 * description of  the arguments of this function, see the reference im-
 
84
 * plementation in the  ATLAS/src/blas/reference directory.
 
85
 *
 
86
 * ---------------------------------------------------------------------
 
87
 */
 
88
/*
 
89
 * .. Local Variables ..
 
90
 */
 
91
#ifdef TREAL
 
92
#define    one                ATL_rone
 
93
   TYPE                       beta0;
 
94
#else
 
95
   const TYPE                 * beta0, one[2] = { ATL_rone, ATL_rzero };
 
96
#endif
 
97
   TYPE                       * A0, * x0, * y0;
 
98
   int                        j, jb, jbs, m, mb, nb;
 
99
   void                       (*gemvT)( const int, const int, const SCALAR,
 
100
                              const TYPE *, const int, const TYPE *, const int,
 
101
                              const SCALAR, TYPE *, const int );
 
102
   void                       (*gemvN)( const int, const int, const SCALAR,
 
103
                              const TYPE *, const int, const TYPE *, const int,
 
104
                              const SCALAR, TYPE *, const int );
 
105
/* ..
 
106
 * .. Executable Statements ..
 
107
 *
 
108
 */
 
109
   ATL_GetPartSYMV( A, LDA, &mb, &nb );
 
110
 
 
111
   beta0 = BETA;
 
112
   if(      SCALAR_IS_ZERO( beta0 ) )
 
113
   {
 
114
      gemvN = Mjoin( PATL, gemvN_a1_x1_b0_y1 );
 
115
      gemvT = Mjoin( PATL, gemvT_a1_x1_b0_y1 );
 
116
   }
 
117
   else if( SCALAR_IS_ONE ( beta0 ) )
 
118
   {
 
119
      gemvN = Mjoin( PATL, gemvN_a1_x1_b1_y1 );
 
120
      gemvT = Mjoin( PATL, gemvT_a1_x1_b1_y1 );
 
121
   }
 
122
   else
 
123
   {
 
124
      gemvN = Mjoin( PATL, gemvN_a1_x1_bX_y1 );
 
125
      gemvT = Mjoin( PATL, gemvT_a1_x1_bX_y1 );
 
126
   }
 
127
 
 
128
   MUrnext( N, A, LDA );
 
129
   x0 = (TYPE *)(X); X += (N SHIFT); y0 = (TYPE *)(Y); Y += (N SHIFT);
 
130
 
 
131
   for( j = 0; j < N; j += nb )
 
132
   {
 
133
      jb = N - j; jb = Mmin( jb, nb ); jbs = (jb SHIFT);
 
134
      MUrprev( jb, A, LDA ); X -= jbs; Y -= jbs;
 
135
      if( ( m = N-j-jb ) != 0 )
 
136
      {
 
137
         A0 = (TYPE *)(A) - (m SHIFT);
 
138
         gemvT( jb, m, one, A0, LDA, x0, 1, beta0, Y,  1 );
 
139
         gemvN( m, jb, one, A0, LDA, X,  1, beta0, y0, 1 ); beta0 = one;
 
140
      }
 
141
      Mjoin( PATL, refsymvU )( jb, one, A, LDA, X, 1, beta0, Y, 1 );
 
142
      gemvN = Mjoin( PATL, gemvN_a1_x1_b1_y1 );
 
143
      gemvT = Mjoin( PATL, gemvT_a1_x1_b1_y1 );
 
144
   }
 
145
/*
 
146
 * End of Mjoin( PATL, symvU )
 
147
 */
 
148
}