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