1 // SPDX-License-Identifier: Apache-2.0
3 * Copyright (C) 2020 Jijoong Moon <jijoong.moon@samsung.com>
5 * @file blas_interface.h
7 * @see https://github.com/nnstreamer/nntrainer
8 * @author Jijoong Moon <jijoong.moon@samsung.com>
9 * @bug No known bugs except for NYI items
10 * @brief This is dummy header for blas support
14 #ifndef __BLAS_INTERFACE_H_
15 #define __BLAS_INTERFACE_H_
23 enum CBLAS_ORDER { CblasRowMajor = 101, CblasColMajor = 102 };
25 enum CBLAS_TRANSPOSE {
34 #include <helper_cuda.h>
35 #include <helper_functions.h>
38 #include <tensor_dim.h>
42 void sscal(const unsigned int N, const float alpha, void *X, const int incX,
43 ml::train::TensorDim::DataType d_type);
45 void sscal(const unsigned int N, const float alpha, float *X, const int incX);
47 void sscal(const unsigned int N, const float alpha, __fp16 *X, const int incX);
49 float snrm2(const int N, const float *X, const int incX);
51 void scopy(const unsigned int N, const void *X, const int incX, void *Y,
52 const int incY, ml::train::TensorDim::DataType d_type);
54 void scopy(const unsigned int N, const float *X, const int incX, float *Y,
57 void scopy(const unsigned int N, const __fp16 *X, const int incX, __fp16 *Y,
60 float sdot(const unsigned int N, const float *X, const unsigned int incX,
61 const float *Y, const unsigned int incY);
63 void saxpy(const unsigned int N, const float alpha, const float *X,
64 const int incX, float *Y, const int incY);
66 void sgemm(CBLAS_ORDER order, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB,
67 const unsigned int M, const unsigned int N, const unsigned int K,
68 const float alpha, const float *A, const unsigned int lda,
69 const float *B, const unsigned int ldb, const float beta, float *C,
70 const unsigned int ldc);
72 void sgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE TransA, const unsigned int M,
73 const unsigned int N, const float alpha, const float *A,
74 const unsigned int lda, const float *X, const int incX,
75 const float beta, float *Y, const int incY);
77 unsigned int isamax(const unsigned int N, const float *X, const int incX);
79 } /* namespace nntrainer */
80 #endif /* __cplusplus */
81 #endif /* __BLAS_INTERFACE_H__ */