MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / IsPermutationOfRange

Function IsPermutationOfRange

source/fuzz/fuzzer_util.cpp:982–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

980}
981
982bool IsPermutationOfRange(const std::vector<uint32_t>& arr, uint32_t lo,
983 uint32_t hi) {
984 if (arr.empty()) {
985 return lo > hi;
986 }
987
988 if (HasDuplicates(arr)) {
989 return false;
990 }
991
992 auto min_max = std::minmax_element(arr.begin(), arr.end());
993 return arr.size() == hi - lo + 1 && *min_max.first == lo &&
994 *min_max.second == hi;
995}
996
997std::vector<opt::Instruction*> GetParameters(opt::IRContext* ir_context,
998 uint32_t function_id) {

Callers 2

IsApplicableMethod · 0.85
IsApplicableMethod · 0.85

Calls 5

HasDuplicatesFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected