Mac OS 9
vBLAS.h
Go to the documentation of this file.
1 
88 #ifndef __VBLAS__
89 #define __VBLAS__
90 
91 #ifndef __CONDITIONALMACROS__
92 #include <ConditionalMacros.h>
93 #endif
94 
95 #if PRAGMA_ONCE
96 #pragma once
97 #endif
98 
99 #ifdef __cplusplus
100 extern "C"
101 {
102 #endif
103 
104 #if PRAGMA_IMPORT
105 #pragma import on
106 #endif
107 
108 #if PRAGMA_STRUCT_ALIGN
109 #pragma options align = power
110 #elif PRAGMA_STRUCT_PACKPUSH
111 #pragma pack(push, 2)
112 #elif PRAGMA_STRUCT_PACK
113 #pragma pack(2)
114 #endif
115 
116 #if PRAGMA_ENUM_ALWAYSINT
117 #if defined(__fourbyteints__) && !__fourbyteints__
118 #define __VBLAS__RESTORE_TWOBYTEINTS
119 #pragma fourbyteints on
120 #endif
121 #pragma enumsalwaysint on
122 #elif PRAGMA_ENUM_OPTIONS
123 #pragma option enum =int
124 #elif PRAGMA_ENUM_PACK
125 #if __option(pack_enums)
126 #define __VBLAS__RESTORE_PACKED_ENUMS
127 #pragma options(!pack_enums)
128 #endif
129 #endif
130 
138  {
139  CblasRowMajor = 101,
140  CblasColMajor = 102
141  };
142  typedef enum CBLAS_ORDER CBLAS_ORDER;
143 
144  enum CBLAS_TRANSPOSE
145  {
146  CblasNoTrans = 111,
147  CblasTrans = 112,
148  CblasConjTrans = 113
149  };
150  typedef enum CBLAS_TRANSPOSE CBLAS_TRANSPOSE;
151 
152  enum CBLAS_UPLO
153  {
154  CblasUpper = 121,
155  CblasLower = 122
156  };
157  typedef enum CBLAS_UPLO CBLAS_UPLO;
158 
159  enum CBLAS_DIAG
160  {
161  CblasNonUnit = 131,
162  CblasUnit = 132
163  };
164  typedef enum CBLAS_DIAG CBLAS_DIAG;
165 
166  enum CBLAS_SIDE
167  {
168  CblasLeft = 141,
169  CblasRight = 142
170  };
171  typedef enum CBLAS_SIDE CBLAS_SIDE;
172 
180 #define IsAlignedCount(n) ((n > 0) && ((n & 3L) == 0))
181 #define IsAlignedAddr(a) (((long)a & 15L) == 0)
182 
205  float
206  cblas_sdot(int N, const float *X, int incX, const float *Y, int incY);
207 
216  float
217  cblas_snrm2(int N, const float *X, int incX);
218 
227  float
228  cblas_sasum(int N, const float *X, int incX);
229 
238  int
239  cblas_isamax(int N, const float *X, int incX);
240 
249  void
250  cblas_sswap(int N, float *X, int incX, float *Y, int incY);
251 
260  void
261  cblas_scopy(int N, const float *X, int incX, float *Y, int incY);
262 
271  void
272  cblas_saxpy(int N, float alpha, const float *X, int incX, float *Y, int incY);
273 
282  void
283  cblas_srot(int N, float *X, int incX, float *Y, int incY, float c, float s);
284 
293  void
294  cblas_sscal(int N, float alpha, float *X, int incX);
295 
326  void
327  cblas_sgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE transA, int M, int N,
328  float alpha, const float *A, int lda, const float *X, int incX,
329  float beta, float *Y, int incY);
330 
361  void
362  cblas_sgemm(CBLAS_ORDER order, CBLAS_TRANSPOSE transA, CBLAS_TRANSPOSE transB,
363  int M, int N, int K, float alpha, const float *A, int lda,
364  const float *B, int ldb, float beta, float *C, int ldc);
365 
410 #ifdef __VEC__
411  typedef vector float ConstVectorFloat;
420  void
421  vMultVecMat_4x4(ConstVectorFloat X[1], ConstVectorFloat A[4][1],
422  vector float Y[1]);
423 
432  void
433  vMultMatVec_4x4(ConstVectorFloat A[4][1], ConstVectorFloat X[1],
434  vector float Y[1]);
435 
444  void
445  vMultMatMat_4x4(ConstVectorFloat A[4][1], ConstVectorFloat B[4][1],
446  vector float C[4][1]);
447 
456  void
457  vMultVecMat_8x8(ConstVectorFloat X[2], ConstVectorFloat A[8][2],
458  vector float Y[2]);
459 
468  void
469  vMultMatVec_8x8(ConstVectorFloat A[8][2], ConstVectorFloat X[2],
470  vector float Y[2]);
471 
480  void
481  vMultMatMat_8x8(ConstVectorFloat A[8][2], ConstVectorFloat B[8][2],
482  vector float C[8][2]);
483 
492  void
493  vMultVecMat_16x16(ConstVectorFloat X[4], ConstVectorFloat A[16][4],
494  vector float Y[4]);
495 
504  void
505  vMultMatVec_16x16(ConstVectorFloat A[16][4], ConstVectorFloat X[4],
506  vector float Y[4]);
507 
516  void
517  vMultMatMat_16x16(ConstVectorFloat A[16][4], ConstVectorFloat B[16][4],
518  vector float C[16][4]);
519 
528  void
529  vMultVecMat_32x32(ConstVectorFloat X[8], ConstVectorFloat A[32][8],
530  vector float Y[8]);
531 
540  void
541  vMultMatVec_32x32(ConstVectorFloat A[32][8], ConstVectorFloat X[8],
542  vector float Y[8]);
543 
552  void
553  vMultMatMat_32x32(ConstVectorFloat A[32][8], ConstVectorFloat B[32][8],
554  vector float C[32][8]);
555 
556 #endif /* defined(__VEC__) */
557 
585  typedef CALLBACK_API_C(void, BLASParamErrorProc)(const char *funcName,
586  const char *paramName,
587  const int *paramPos,
588  const int *paramValue);
597  void
598  SetBLASParamErrorProc(BLASParamErrorProc ErrorProc);
599 
600  /* ==========================================================================================================================*/
601 
602 #if PRAGMA_ENUM_ALWAYSINT
603 #pragma enumsalwaysint reset
604 #ifdef __VBLAS__RESTORE_TWOBYTEINTS
605 #pragma fourbyteints off
606 #endif
607 #elif PRAGMA_ENUM_OPTIONS
608 #pragma option enum =reset
609 #elif defined(__VBLAS__RESTORE_PACKED_ENUMS)
610 #pragma options(pack_enums)
611 #endif
612 
613 #if PRAGMA_STRUCT_ALIGN
614 #pragma options align = reset
615 #elif PRAGMA_STRUCT_PACKPUSH
616 #pragma pack(pop)
617 #elif PRAGMA_STRUCT_PACK
618 #pragma pack()
619 #endif
620 
621 #ifdef PRAGMA_IMPORT_OFF
622 #pragma import off
623 #elif PRAGMA_IMPORT
624 #pragma import reset
625 #endif
626 
627 #ifdef __cplusplus
628 }
629 #endif
630 
631 #endif /* __VBLAS__ */
Set up for compiler independent conditionals.
void cblas_srot(int N, float *X, int incX, float *Y, int incY, float c, float s)
float cblas_snrm2(int N, const float *X, int incX)
void cblas_sscal(int N, float alpha, float *X, int incX)
float cblas_sasum(int N, const float *X, int incX)
CBLAS_ORDER
Definition: vBLAS.h:138
void cblas_sgemm(CBLAS_ORDER order, CBLAS_TRANSPOSE transA, CBLAS_TRANSPOSE transB, int M, int N, int K, float alpha, const float *A, int lda, const float *B, int ldb, float beta, float *C, int ldc)
float cblas_sdot(int N, const float *X, int incX, const float *Y, int incY)
typedef CALLBACK_API_C(void, BLASParamErrorProc)(const char *funcName
void SetBLASParamErrorProc(BLASParamErrorProc ErrorProc)
void cblas_sgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE transA, int M, int N, float alpha, const float *A, int lda, const float *X, int incX, float beta, float *Y, int incY)
void cblas_saxpy(int N, float alpha, const float *X, int incX, float *Y, int incY)
void cblas_sswap(int N, float *X, int incX, float *Y, int incY)
void cblas_scopy(int N, const float *X, int incX, float *Y, int incY)
int cblas_isamax(int N, const float *X, int incX)