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

problem with concurrent_vector with cache_aligned_allocator

ahmedg
Beginner
300 Views
Hello everyone,

When I declare a concurrent_vector like :
concurrent_vector< data1D > myData1D ;
/*struct data1D
{
Color X , Y ; // struct of Red, Green and Blue
point2D imgPos ; // struct of int PositonX and PositionY
};
*/

It works well.

When I want to use cache_aligned_allocator, if it's a simple data type
like "int", not problem, but if I use it for my data1D struct like :
concurrent_vector< cache_aligned_allocator > myData1D ;
And try to used the push_back() funtion,
I get the following error:
no matching function for call to
tbb::concurrent_vector<:CACHE_ALIGNED_ALLOCATOR><:DATA1D>,
tbb::cache_aligned_allocator<:CACHE_ALIGNED_ALLOCATOR><:DATA1D>
> >::push_back(myNameSpace::data1D&)

myNameSpace is a namespace where I declare the data1D struct

Thanks a lot for any help.
0 Kudos
2 Replies
Anton_Pegushin
New Contributor II
300 Views
Quoting - ahmedg
I get the following error:
no matching function for call to
tbb::concurrent_vector<:CACHE_ALIGNED_ALLOCATOR><:DATA1D>,
tbb::cache_aligned_allocator<:CACHE_ALIGNED_ALLOCATOR><:DATA1D>
> >::push_back(myNameSpace::data1D&)
Hi, it seems that you're declaring a vector of tbb::cache_aligned_allocators... First template parameter should be just myNameSpace::data1D.
0 Kudos
ahmedg
Beginner
300 Views
Hi, it seems that you're declaring a vector of tbb::cache_aligned_allocators... First template parameter should be just myNameSpace::data1D.


Hello Anton,

Many thanks, that was the error.

Have a nice day :)
0 Kudos
Reply