英特尔线程 C API
我们希望使用纯 C 而非 C++ 中的英特尔线程构建模块
。他们也有 C API 吗?
We would like to use Intel Threading Building Blocks
from plain C, not C++. Do they have also C API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
线程构建块是一种 C++ API,它大量使用模板、构造函数、析构函数和其他仅 C++ 功能。 Intel 不提供C 版本。鉴于所使用的 C++ 功能集,我发现很难想象其他人已经解决了纯 C 的移植问题。
Threaded Building Blocks is a C++ API that makes heavy use of templates, constructors, destructors, and other C++ only features. Intel does not provide a C version. Given the C++ feature set used, I find it hard to imagine anyone else has tackled a port to pure C.
它是专门为解决 C++ 的已知问题而设计的。我认为其他语言都不存在这种情况。
It's specifically designed to address a perceived problem with C++. I don't think it exists for any other languages.
正如 Ashelly 和 jeffamaphone 提到的,TBB 仅支持 C++,因为大多数并行构造函数都基于 C++ 模板和 C++11 lambda。
但是,如果您仍然想使用纯 C 语言的并行库,您可以尝试 OpenMP 和 Cilk Plus。请注意,OpenMP 表示为 C/C++
#pragma
和一些 C 风格的 API。 Cilk Plus 基本上基于 C++,但它也支持 C 语言的大部分重要功能。As Ashelly and jeffamaphone mentioned, TBB only supports C++ because most of the parallel constructors are based on C++ template and C++11 lambda.
However, if you still want to use a parallel library for pure C, you may try either OpenMP and Cilk Plus. Note that OpenMP is represented as C/C++
#pragma
and some C-style APIs. Cilk Plus is basically based on C++, however, it supports mostly important features in C as well.