Intel TBB库有选择核心数量的功能吗?
我正在使用 Intel TBB 来加速图形领域的问题。 我想分析我的方法的可扩展性。
为了找到可扩展性,我想运行相同的算法 使用 1、2、3 和 4 个 CPU 核心。
有没有办法告诉 TBB 使用 2 & 3核 在 4 核 CPU 上运行测试。
I am using Intel TBB to speed up a problem in graphics domain.
I want to analyze the scalability of my method.
To find the scalability I want run the same algorithm
using 1, 2, 3 and 4 CPU cores.
Is there a way to tell TBB to use 2 & 3 cores
while running the tests on a 4 core CPU.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,有一种方法可以做到这一点:
task_scheduler_init 类可以让你做到这一点。您必须向类的构造函数传递您想要使用的线程数。您还必须确保所有 TBB 代码在实例构建之后和销毁之前运行。
通常,在主函数中将其声明为变量就足够了,如下所示:
Yes, there is a way to do that:
The task_scheduler_init class lets you do that. You have to pass the constructor of the class the number of threads you want to use. You also have to make sure that all your TBB code runs after the instance is constructed and before it is destroyed.
Usually, it is sufficient to declare it as a variable in the main function, like this: