Accelerate.framework 中的数据类型
我正在开发一个使用 Accelerate 框架(针对 LAPACK)的程序,但有几个问题。代码是用 C 编写的,但需要包含 C++ 头文件。我将该文件重命名为 .cpp,但它导致了两个错误,如下所示。
所以我意识到尝试 #include
来包含标头,因为我们的 LAPACK 编码器所做的是在文件开头重新输入定义(dgemm_()、dposv_() 等
),并依靠编译器/链接器来解决问题。所以我注释掉了这些,然后做了#include。结果是这样的:
那么,如何在 C++ 文件中使用 Accelerate 来使用 LAPACK 函数?我对 LAPACK 不太熟悉,所以我不确定该框架通常如何工作。
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.
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:
So, how do I use the LAPACK functions using Accelerate in a C++ file? I'm not that familiar with LAPACK, so I'm not sure how that framework normally works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用类型
__CLPK_integer
或long
而不是int
来调用dgemm_
和dposv_
>。该错误是因为 C++ 中的long*
无法隐式转换为int*
。You should use call
dgemm_
anddposv_
using the type__CLPK_integer
orlong
instead ofint
. The error is because along*
cannot be implicitly converted to anint*
in C++.