File tree 1 file changed +20
-3
lines changed
1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include " simdjson.h"
3
3
4
- namespace compile_tests {
5
-
6
4
using namespace std ;
7
5
using namespace simdjson ;
8
6
using error_code=simdjson::error_code;
@@ -74,7 +72,26 @@ void basics_ndjson() {
74
72
// Prints 1 2 3
75
73
}
76
74
77
- } // namespace basics
75
+ void implementation_selection_1 () {
76
+ cout << " simdjson v" << STRINGIFY (SIMDJSON_VERSION) << endl;
77
+ cout << " Detected the best implementation for your machine: " << simdjson::active_implementation->name ();
78
+ cout << " (" << simdjson::active_implementation->description () << " )" << endl;
79
+ }
80
+
81
+ void implementation_selection_2 () {
82
+ for (auto implementation : simdjson::available_implementations) {
83
+ cout << implementation->name () << " : " << implementation->description () << endl;
84
+ }
85
+ }
86
+
87
+ void implementation_selection_3 () {
88
+ cout << simdjson::available_implementations[" fallback" ]->description () << endl;
89
+ }
90
+
91
+ void implementation_selection_4 () {
92
+ // Use the fallback implementation, even though my machine is fast enough for anything
93
+ simdjson::active_implementation = simdjson::available_implementations[" fallback" ];
94
+ }
78
95
79
96
int main () {
80
97
return 0 ;
You can’t perform that action at this time.
0 commit comments