/src/simdjson/fuzz/supported_implementations.h
Line | Count | Source (jump to first uncovered line) |
1 | | #pragma once |
2 | | |
3 | | #include "simdjson.h" |
4 | | #include <vector> |
5 | | #include <cstdlib> |
6 | | |
7 | | /** |
8 | | * @brief get_runtime_supported_implementations |
9 | | * Returns a vector of implementations, which both |
10 | | * have been compiled *and* are dynamically checked to |
11 | | * be supported at runtime. |
12 | | * |
13 | | * Aborts if no implementations are available (should not happen, fallback |
14 | | * should always be there for us!) |
15 | | * @return |
16 | | */ |
17 | | std::vector<const simdjson::implementation*> |
18 | 3 | get_runtime_supported_implementations() { |
19 | 3 | std::vector<const simdjson::implementation*> ret; |
20 | 12 | for(auto& e: simdjson::get_available_implementations()) { |
21 | 12 | if(e->supported_by_runtime_system()) { |
22 | 9 | ret.emplace_back(e); |
23 | 9 | } |
24 | 12 | } |
25 | 3 | if(ret.empty()) { |
26 | | // No implementations available, not even fallback, weird. |
27 | 0 | std::abort(); |
28 | 0 | } |
29 | 3 | return ret; |
30 | 3 | } |