fml  0.1-0
Fused Matrix Library
blas.hh
1 // This file is part of fml which is released under the Boost Software
2 // License, Version 1.0. See accompanying file LICENSE or copy at
3 // https://www.boost.org/LICENSE_1_0.txt
4 
5 #ifndef FML_CPU_LINALG_BLAS_H
6 #define FML_CPU_LINALG_BLAS_H
7 #pragma once
8 
9 
10 #include "_blas_prototypes.h"
11 
12 
13 namespace fml
14 {
15  namespace blas
16  {
17  inline void gemm(const char transa, const char transb, const int m,
18  const int n, const int k, const float alpha,
19  const float *restrict a, const int lda, const float *restrict b,
20  const int ldb, const float beta, float *restrict c, const int ldc)
21  {
22  sgemm_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c,
23  &ldc);
24  }
25 
26  inline void gemm(const char transa, const char transb, const int m,
27  const int n, const int k, const double alpha,
28  const double *restrict a, const int lda, const double *restrict b,
29  const int ldb, const double beta, double *restrict c, const int ldc)
30  {
31  dgemm_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c,
32  &ldc);
33  }
34 
35 
36 
37  inline void syrk(const char uplo, const char trans, const int n, const int k,
38  const float alpha, const float *restrict a, const int lda,
39  const float beta, float *restrict c, const int ldc)
40  {
41  ssyrk_(&uplo, &trans, &n, &k, &alpha, a, &lda, &beta, c, &ldc);
42  }
43 
44  inline void syrk(const char uplo, const char trans, const int n, const int k,
45  const double alpha, const double *restrict a, const int lda,
46  const double beta, double *restrict c, const int ldc)
47  {
48  dsyrk_(&uplo, &trans, &n, &k, &alpha, a, &lda, &beta, c, &ldc);
49  }
50  }
51 }
52 
53 
54 #endif
fml
Core namespace.
Definition: dimops.hh:10