diff --git a/mlir/test/mlir-cpu-runner/CMakeLists.txt b/mlir/test/mlir-cpu-runner/CMakeLists.txt --- a/mlir/test/mlir-cpu-runner/CMakeLists.txt +++ b/mlir/test/mlir-cpu-runner/CMakeLists.txt @@ -9,7 +9,7 @@ add_llvm_library(cblas_interface SHARED cblas_interface.cpp) target_link_libraries(cblas_interface PRIVATE cblas) +target_compile_definitions(cblas_interface PRIVATE cblas_interface_EXPORTS) add_llvm_library(mlir_runner_utils SHARED mlir_runner_utils.cpp) target_compile_definitions(mlir_runner_utils PRIVATE mlir_runner_utils_EXPORTS) - diff --git a/mlir/test/mlir-cpu-runner/cblas_interface.cpp b/mlir/test/mlir-cpu-runner/cblas_interface.cpp --- a/mlir/test/mlir-cpu-runner/cblas_interface.cpp +++ b/mlir/test/mlir-cpu-runner/cblas_interface.cpp @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#include "include/cblas_interface.h" #include "include/cblas.h" #include #include diff --git a/mlir/test/mlir-cpu-runner/include/cblas_interface.h b/mlir/test/mlir-cpu-runner/include/cblas_interface.h new file mode 100644 --- /dev/null +++ b/mlir/test/mlir-cpu-runner/include/cblas_interface.h @@ -0,0 +1,57 @@ +//===- cblas_interface.h - Simple Blas subset interface -------------------===// +// +// 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_INTERFACE_H_ +#define MLIR_CPU_RUNNER_CBLAS_INTERFACE_H_ + +#include "mlir_runner_utils.h" + +#ifdef _WIN32 +#ifndef MLIR_CBLAS_INTERFACE_EXPORT +#ifdef cblas_interface_EXPORTS +/* We are building this library */ +#define MLIR_CBLAS_INTERFACE_EXPORT __declspec(dllexport) +#else +/* We are using this library */ +#define MLIR_CBLAS_INTERFACE_EXPORT __declspec(dllimport) +#endif +#endif +#else +#define MLIR_CBLAS_INTERFACE_EXPORT +#endif + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_fill_viewf32_f32(StridedMemRefType *X, float f); + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_fill_viewsxf32_f32(StridedMemRefType *X, float f); + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_fill_viewsxsxf32_f32(StridedMemRefType *X, float f); + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_copy_viewf32_viewf32(StridedMemRefType *I, + StridedMemRefType *O); + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_copy_viewsxf32_viewsxf32(StridedMemRefType *I, + StridedMemRefType *O); +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_copy_viewsxsxf32_viewsxsxf32(StridedMemRefType *I, + StridedMemRefType *O); + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_dot_viewsxf32_viewsxf32_viewf32(StridedMemRefType *X, + StridedMemRefType *Y, + StridedMemRefType *Z); + +extern "C" MLIR_CBLAS_INTERFACE_EXPORT void +linalg_matmul_viewsxsxf32_viewsxsxf32_viewsxsxf32( + StridedMemRefType *A, StridedMemRefType *B, + StridedMemRefType *C); + +#endif // MLIR_CPU_RUNNER_CBLAS_INTERFACE_H_