3232#include " gcs.h"
3333#ifdef __AVX2__
3434#include " gqf_cpp.h"
35+ #include " simd-block.h"
3536#endif
3637#include " random.h"
37- #ifdef __AVX2__
38- #include " simd-block.h"
3938#include " simd-block-fixed-fpp.h"
40- #endif
4139#include " timing.h"
4240#ifdef __linux__
4341#include " linux-perf-events.h"
@@ -169,6 +167,30 @@ struct FilterAPI<CuckooFilterStable<ItemType, bits_per_item, TableType, HashFami
169167 }
170168};
171169
170+
171+ #ifdef __aarch64__
172+ template <typename HashFamily>
173+ struct FilterAPI <SimdBlockFilterFixed<HashFamily>> {
174+ using Table = SimdBlockFilterFixed<HashFamily>;
175+ static Table ConstructFromAddCount (size_t add_count) {
176+ Table ans (ceil (add_count * 8.0 / CHAR_BIT));
177+ return ans;
178+ }
179+ static void Add (uint64_t key, Table* table) {
180+ table->Add (key);
181+ }
182+ static void AddAll (const vector<uint64_t > keys, const size_t start, const size_t end, Table* table) {
183+ table->AddAll (keys, start, end);
184+ }
185+
186+ CONTAIN_ATTRIBUTES
187+ static bool Contain (uint64_t key, const Table * table) {
188+ return table->Find (key);
189+ }
190+ };
191+
192+ #endif
193+
172194#ifdef __AVX2__
173195template <typename HashFamily>
174196struct FilterAPI <SimdBlockFilter<HashFamily>> {
@@ -695,6 +717,18 @@ int main() {
695717*/
696718
697719int main (int argc, char * argv[]) {
720+ #ifdef __aarch64__
721+ std::map<int ,std::string> names = {{0 ," Xor8" },{1 ," Xor12" },
722+ {2 ," Xor16" }, {3 ," Cuckoo8" }, {4 ," Cuckoo12" },
723+ {5 ," Cuckoo16" }, {6 ," CuckooSemiSort13" }, {7 ," Bloom8" },
724+ {8 ," Bloom12" }, {9 ," Bloom16" }, {10 ," BlockedBloom" },
725+ {11 ," sort" }, {12 ," Xor+8" }, {13 ," Xor+16" },
726+ {14 ," GCS" }, {22 , " Xor10 (NBitArray)" }, {23 , " Xor14 (NBitArray)" },
727+ {25 , " Xor10" },{26 , " Xor10.666" }, {37 ," Bloom8 (addall)" },
728+ {38 ," Bloom12 (addall)" },
729+ {40 ," BlockedBloom (addall)" }
730+ };
731+ #elif defined( __AVX2__)
698732 std::map<int ,std::string> names = {{0 ," Xor8" },{1 ," Xor12" },
699733 {2 ," Xor16" }, {3 ," Cuckoo8" }, {4 ," Cuckoo12" },
700734 {5 ," Cuckoo16" }, {6 ," CuckooSemiSort13" }, {7 ," Bloom8" },
@@ -705,6 +739,18 @@ int main(int argc, char * argv[]) {
705739 {38 ," Bloom12 (addall)" },{39 ," Bloom16 (addall)" },
706740 {40 ," BlockedBloom (addall)" }, {63 ," BlockedBloom16" }, {64 ," BlockedBloom64" }
707741 };
742+ #else
743+ std::map<int ,std::string> names = {{0 ," Xor8" },{1 ," Xor12" },
744+ {2 ," Xor16" }, {3 ," Cuckoo8" }, {4 ," Cuckoo12" },
745+ {5 ," Cuckoo16" }, {6 ," CuckooSemiSort13" }, {7 ," Bloom8" },
746+ {8 ," Bloom12" }, {9 ," Bloom16" },
747+ {11 ," sort" }, {12 ," Xor+8" }, {13 ," Xor+16" },
748+ {14 ," GCS" }, {22 , " Xor10 (NBitArray)" }, {23 , " Xor14 (NBitArray)" },
749+ {25 , " Xor10" },{26 , " Xor10.666" }, {37 ," Bloom8 (addall)" },
750+ {38 ," Bloom12 (addall)" },{39 ," Bloom16 (addall)" }
751+ };
752+ #endif
753+
708754
709755 if (argc < 2 ) {
710756 cout << " Usage: " << argv[0 ] << " <numberOfEntries> [<algorithmId> [<seed>]]" << endl;
@@ -736,6 +782,10 @@ int main(int argc, char * argv[]) {
736782 // we have a list of algos
737783 algorithmId = 9999999 ; // disabling
738784 parse_comma_separated (argv[2 ], algos);
785+ if (algos.size () == 0 ) {
786+ cerr<< " no algo selected " << endl;
787+ return -3 ;
788+ }
739789 } else {
740790 // we select just one
741791 stringstream input_string_2 (argv[2 ]);
@@ -914,6 +964,14 @@ int main(int argc, char * argv[]) {
914964 cout << setw (NAME_WIDTH) << names[9 ] << cf << endl;
915965 }
916966
967+ #ifdef __aarch64__
968+ if (algorithmId == 10 || algorithmId < 0 || (algos.find (10 ) != algos.end ())) {
969+ auto cf = FilterBenchmark<SimdBlockFilterFixed<>>(
970+ add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
971+ cout << setw (NAME_WIDTH) << names[10 ] << cf << endl;
972+ }
973+ #endif
974+
917975#ifdef __AVX2__
918976 if (algorithmId == 10 || algorithmId < 0 || (algos.find (10 ) != algos.end ())) {
919977 auto cf = FilterBenchmark<SimdBlockFilterFixed<>>(
@@ -1091,8 +1149,13 @@ int main(int argc, char * argv[]) {
10911149 cout << setw (NAME_WIDTH) << names[40 ] << cf << endl;
10921150 }
10931151#endif
1094-
1095-
1152+ #ifdef __aarch64__
1153+ if (algorithmId == 40 || algorithmId < 0 || (algos.find (40 ) != algos.end ())) {
1154+ auto cf = FilterBenchmark<SimdBlockFilterFixed<SimpleMixSplit>>(
1155+ add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true );
1156+ cout << setw (NAME_WIDTH) << names[40 ] << cf << endl;
1157+ }
1158+ #endif
10961159
10971160// broken algorithms (don't always find all key)
10981161/*
0 commit comments