Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / gna_plugin / floatmath.h
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma  once
6
7 #include <stdlib.h>
8 #include <stdio.h>
9 #ifndef _NO_MKL_
10 #include <mkl_dnn.h>
11 #include <mkl_cblas.h>
12 #endif
13 // #include "types.h"
14 #include "dnn.h"
15
16 #ifndef CBLAS_LAYOUT
17 #define CBLAS_LAYOUT CBLAS_ORDER
18 #endif
19
20 #define CNN_MAX_POOL_SIZE 6
21
22 void CNNFilter32(intel_dnn_component_t *component);
23 void CNNMaxPool(intel_dnn_component_t *component, intel_dnn_number_type_t number_type);
24
25 #ifdef _NO_MKL_
26 #ifndef _MKL_H_
27 #define _MKL_H_
28 typedef enum { CblasRowMajor = 101, CblasColMajor = 102 } CBLAS_LAYOUT;
29 typedef enum { CblasNoTrans = 111, CblasTrans = 112, CblasConjTrans = 113 } CBLAS_TRANSPOSE;
30 typedef enum { CblasUpper = 121, CblasLower = 122 } CBLAS_UPLO;
31 typedef enum { CblasNonUnit = 131, CblasUnit = 132 } CBLAS_DIAG;
32 typedef enum { CblasLeft = 141, CblasRight = 142 } CBLAS_SIDE;
33 typedef CBLAS_LAYOUT CBLAS_ORDER; /* this for backward compatibility with CBLAS_ORDER */
34 #define MKL_INT int
35 #endif  // #ifndef _MKL_H_
36 #endif  // #ifdef _NO_MKL_
37
38 #ifdef __cplusplus
39 extern "C" {  // API uses C linkage so that it can be used by C and C++ applications
40 #endif
41
42 #ifdef _NO_MKL_
43 void cblas_sgemm1(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE TransA,
44                   const CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,
45                   const MKL_INT K, const float alpha, const float *A,
46                   const MKL_INT lda, const float *B, const MKL_INT ldb,
47                   const float beta, float *C, const MKL_INT ldc);
48 void cblas_ssbmv1(const CBLAS_LAYOUT Layout, const CBLAS_UPLO Uplo,
49                   const MKL_INT N, const MKL_INT K, const float alpha, const float *A,
50                   const MKL_INT lda, const float *X, const MKL_INT incX,
51                   const float beta, float *Y, const MKL_INT incY);
52 #endif  // #ifdef _NO_MKL_
53 void cblas_sgemm_subset(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE TransA,
54                         const CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,
55                         const MKL_INT K, const float alpha, const float *A,
56                         const MKL_INT lda, const float *B, const MKL_INT ldb,
57                         const float beta, float *C, const MKL_INT ldc,
58                         const uint32_t *OutputList, const MKL_INT L);
59 void sgemv_split(const uint32_t N,
60                  const uint32_t K1,
61                  const uint32_t K2,
62                  const float *A1,
63                  const float *A2,
64                  const float *X,
65                  const float *B,
66                  float *C);
67
68 #ifdef __cplusplus
69 }
70 #endif
71