Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

problem in using Parallel_for

sheetal_w_
Beginner
224 Views

Hi, I am using tbb with visual studion 2005. Implemented concurrent_bounded queue and its working fine. In same application i am trying to implement parallel_for but when i include parallel_for.h its showing lots of errors in task.h file. Please let me know what kind of setting is required.  Sample application in tbb are working fine and i tried to figure it out from that but its not working. 

Erros are as follows:

\tbb40_20120408oss\include\tbb\internal\../tbb_machine.h(305) : warning C4793: '__asm' : causes native code generation for function 'void tbb::atomic_fence(void)'
1> \tbb40_20120408oss\include\tbb\internal\../tbb_machine.h(305) : see declaration of 'tbb::atomic_fence'
1\tbb40_20120408oss\include\tbb\task.h(64) : error C2059: syntax error : 'constant'
1>\tbb40_20120408oss\include\tbb\task.h(146) : error C2059: syntax error : 'constant'
1>\tbb40_20120408oss\include\tbb\task.h(153) : error C2059: syntax error : 'constant'
1>d:\sheetal\multiprompter pal\multiprompter pro 4.10.00 for pal 112june 2013 tbb parallelfor\tbb40_20120408oss\include\tbb\task.h(159) : error C2059: syntax error : 'constant'
1>\tbb40_20120408oss\include\tbb\task.h(165) : error C2059: syntax error : 'constant'
1>\tbb40_20120408oss\include\tbb\task.h(927) : error C2660: 'tbb::internal::allocate_root_proxy::_free_dbg' : function does not take 2 arguments
1>\tbb40_20120408oss\include\tbb\task.h(936) : error C2660: 'tbb::internal::allocate_root_with_context_proxy::_free_dbg' : function does not take 2 arguments
1>\tbb40_20120408oss\include\tbb\task.h(945) : error C2660: 'tbb::internal::allocate_continuation_proxy::_free_dbg' : function does not take 2 arguments
1>\tbb40_20120408oss\include\tbb\task.h(953) : error C2660: 'tbb::internal::allocate_child_proxy::_free_dbg' : function does not take 2 arguments
1>\tbb40_20120408oss\include\tbb\task.h(961) : error C2660: 'tbb::internal::allocate_additional_child_of_proxy::_free_dbg' : function does not take 2 arguments
1>Creating browse information file..

0 Kudos
9 Replies
Wooyoung_K_Intel
Employee
224 Views

Hi Sheetal,

I downloaded tbb 4.0 U4 (tbb40_20120408oss) and built it with vs 2005 (32/64, release/debug) and did not get any build issues.

Could you give us more detail about how you built your application? Like, your machine environment, your %INCLUDE%, etc ?

Thanks a lot.

 

 

sheetal_w_
Beginner
224 Views

Thanks for the reply, I tried to use it with tbb 4.0 (tbb40_20120408oss) and tbb 4.1 (tbb40_20120613oss). when i create any new application it works.  I am using tbb in my old existing project then it is giving error.  I have not set any entry in Environment Variable. I have just given path of of tbb as follows 

Project -> Properties -> c++ -> General -> Additional Include Directories -> c:\tbb40_20120613oss\includes

Project -> Properties -> Linker-> General ->Additional Library Directories -> C:\tbb41_20130314oss\lib\ia32\vc8

Project -> Properties -> Linker-> input -> tbb_debug.lib

with tese settings if i use concurrent_bounded_queue.h it works. But haveing problem in parallal_for.h->task.h

dose any other settings done for DirectX / atlmfc componenets could affect tbb files?

sheetal_w_
Beginner
224 Views

I am also using the same version of tbb. when i create any new application it works.  But i am going to integrate tbb in my old project and then its giving errors. I have not set environment variable. Just done simple reguler settings as follows

project->Properties -> c++ -> General ->Additional Include Directories -> c:\tbb40_20120408oss\includes

project->Properties -> Linker ->General -> Additional Library Directories -> C:\tbb41_20130314oss\lib\ia32\vc8

project->Properties -> Linker ->Input -> tbb_debug.lib

With these settings concurrent_bounded_queue is working fine. But when i include parallal_for.h problem starts.

is it possible that other files from mfc can have declarations as task.h and because of this such problem has raised? But i did not found any such other declaration. 

Please help me to solve this issue

Vladimir_P_Intel2
224 Views

Something (maybe MFC headers) defines 'free' to something studio specific. 

you can point to line 64 of \tbb40_20120408oss\include\tbb\task.h in the visual studio and check where 'free' is defined.

--Vladimir

sheetal_w_
Beginner
224 Views

In task.h free is defined and that is giving error messages. But how to solve it? there could be declaration of free in other mfc files, i tried to fined but i can not change any declaration. Then how to solve this problem? and idea?

sheetal_w_
Beginner
224 Views

does anyone have solution of this problem?

Vladimir_P_Intel2
224 Views

could you check that _CRTDBG_MAP_ALLOC macro is not defined?

it looks to be similar to http://software.intel.com/en-us/forums/topic/284768 topic

--Vladimir

sheetal_w_
Beginner
224 Views

Yes it if defined in my project files. What i need to do with it now? 

sheetal_w_
Beginner
224 Views

Thanks a lot Mr. Vladimir

I have commented all decleartions from my code, this may affect my output dont know where but atleast parallel_ for is working. 

Reply