Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2421 Discussions

problem with concurrent_vector with cache_aligned_allocator

ahmedg
Beginner
139 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
139 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.
ahmedg
Beginner
139 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 :)
Reply