tbb::pipeline problem

tbb::pipeline problem

Roman的头像
The following code in simple project in Microsoft Visual Studio 2010 with Intel Parallel Studio 2011 (Intel Parallel Composer 2011 beta Update 2 (Package ID: composer_2011_beta_update2.031)) always produces an error.
#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	tbb::pipeline* p = new tbb::pipeline;
	delete p;
	return 0;
}
Message dialog box:
Windows has triggered a breakpoint in TestPipeline.exe.
This may be due to a corruption of the heap, which indicates a bug in TestPipeline.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while TestPipeline.exe has focus.
The output window may have more diagnostic information.

Test project is attached.

附件尺寸
下载 TestPipeline.rar2.77 KB
В действительности всё не так, как на самом деле...
2 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Peter Wang (Intel)的头像

Thanks for your example code.

I suppose that you missed some steps, see below:

1. You should addINCLUDE files at header of file
#include "tbb/pipeline.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/allocator.h"

2. You have to start "tbb::task_scheduler_init" first in code

3. Then you can create the pipeline, like as "tbb::pipeline pipeline"

4. Defining/doing some filters, like as "pipeline.add_filter ( filterN); The user can define how that filter works for stream, files.

5. Last step is to run pipeline.run ()

There is one simple example to use tbb::pipeline, under tbb\examples\pipeline for your reference.

Regards, Peter

登陆并发表评论。