Halide 22.0.0 Halide compiler and libraries

fuzz_helpers.h
Go to the documentation of this file.
1#ifndef HALIDE_FUZZ_HELPERS_H_
2#define HALIDE_FUZZ_HELPERS_H_
3
4#include "fuzzer/FuzzedDataProvider.h"
5#include <vector>
6
7 namespace Halide {
8
9 template<typename T>
10 inline T pick_value_in_vector(FuzzedDataProvider &fdp, std::vector<T> &vec) {
11 return vec[fdp.ConsumeIntegralInRange<size_t>(0, vec.size() - 1)];
12}
13} // namespace Halide
14
15#endif // HALIDE_FUZZ_HELPERS_H_
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::pick_value_in_vector
T pick_value_in_vector(FuzzedDataProvider &fdp, std::vector< T > &vec)
Definition: fuzz_helpers.h:10