开发者

Data Types in Accelerate.framework

开发者 https://www.devze.com 2023-01-17 03:56 出处:网络
I\'m working on a program that uses the Accelerate framework (for LAPACK) and I have several issues.The code is written in C but needs to include C++ headers.I renamed the file to .cpp but it caused t

I'm working on a program that uses the Accelerate framework (for LAPACK) and I have several issues. The code is written in C but needs to include C++ headers. I renamed the file to .cpp but it caused two errors, shown below.

Data Types in Accelerate.framework

So I then realized tried to #include <Accelerate/Accelerate.h> to include the headers, since what our LAPACK coder did was retype the definitions (dgemm_(), dposv_(), etc.) at the beginning of the file and rely on the compiler/linker to work things out. So I commented out those and just did the #include. What came out was this:

Data Types in Accelerate.framework

So, how do I use the LAPACK functions using Accelerate in a 开发者_StackOverflow社区C++ file? I'm not that familiar with LAPACK, so I'm not sure how that framework normally works.


You should use call dgemm_ and dposv_ using the type __CLPK_integer or long instead of int. The error is because a long* cannot be implicitly converted to an int* in C++.

typedef long int    __CLPK_integer;
typedef long int    __CLPK_logical;
typedef float       __CLPK_real;
typedef double      __CLPK_doublereal;
typedef __CLPK_logical  (*__CLPK_L_fp)();
typedef long int    __CLPK_ftnlen;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号