cblas.h
1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//===- cblas.h - Simple Blas subset ---------------------------------------===//
//
// Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef MLIR_CPU_RUNNER_CBLAS_H_
#define MLIR_CPU_RUNNER_CBLAS_H_
#include "mlir_runner_utils.h"
#ifdef _WIN32
#ifndef MLIR_CBLAS_EXPORT
#ifdef cblas_EXPORTS
/* We are building this library */
#define MLIR_CBLAS_EXPORT __declspec(dllexport)
#else
/* We are using this library */
#define MLIR_CBLAS_EXPORT __declspec(dllimport)
#endif // cblas_EXPORTS
#endif // MLIR_CBLAS_EXPORT
#else
#define MLIR_CBLAS_EXPORT
#endif // _WIN32
/// This reproduces a minimal subset of cblas to allow integration testing
/// without explicitly requiring a dependence on an external library.
/// Without loss of generality, various cblas implementations may be swapped in
/// by including the proper headers and linking with the proper library.
enum CBLAS_ORDER { CblasRowMajor = 101, CblasColMajor = 102 };
enum CBLAS_TRANSPOSE {
CblasNoTrans = 111,
CblasTrans = 112,
CblasConjTrans = 113
};
extern "C" MLIR_CBLAS_EXPORT float cblas_sdot(const int N, const float *X,
const int incX, const float *Y,
const int incY);
extern "C" MLIR_CBLAS_EXPORT void
cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
const int K, const float alpha, const float *A, const int lda,
const float *B, const int ldb, const float beta, float *C,
const int ldc);
#endif // MLIR_CPU_RUNNER_CBLAS_H_