mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
8a68163905
This refactors the dynamic check of which implementations are supported at runtime. It also reduces duplicated effort in the CI fuzzing job, the differential fuzzers don't need to run with different values of SIMDJSON_FORCE_IMPLEMENTATION. There is also a convenience script to run the fuzzers locally, to quickly check that the fuzzers still build, run and no easy to find bugs are there. It should be handy not only when developing the fuzzers, but also when modifying simdjson.
31 lines
816 B
C++
31 lines
816 B
C++
#pragma once
|
|
|
|
#include "simdjson.h"
|
|
#include <vector>
|
|
#include <cstdlib>
|
|
|
|
/**
|
|
* @brief get_runtime_supported_implementations
|
|
* Returns a vector of implementations, which both
|
|
* have been compiled *and* are dynamically checked to
|
|
* be supported at runtime.
|
|
*
|
|
* Aborts if no implementations are available (should not happen, fallback
|
|
* should always be there for us!)
|
|
* @return
|
|
*/
|
|
std::vector<const simdjson::implementation*>
|
|
get_runtime_supported_implementations() {
|
|
std::vector<const simdjson::implementation*> ret;
|
|
for(auto& e: simdjson::available_implementations) {
|
|
if(e->supported_by_runtime_system()) {
|
|
ret.emplace_back(e);
|
|
}
|
|
}
|
|
if(ret.empty()) {
|
|
// No implementations available, not even fallback, weird.
|
|
std::abort();
|
|
}
|
|
return ret;
|
|
}
|