Lines Matching refs:table
609 static void apply( DataStateTrackedTable& table, int i ) { in apply()
612 …CHECK_FAST_MESSAGE((table.insert( a, std::make_pair(MyKey::make(i), move_support_tests::Foo(next))… in apply()
621 static void apply_impl( DataStateTrackedTable& table, int i) { in apply_impl()
623 CHECK_FAST_MESSAGE((table.emplace( a, MyKey::make(i), (i + 1))), in apply_impl()
629 static void apply( DataStateTrackedTable& table, int i ) { in apply()
632 apply_impl<DataStateTrackedTable::accessor>(table, i); in apply()
634 apply_impl<DataStateTrackedTable::const_accessor>(table, i); in apply()
647 TableOperation( test_table_type& table ) : my_table(table) {} in TableOperation() argument
655 static void apply( test_table_type& table, int i ) { in apply()
659 table.insert( a, MyKey::make(i) ); in apply()
667 table.insert( a, std::make_pair(MyKey::make(i), MyData(i*i)) ); in apply()
671 table.insert( ca, std::make_pair(MyKey::make(i), MyData(i*i)) ); in apply()
679 static void apply( test_table_type& table, int i ) { in apply()
682 bool b = table.find( a, MyKey::make(i) ); in apply()
701 static void apply( const test_table_type& table, int i ) { in apply()
704 bool b = table.find( a, MyKey::make(i) ); in apply()
705 CHECK_FAST(b==(table.count(MyKey::make(i))>0)); in apply()
716 static void apply( test_table_type& table, int i ) { in apply()
725 table.insert( il ); in apply()
731 void DoConcurrentOperations( TableType& table, int n, const char* what, std::size_t nthread ) { in DoConcurrentOperations() argument
733 …bb::parallel_for(oneapi::tbb::blocked_range<int>(0, n ,100), TableOperation<Op, TableType>(table)); in DoConcurrentOperations()
737 void TraverseTable( test_table_type& table, size_t n, size_t expected_size ) { in TraverseTable() argument
739 size_t actual_size = table.size(); in TraverseTable()
744 const test_table_type& const_table = table; in TraverseTable()
746 for( test_table_type::iterator i = table.begin(); i!=table.end(); ++i ) { in TraverseTable()
757 … std::pair<test_table_type::iterator, test_table_type::iterator> er = table.equal_range(i->first); in TraverseTable()
778 static void apply( test_table_type& table, int i ) { in apply()
783 b = table.find( a, MyKey::make(i) ) && table.erase( a ); in apply()
786 b = table.find( a, MyKey::make(i) ) && table.erase( a ); in apply()
789 b = table.erase( MyKey::make(i) ); in apply()
791 CHECK_FAST(table.count(MyKey::make(i)) == 0); in apply()
800 static void apply( YourTable& table, int i ) { in apply()
803 if ( table.insert( std::make_pair(MyKey::make(key), MyData2()) ) ) in apply()
809 if(table.find( res, MyKey::make(key) ) && table.erase( res ) ) in apply()
813 if(table.find( res, MyKey::make(key) ) && table.erase( res ) ) in apply()
821 static void apply( YourTable& table, int i ) { in apply()
824 table.insert( a1, MyKey::make(1) ); in apply()
826 table.insert( a2, MyKey::make(1 + (1<<30)) ); // the same chain in apply()
827 table.erase( a2 ); // if erase by key it would lead to deadlock for single thread in apply()
833 YourTable& table; member
834 FakeExclusive(utils::SpinBarrier& b, YourTable&t) : barrier(b), table(t) {} in FakeExclusive()
839 CHECK(table.find(real_ca,MyKey::make(1))); in operator ()()
845 const YourTable &const_table = table; in operator ()()
850 table.erase( fake_ca ); in operator ()()
886 void ParallelTraverseTable( test_table_type& table, size_t n, size_t expected_size ) { in ParallelTraverseTable() argument
888 CHECK(table.size()==expected_size); in ParallelTraverseTable()
892 test_table_type::range_type r = table.range(10); in ParallelTraverseTable()
896 const test_table_type& const_table = table; in ParallelTraverseTable()
916 test_table_type table(alloc); in TestInsertFindErase() local
917 TraverseTable(table,n,0); in TestInsertFindErase()
918 ParallelTraverseTable(table,n,0); in TestInsertFindErase()
922 …DoConcurrentOperations<InsertInitList, test_table_type>( table, n, "insert(std::initializer_list)"… in TestInsertFindErase()
924 DoConcurrentOperations<Insert, test_table_type>( table, n, "insert", nthread ); in TestInsertFindErase()
926 TraverseTable( table, n, m ); in TestInsertFindErase()
927 ParallelTraverseTable( table, n, m ); in TestInsertFindErase()
929 DoConcurrentOperations<Find, test_table_type>( table, n, "find", nthread ); in TestInsertFindErase()
932 DoConcurrentOperations<FindConst, test_table_type>( table, n, "find(const)", nthread ); in TestInsertFindErase()
936 DoConcurrentOperations<Erase, test_table_type>( table, n, "erase", nthread ); in TestInsertFindErase()
939 TraverseTable( table, n, 0 ); in TestInsertFindErase()
941 table.clear(); in TestInsertFindErase()
970 …AddToTable( test_table_type& table, std::size_t nthread, int m ) : my_table(table), my_nthread(nth… in AddToTable() argument
1005 RemoveFromTable( test_table_type& table, int m ) : my_table(table), my_m(m) {} in RemoveFromTable() argument
1029 test_table_type table; in TestConcurrency() local
1033 utils::NativeParallelFor( nthread, AddToTable(table,nthread,m) ); in TestConcurrency()
1038 utils::NativeParallelFor( nthread, RemoveFromTable(table,m) ); in TestConcurrency()
1564 DataStateTrackedTable table; variable
1565 … DoConcurrentOperations<RvalueInsert, DataStateTrackedTable>( table, n, "rvalue ref insert", 1 );
1568 DataStateTrackedTable table; variable
1569 DoConcurrentOperations<Emplace, DataStateTrackedTable>( table, n, "emplace", 1 );