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>> {
@@ -211,6 +233,26 @@ struct FilterAPI<SimdBlockFilterFixed64<HashFamily>> {
211233};
212234
213235
236+ template <typename HashFamily>
237+ struct FilterAPI <SimdBlockFilterFixed16<HashFamily>> {
238+ using Table = SimdBlockFilterFixed16<HashFamily>;
239+ static Table ConstructFromAddCount (size_t add_count) {
240+ Table ans (ceil (add_count * 8.0 / CHAR_BIT));
241+ return ans;
242+ }
243+ static void Add (uint64_t key, Table* table) {
244+ table->Add (key);
245+ }
246+ static void AddAll (const vector<uint64_t > keys, const size_t start, const size_t end, Table* table) {
247+ throw std::runtime_error (" Unsupported" );
248+ }
249+
250+ CONTAIN_ATTRIBUTES
251+ static bool Contain (uint64_t key, const Table * table) {
252+ return table->Find (key);
253+ }
254+ };
255+
214256template <typename HashFamily>
215257struct FilterAPI <SimdBlockFilterFixed<HashFamily>> {
216258 using Table = SimdBlockFilterFixed<HashFamily>;
@@ -675,6 +717,18 @@ int main() {
675717*/
676718
677719int 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__)
678732 std::map<int ,std::string> names = {{0 ," Xor8" },{1 ," Xor12" },
679733 {2 ," Xor16" }, {3 ," Cuckoo8" }, {4 ," Cuckoo12" },
680734 {5 ," Cuckoo16" }, {6 ," CuckooSemiSort13" }, {7 ," Bloom8" },
@@ -683,8 +737,20 @@ int main(int argc, char * argv[]) {
683737 {14 ," GCS" }, {15 ," CQF" }, {22 , " Xor10 (NBitArray)" }, {23 , " Xor14 (NBitArray)" },
684738 {25 , " Xor10" },{26 , " Xor10.666" }, {37 ," Bloom8 (addall)" },
685739 {38 ," Bloom12 (addall)" },{39 ," Bloom16 (addall)" },
686- {40 ," BlockedBloom (addall)" }, {64 ," BlockedBloom64" }
740+ {40 ," BlockedBloom (addall)" }, {63 ," BlockedBloom16" }, {64 ," BlockedBloom64" }
741+ };
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)" }
687751 };
752+ #endif
753+
688754
689755 if (argc < 2 ) {
690756 cout << " Usage: " << argv[0 ] << " <numberOfEntries> [<algorithmId> [<seed>]]" << endl;
@@ -716,6 +782,10 @@ int main(int argc, char * argv[]) {
716782 // we have a list of algos
717783 algorithmId = 9999999 ; // disabling
718784 parse_comma_separated (argv[2 ], algos);
785+ if (algos.size () == 0 ) {
786+ cerr<< " no algo selected " << endl;
787+ return -3 ;
788+ }
719789 } else {
720790 // we select just one
721791 stringstream input_string_2 (argv[2 ]);
@@ -894,6 +964,14 @@ int main(int argc, char * argv[]) {
894964 cout << setw (NAME_WIDTH) << names[9 ] << cf << endl;
895965 }
896966
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+
897975#ifdef __AVX2__
898976 if (algorithmId == 10 || algorithmId < 0 || (algos.find (10 ) != algos.end ())) {
899977 auto cf = FilterBenchmark<SimdBlockFilterFixed<>>(
@@ -905,6 +983,15 @@ int main(int argc, char * argv[]) {
905983 add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
906984 cout << setw (NAME_WIDTH) << names[64 ] << cf << endl;
907985 }
986+
987+ #endif
988+ #ifdef __SSSE3__
989+
990+ if (algorithmId == 63 || algorithmId < 0 || (algos.find (63 ) != algos.end ())) {
991+ auto cf = FilterBenchmark<SimdBlockFilterFixed16<SimpleMixSplit>>(
992+ add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
993+ cout << setw (NAME_WIDTH) << names[63 ] << cf << endl;
994+ }
908995#endif
909996
910997 if (algorithmId == 11 || algorithmId < 0 || (algos.find (11 ) != algos.end ())) {
@@ -1062,8 +1149,13 @@ int main(int argc, char * argv[]) {
10621149 cout << setw (NAME_WIDTH) << names[40 ] << cf << endl;
10631150 }
10641151#endif
1065-
1066-
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
10671159
10681160// broken algorithms (don't always find all key)
10691161/*
0 commit comments