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

« back to all changes in this revision

Viewing changes to src/blas/level2/kernel/ATL_trmvUN.c

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.3 upstream)
  • mto: (2.2.21 experimental)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-b72z8f621tuhbzn0
Tags: upstream-3.10.1
Import upstream version 3.10.1

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.2 -- December 25, 2000
7
 
 *
8
 
 * Author         : Antoine P. Petitet
9
 
 * Contributor(s) : R. Clint Whaley
10
 
 * Originally developed at the University of Tennessee,
11
 
 * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
12
 
 *
13
 
 * ---------------------------------------------------------------------
14
 
 *
15
 
 * -- Copyright notice and Licensing terms:
16
 
 *
17
 
 *  Redistribution  and  use in  source and binary forms, with or without
18
 
 *  modification, are  permitted provided  that the following  conditions
19
 
 *  are met:
20
 
 *
21
 
 * 1. Redistributions  of  source  code  must retain the above copyright
22
 
 *    notice, this list of conditions and the following disclaimer.
23
 
 * 2. Redistributions in binary form must reproduce  the above copyright
24
 
 *    notice,  this list of conditions, and the  following disclaimer in
25
 
 *    the documentation and/or other materials provided with the distri-
26
 
 *    bution.
27
 
 * 3. The name of the University,  the ATLAS group,  or the names of its
28
 
 *    contributors  may not be used to endorse or promote products deri-
29
 
 *    ved from this software without specific written permission.
30
 
 *
31
 
 * -- Disclaimer:
32
 
 *
33
 
 * THIS  SOFTWARE  IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34
 
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING,  BUT NOT
35
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36
 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
37
 
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,  INDIRECT, INCIDENTAL, SPE-
38
 
 * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39
 
 * TO,  PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
40
 
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
41
 
 * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (IN-
42
 
 * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43
 
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
 
 *
45
 
 * ---------------------------------------------------------------------
46
 
 */
47
 
/*
48
 
 * Include files
49
 
 */
50
 
#include "atlas_misc.h"
51
 
#include "atlas_mv.h"
52
 
#include "atlas_r1.h"
53
 
#include "atlas_level1.h"
54
 
#include "atlas_kernel2.h"
55
 
#include "atlas_reflvl2.h"
56
 
#include "atlas_lvl2.h"
57
 
 
58
 
void Mjoin( PATL, trmvUN )
59
 
(
60
 
   const enum ATLAS_DIAG      DIAG,
61
 
   const int                  N,         /* N > 0 assumed */
62
 
   const TYPE                 * A,
63
 
   const int                  LDA,
64
 
   TYPE                       * X
65
 
)
66
 
{
67
 
/*
68
 
 * Purpose
69
 
 * =======
70
 
 *
71
 
 * Mjoin( PATL, trmvUN ) performs the following matrix-vector operation
72
 
 *
73
 
 *    x := A * x,
74
 
 *
75
 
 * where x is an n-element vector and  A is an n by n unit or  non-unit,
76
 
 * upper triangular matrix.
77
 
 *
78
 
 * This is a blocked version of the algorithm.  For a more detailed des-
79
 
 * cription of  the arguments of this function, see the reference imple-
80
 
 * mentation in the  ATLAS/src/blas/reference directory.
81
 
 *
82
 
 * ---------------------------------------------------------------------
83
 
 */
84
 
/*
85
 
 * .. Local Variables ..
86
 
 */
87
 
#ifdef TREAL
88
 
#define    one                ATL_rone
89
 
#define    lda2               LDA
90
 
#else
91
 
   TYPE                       one[2] = { ATL_rone, ATL_rzero };
92
 
   const int                  lda2   = ( LDA SHIFT );
93
 
#endif
94
 
   TYPE                       * A0, * x0;
95
 
#ifdef ATL_AXPYMV
96
 
   int                        incA,        incX, mb, mb1, n, nb;
97
 
#else
98
 
   int                        incA0, incA, incX, m, mb, nb, nb1;
99
 
#endif
100
 
   void                       (*trmv0)( const int, const TYPE *, const int,
101
 
                              TYPE * );
102
 
#define    gemv0              Mjoin( PATL, gemvN_a1_x1_b1_y1  )
103
 
/* ..
104
 
 * .. Executable Statements ..
105
 
 *
106
 
 */
107
 
   ATL_GetPartMVN( A, LDA, &mb, &nb );
108
 
 
109
 
   if( DIAG == AtlasNonUnit ) trmv0 = Mjoin( PATL, trmvUNN );
110
 
   else                       trmv0 = Mjoin( PATL, trmvUNU );
111
 
 
112
 
#ifdef ATL_AXPYMV
113
 
   mb1  = N - ( ( N - 1 ) / mb ) * mb;
114
 
   incA = mb * lda2 + ( incX = (mb SHIFT) );
115
 
 
116
 
   for( n  = N - mb, A0 = (TYPE *)(A) + mb * lda2, x0 = X + incX; n > 0;
117
 
        n -= mb, A0 += incA, A += incA, X += incX, x0 += incX )
118
 
   {
119
 
      trmv0( mb, A, LDA, X );
120
 
      gemv0( mb, n, one, A0, LDA, x0, 1, one, X, 1 );
121
 
   }
122
 
   trmv0( mb1, A, LDA, X );
123
 
#else
124
 
   nb1  = N - ( ( N - 1 ) / nb ) * nb;
125
 
   incA = ( incA0 = nb * lda2 ) + ( incX = (nb SHIFT) );  x0 = X;
126
 
 
127
 
   trmv0( nb1, A, LDA, X );
128
 
   X += (nb1 SHIFT); A0 = (TYPE *)(A += nb1 * lda2); A += (nb1 SHIFT);
129
 
   for( m = nb1; m < N; m += nb, A0 += incA0, A += incA, X += incX )
130
 
   {
131
 
      gemv0( m, nb, one, A0, LDA, X, 1, one, x0, 1 );
132
 
      trmv0( nb, A, LDA, X );
133
 
   }
134
 
#endif
135
 
/*
136
 
 * End of Mjoin( PATL, trmvUN )
137
 
 */
138
 
}
 
1
/*
 
2
 *             Automatically Tuned Linear Algebra Software v3.10.1
 
3
 *                    (C) Copyright 1999 R. Clint Whaley
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 *   1. Redistributions of source code must retain the above copyright
 
9
 *      notice, this list of conditions and the following disclaimer.
 
10
 *   2. Redistributions in binary form must reproduce the above copyright
 
11
 *      notice, this list of conditions, and the following disclaimer in the
 
12
 *      documentation and/or other materials provided with the distribution.
 
13
 *   3. The name of the ATLAS group or the names of its contributers may
 
14
 *      not be used to endorse or promote products derived from this
 
15
 *      software without specific written permission.
 
16
 *
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
18
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 
19
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
20
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ATLAS GROUP OR ITS CONTRIBUTORS
 
21
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
22
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
23
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
24
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
25
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
26
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
27
 * POSSIBILITY OF SUCH DAMAGE.
 
28
 *
 
29
 */
 
30