apps/hardware_benchmarks/tests/random_pipeline/random_pipeline_generator.cpp
// takes a vector of inputs (points in functions) and an expected Type
// if the chosen input is not of the given type, cast it to conform
takes a vector of inputs (points in functions) and an expected Type
if the chosen input is not of the given type, cast it to conform
takes a vector of inputs ( points in functions ) and an expected Type if the chosen input is not of the given type cast it to conform
Expr make_leaf(vector<Expr> inputs) {
  if (true) {
    auto chosen_input = inputs[rand_int(0, inputs.size()-1)];
    return chosen_input;
  } else {
    uint bitwidth = inputs.at(0).type().bits();
    if (bitwidth == 1) {
      Expr constant_bool = UIntImm::make(UInt(1), rand_int(0,1));
    } else {
      Expr constant_number = IntImm::make(Int(bitwidth), rand_int(1, 100));
      return constant_number;
    }
  }
}
Expr make_leaf ( vector < Expr > inputs ) { if ( true ) { auto chosen_input = inputs [ rand_int ( 0 , inputs . size ( ) - 1 ) ] ; return chosen_input ; } else { uint bitwidth = inputs . at ( 0 ) . type ( ) . bits ( ) ; if ( bitwidth == 1 ) { Expr constant_bool = UIntImm :: make ( UInt ( 1 ) , rand_int ( 0 , 1 ) ) ; } else { Expr constant_number = IntImm :: make ( Int ( bitwidth ) , rand_int ( 1 , 100 ) ) ; return constant_number ; } } }
takes a vector of inputs (points in functions) and an expected Type
if the chosen input is not of the given type, cast it to conform
takes a vector of inputs ( points in functions ) and an expected Type if the chosen input is not of the given type cast it to conform
//if (rand_bool()) {