Halide
Halide::Module Class Reference

A halide module. More...

#include <Module.h>

Public Member Functions

EXPORT Module (const std::string &name, const Target &target)
 
EXPORT const Targettarget () const
 Get the target this module has been lowered for. More...
 
EXPORT const std::string & name () const
 The name of this module. More...
 
EXPORT const std::string & auto_schedule () const
 If this Module had an auto-generated schedule, this is the C++ source for that schedule. More...
 
EXPORT Internal::LoweredFunc get_function_by_name (const std::string &name) const
 Return the function with the given name. More...
 
EXPORT void compile (const Outputs &output_files) const
 Compile a halide Module to variety of outputs, depending on the fields set in output_files. More...
 
EXPORT Buffer< uint8_tcompile_to_buffer () const
 Compile a halide Module to in-memory object code. More...
 
EXPORT Module resolve_submodules () const
 Return a new module with all submodules compiled to buffers on on the result Module. More...
 
EXPORT void remap_metadata_name (const std::string &from, const std::string &to) const
 When generating metadata from this module, remap any occurrences of 'from' into 'to'. More...
 
EXPORT std::map< std::string, std::string > get_metadata_name_map () const
 Retrieve the metadata name map. More...
 
EXPORT void set_auto_schedule (const std::string &auto_schedule)
 Set the auto_schedule text for the Module. More...
 
EXPORT const std::vector< Buffer<> > & buffers () const
 The declarations contained in this module. More...
 
EXPORT const std::vector< Internal::LoweredFunc > & functions () const
 The declarations contained in this module. More...
 
EXPORT std::vector< Internal::LoweredFunc > & functions ()
 The declarations contained in this module. More...
 
EXPORT const std::vector< Module > & submodules () const
 The declarations contained in this module. More...
 
EXPORT const std::vector< ExternalCode > & external_code () const
 The declarations contained in this module. More...
 
EXPORT void append (const Buffer<> &buffer)
 Add a declaration to this module. More...
 
EXPORT void append (const Internal::LoweredFunc &function)
 Add a declaration to this module. More...
 
EXPORT void append (const Module &module)
 Add a declaration to this module. More...
 
EXPORT void append (const ExternalCode &external_code)
 Add a declaration to this module. More...
 

Detailed Description

A halide module.

This represents IR containing lowered function definitions and buffers.

Definition at line 83 of file Module.h.

Constructor & Destructor Documentation

◆ Module()

EXPORT Halide::Module::Module ( const std::string &  name,
const Target target 
)

Member Function Documentation

◆ target()

EXPORT const Target& Halide::Module::target ( ) const

Get the target this module has been lowered for.

◆ name()

EXPORT const std::string& Halide::Module::name ( ) const

The name of this module.

This is used as the default filename for output operations.

◆ auto_schedule()

EXPORT const std::string& Halide::Module::auto_schedule ( ) const

If this Module had an auto-generated schedule, this is the C++ source for that schedule.

◆ buffers()

EXPORT const std::vector<Buffer<> >& Halide::Module::buffers ( ) const

The declarations contained in this module.

◆ functions() [1/2]

EXPORT const std::vector<Internal::LoweredFunc>& Halide::Module::functions ( ) const

The declarations contained in this module.

◆ functions() [2/2]

EXPORT std::vector<Internal::LoweredFunc>& Halide::Module::functions ( )

The declarations contained in this module.

◆ submodules()

EXPORT const std::vector<Module>& Halide::Module::submodules ( ) const

The declarations contained in this module.

◆ external_code()

EXPORT const std::vector<ExternalCode>& Halide::Module::external_code ( ) const

The declarations contained in this module.

◆ get_function_by_name()

EXPORT Internal::LoweredFunc Halide::Module::get_function_by_name ( const std::string &  name) const

Return the function with the given name.

If no such function exists in this module, assert.

◆ append() [1/4]

EXPORT void Halide::Module::append ( const Buffer<> &  buffer)

Add a declaration to this module.

◆ append() [2/4]

EXPORT void Halide::Module::append ( const Internal::LoweredFunc function)

Add a declaration to this module.

◆ append() [3/4]

EXPORT void Halide::Module::append ( const Module module)

Add a declaration to this module.

◆ append() [4/4]

EXPORT void Halide::Module::append ( const ExternalCode external_code)

Add a declaration to this module.

◆ compile()

EXPORT void Halide::Module::compile ( const Outputs output_files) const

Compile a halide Module to variety of outputs, depending on the fields set in output_files.

◆ compile_to_buffer()

EXPORT Buffer<uint8_t> Halide::Module::compile_to_buffer ( ) const

Compile a halide Module to in-memory object code.

Currently only supports LLVM based compilation, but should be extended to handle source code backends.

◆ resolve_submodules()

EXPORT Module Halide::Module::resolve_submodules ( ) const

Return a new module with all submodules compiled to buffers on on the result Module.

◆ remap_metadata_name()

EXPORT void Halide::Module::remap_metadata_name ( const std::string &  from,
const std::string &  to 
) const

When generating metadata from this module, remap any occurrences of 'from' into 'to'.

◆ get_metadata_name_map()

EXPORT std::map<std::string, std::string> Halide::Module::get_metadata_name_map ( ) const

Retrieve the metadata name map.

◆ set_auto_schedule()

EXPORT void Halide::Module::set_auto_schedule ( const std::string &  auto_schedule)

Set the auto_schedule text for the Module.

It is an error to call this multiple times for a given Module.


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