MLX
 
Loading...
Searching...
No Matches
lapack.h
Go to the documentation of this file.
1// Copyright © 2023-2024 Apple Inc.
2
3#pragma once
4
5// Required for Visual Studio.
6// https://github.com/OpenMathLib/OpenBLAS/blob/develop/docs/install.md
7#ifdef _MSC_VER
8#include <complex>
9#define LAPACK_COMPLEX_CUSTOM
10#define lapack_complex_float std::complex<float>
11#define lapack_complex_double std::complex<double>
12#endif
13
14#ifdef MLX_USE_ACCELERATE
15#include <Accelerate/Accelerate.h>
16#else
17#include <cblas.h>
18#include <lapack.h>
19#endif
20
21#if defined(LAPACK_GLOBAL) || defined(LAPACK_NAME)
22
23// This is to work around a change in the function signatures of lapack >= 3.9.1
24// where functions taking char* also include a strlen argument, see a similar
25// change in OpenCV:
26// https://github.com/opencv/opencv/blob/1eb061f89de0fb85c4c75a2deeb0f61a961a63ad/cmake/OpenCVFindLAPACK.cmake#L57
27#define MLX_LAPACK_FUNC(f) LAPACK_##f
28
29#else
30
31#define MLX_LAPACK_FUNC(f) f##_
32
33#endif