Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Donaldson <afdx@google.com>2020-07-15 14:13:23 +0300
committerGitHub <noreply@github.com>2020-07-15 14:13:23 +0300
commit3e7238c68d7fb7f34331fcce852ea596a131216d (patch)
tree1c8244243073701a8b6e4194f96ec6d6a4cf8c54 /include
parent4c33fb0d3dbaf8b2579c112cdbb7e9794143e337 (diff)
spirv-fuzz: Add replay range option (#3535)
This change adds a --replay-range argument to spirv-fuzz that facilitates applying only a prefix of transformations.
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/libspirv.h6
-rw-r--r--include/spirv-tools/libspirv.hpp5
2 files changed, 11 insertions, 0 deletions
diff --git a/include/spirv-tools/libspirv.h b/include/spirv-tools/libspirv.h
index 03c7d1bf3..68afd6494 100644
--- a/include/spirv-tools/libspirv.h
+++ b/include/spirv-tools/libspirv.h
@@ -676,6 +676,12 @@ SPIRV_TOOLS_EXPORT void spvFuzzerOptionsEnableReplayValidation(
SPIRV_TOOLS_EXPORT void spvFuzzerOptionsSetRandomSeed(
spv_fuzzer_options options, uint32_t seed);
+// Sets the range of transformations that should be applied during replay: 0
+// means all transformations, +N means the first N transformations, -N means all
+// except the final N transformations.
+SPIRV_TOOLS_EXPORT void spvFuzzerOptionsSetReplayRange(
+ spv_fuzzer_options options, int32_t replay_range);
+
// Sets the maximum number of steps that the shrinker should take before giving
// up.
SPIRV_TOOLS_EXPORT void spvFuzzerOptionsSetShrinkerStepLimit(
diff --git a/include/spirv-tools/libspirv.hpp b/include/spirv-tools/libspirv.hpp
index 5e1819ee6..6b31a07e0 100644
--- a/include/spirv-tools/libspirv.hpp
+++ b/include/spirv-tools/libspirv.hpp
@@ -227,6 +227,11 @@ class FuzzerOptions {
spvFuzzerOptionsSetRandomSeed(options_, seed);
}
+ // See spvFuzzerOptionsSetReplayRange.
+ void set_replay_range(int32_t replay_range) {
+ spvFuzzerOptionsSetReplayRange(options_, replay_range);
+ }
+
// See spvFuzzerOptionsSetShrinkerStepLimit.
void set_shrinker_step_limit(uint32_t shrinker_step_limit) {
spvFuzzerOptionsSetShrinkerStepLimit(options_, shrinker_step_limit);