C++ (Cpp) RVar Example

Introduction

The c++ (cpp) rvar example is extracted from the most popular open source projects, you can refer to the following example for usage.

Programming language: C++ (Cpp)

Class/type: RVar

Example#1
File: Expr.cppProject: FreeAlex/Halide

 Expr::Expr(const RVar &v) : contents(new ExprContents(makeVar((v.name())), Int(32))) {
     contents->isRVar = true;
     assert(v.isDefined());
     assert(v.domain().isDefined());
     setRDom(v.domain());
     child(v.min());
     child(v.size());
 }

Example#2
File: Var.cppProject: nzinfo/Halide

 bool RVar::operator==(const RVar &other) const {
     return name() == other.name();
 }