Halide
Halide::Internal::CodeGen_PyTorch Class Reference

This class emits C++ code to wrap a Halide pipeline so that it can be used as a C++ extension operator in PyTorch. More...

#include <CodeGen_PyTorch.h>

Inherits Halide::Internal::IRPrinter.

Public Member Functions

 CodeGen_PyTorch (std::ostream &dest)
 
 ~CodeGen_PyTorch () override=default
 
void compile (const Module &module)
 Emit the PyTorch C++ wrapper for the Halide pipeline. More...
 
- Public Member Functions inherited from Halide::Internal::IRPrinter
 IRPrinter (std::ostream &)
 Construct an IRPrinter pointed at a given output stream (e.g. More...
 
void print (const Expr &)
 emit an expression on the output stream More...
 
void print_no_parens (const Expr &)
 Emit an expression on the output stream without enclosing parens. More...
 
void print (const Stmt &)
 emit a statement on the output stream More...
 
void print_list (const std::vector< Expr > &exprs)
 emit a comma delimited list of exprs, without any leading or trailing punctuation. More...
 
- Public Member Functions inherited from Halide::Internal::IRVisitor
 IRVisitor ()
 
virtual ~IRVisitor ()
 

Static Public Member Functions

static void test ()
 
- Static Public Member Functions inherited from Halide::Internal::IRPrinter
static void test ()
 

Additional Inherited Members

- Protected Member Functions inherited from Halide::Internal::IRPrinter
Indentation get_indent () const
 
void open ()
 Either emits "(" or "", depending on the value of implicit_parens. More...
 
void close ()
 Either emits ")" or "", depending on the value of implicit_parens. More...
 
void print_lets (const Let *let)
 A helper for printing a chain of lets with line breaks. More...
 
void visit (const IntImm *) override
 
void visit (const UIntImm *) override
 
void visit (const FloatImm *) override
 
void visit (const StringImm *) override
 
void visit (const Cast *) override
 
void visit (const Variable *) override
 
void visit (const Add *) override
 
void visit (const Sub *) override
 
void visit (const Mul *) override
 
void visit (const Div *) override
 
void visit (const Mod *) override
 
void visit (const Min *) override
 
void visit (const Max *) override
 
void visit (const EQ *) override
 
void visit (const NE *) override
 
void visit (const LT *) override
 
void visit (const LE *) override
 
void visit (const GT *) override
 
void visit (const GE *) override
 
void visit (const And *) override
 
void visit (const Or *) override
 
void visit (const Not *) override
 
void visit (const Select *) override
 
void visit (const Load *) override
 
void visit (const Ramp *) override
 
void visit (const Broadcast *) override
 
void visit (const Call *) override
 
void visit (const Let *) override
 
void visit (const LetStmt *) override
 
void visit (const AssertStmt *) override
 
void visit (const ProducerConsumer *) override
 
void visit (const For *) override
 
void visit (const Acquire *) override
 
void visit (const Store *) override
 
void visit (const Provide *) override
 
void visit (const Allocate *) override
 
void visit (const Free *) override
 
void visit (const Realize *) override
 
void visit (const Block *) override
 
void visit (const Fork *) override
 
void visit (const IfThenElse *) override
 
void visit (const Evaluate *) override
 
void visit (const Shuffle *) override
 
void visit (const VectorReduce *) override
 
void visit (const Prefetch *) override
 
void visit (const Atomic *) override
 
- Protected Attributes inherited from Halide::Internal::IRPrinter
std::ostream & stream
 The stream on which we're outputting. More...
 
int indent = 0
 The current indentation level, useful for pretty-printing statements. More...
 
bool implicit_parens = false
 Certain expressions do not need parens around them, e.g. More...
 
Scope known_type
 The symbols whose types can be inferred from values printed already. More...
 

Detailed Description

This class emits C++ code to wrap a Halide pipeline so that it can be used as a C++ extension operator in PyTorch.

Definition at line 25 of file CodeGen_PyTorch.h.

Constructor & Destructor Documentation

◆ CodeGen_PyTorch()

Halide::Internal::CodeGen_PyTorch::CodeGen_PyTorch ( std::ostream &  dest)

◆ ~CodeGen_PyTorch()

Halide::Internal::CodeGen_PyTorch::~CodeGen_PyTorch ( )
overridedefault

Member Function Documentation

◆ compile()

void Halide::Internal::CodeGen_PyTorch::compile ( const Module module)

Emit the PyTorch C++ wrapper for the Halide pipeline.

◆ test()

static void Halide::Internal::CodeGen_PyTorch::test ( )
static

The documentation for this class was generated from the following file: