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

« back to all changes in this revision

Viewing changes to interfaces/blas/C/src/cblas_zsyrk.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 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 University of Tennessee, the ATLAS group,
 
14
 *      or the names of its contributers may not be used to endorse
 
15
 *      or promote products derived from this software without specific
 
16
 *      written permission.
 
17
 *
 
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
19
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 
20
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
21
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE
 
22
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
23
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
24
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
25
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
26
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
27
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
28
 * POSSIBILITY OF SUCH DAMAGE. 
 
29
 *
 
30
 */
 
31
#include "atlas_misc.h"
 
32
#ifdef ATL_USEPTHREADS
 
33
   #include "atlas_ptalias3.h"
 
34
#endif
 
35
#include "cblas.h"
 
36
 
 
37
void ATL_zsyrk(const enum CBLAS_UPLO Uplo,
 
38
               const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 
 
39
               const double * alpha, const double *A, const int lda,
 
40
               const double * beta, double *C, const int ldc);
 
41
 
 
42
void cblas_zsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
 
43
                 const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 
 
44
                 const void * alpha, const void *A, const int lda,
 
45
                 const void * beta, void *C, const int ldc)
 
46
{
 
47
   enum CBLAS_UPLO uplo;
 
48
   enum CBLAS_TRANSPOSE trans;
 
49
 
 
50
#ifndef NoCblasErrorChecks
 
51
   int info = 2000;
 
52
   if (Uplo != CblasUpper && Uplo != CblasLower)
 
53
      info = cblas_errprn(2, info, "UPLO must be %d or %d, but is set to %d",
 
54
                               CblasUpper, CblasLower, Uplo);
 
55
   if (N < 0) info = cblas_errprn(4, info, 
 
56
                     "N cannot be less than zero; it is set to %d.", N);
 
57
   if (K < 0) info = cblas_errprn(5, info, 
 
58
                     "K cannot be less than zero; it is set to %d.", K);
 
59
 
 
60
   if (Order == CblasColMajor)
 
61
   {
 
62
      if (Trans == AtlasNoTrans)
 
63
      {
 
64
         if ( (lda < N) || (lda < 1) )
 
65
            info = cblas_errprn(8, info, "lda must be >= MAX(N,1): lda=%d N=%d",
 
66
                                lda, N);
 
67
      }
 
68
      else
 
69
      {
 
70
         if (Trans != AtlasTrans)
 
71
            info = cblas_errprn(3, info, 
 
72
                                "Trans must be %d, %d or %d, but is set to %d",
 
73
                                CblasNoTrans, CblasTrans, CblasConjTrans,Trans);
 
74
         if ( (lda < K) || (lda < 1) )
 
75
            info = cblas_errprn(8, info, "lda must be >= MAX(K,1): lda=%d K=%d",
 
76
                                lda, K);
 
77
      }
 
78
   }
 
79
   else if (Order == CblasRowMajor)
 
80
   {
 
81
      if (Trans == AtlasNoTrans)
 
82
      {
 
83
         if ( (lda < K) || (lda < 1) )
 
84
            info = cblas_errprn(8, info, "lda must be >= MAX(K,1): lda=%d K=%d",
 
85
                                lda, K);
 
86
      }
 
87
      else
 
88
      {
 
89
         if (Trans != AtlasTrans)
 
90
            info = cblas_errprn(3, info, 
 
91
                                "Trans must be %d, %d or %d, but is set to %d",
 
92
                                CblasNoTrans, CblasTrans, CblasConjTrans,Trans);
 
93
         if ( (lda < N) || (lda < 1) )
 
94
            info = cblas_errprn(8, info, "lda must be >= MAX(N,1): lda=%d N=%d",
 
95
                                lda, N);
 
96
      }
 
97
   }
 
98
   else info = cblas_errprn(1, info, "Order must be %d or %d, but is set to %d",
 
99
                            CblasRowMajor, CblasColMajor, Order);
 
100
   if ( (ldc < N) || (ldc < 1) )
 
101
      info = cblas_errprn(11, info, "ldc must be >= MAX(N,1): ldc=%d N=%d",
 
102
                          ldc, N);
 
103
   if (info != 2000)
 
104
   {
 
105
      cblas_xerbla(info, "cblas_zsyrk", "");
 
106
      return;
 
107
   }
 
108
#endif
 
109
   if (Order == CblasColMajor)
 
110
      ATL_zsyrk(Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
 
111
   else
 
112
   {
 
113
      if (Uplo == CblasUpper) uplo = CblasLower;
 
114
      else uplo = CblasUpper;
 
115
      if (Trans == CblasNoTrans) trans = CblasTrans;
 
116
      else trans = CblasNoTrans;
 
117
      ATL_zsyrk(uplo, trans, N, K, alpha, A, lda, beta, C, ldc);
 
118
   }
 
119
}