1 #ifndef HALIDE_MODULE_H
2 #define HALIDE_MODULE_H
100 std::vector<LoweredArgument>
args;
113 const std::vector<LoweredArgument> &
args,
118 const std::vector<Argument> &
args,
127 struct ModuleContents;
128 class CompilerLogger;
131 struct AutoSchedulerResults;
146 const std::string &
name()
const;
157 const std::vector<Buffer<void>> &
buffers()
const;
158 const std::vector<Internal::LoweredFunc> &
functions()
const;
178 void compile(
const std::map<Output, std::string> &output_files)
const;
224 const std::map<Output, std::string> &output_files,
225 const std::vector<Target> &targets,
226 const std::vector<std::string> &suffixes,
Defines a type used for expressing the type signature of a generated halide pipeline.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the internal representation of a halide function and related classes.
Routines for statically determining what expressions are divisible by.
std::map< std::string, std::string > get_metadata_name_map() const
Retrieve the metadata name map.
void append(const Buffer< void > &buffer)
Add a declaration to this module.
const AutoSchedulerResults * get_auto_scheduler_results() const
If this Module had an auto-generated schedule, return a read-only pointer to the AutoSchedulerResults...
const std::vector< Internal::LoweredFunc > & functions() const
Module(const std::string &name, const Target &target)
const std::vector< ExternalCode > & external_code() const
const std::vector< Buffer< void > > & buffers() const
The declarations contained in this module.
std::vector< Internal::LoweredFunc > & functions()
Buffer< uint8_t > compile_to_buffer() const
Compile a halide Module to in-memory object code.
void set_auto_scheduler_results(const AutoSchedulerResults &results)
Set the AutoSchedulerResults for the Module.
Module resolve_submodules() const
Return a new module with all submodules compiled to buffers on on the result Module.
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'.
const std::string & name() const
The name of this module.
const std::vector< Module > & submodules() const
const Target & target() const
Get the target this module has been lowered for.
void compile(const std::map< Output, std::string > &output_files) const
Compile a halide Module to variety of outputs, depending on the fields set in output_files.
Internal::LoweredFunc get_function_by_name(const std::string &name) const
Return the function with the given name.
void append(const ExternalCode &external_code)
void append(const Module &module)
void set_any_strict_float(bool any_strict_float)
Set whether this module uses strict floating-point directives anywhere.
bool any_strict_float() const
Return whether this module uses strict floating-point anywhere.
void append(const Internal::LoweredFunc &function)
std::map< Output, const OutputInfo > get_output_info(const Target &target)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
LinkageType
Type of linkage a function in a lowered Halide module can have.
@ ExternalPlusMetadata
Visible externally. Argument metadata and an argv wrapper are also generated.
@ Internal
Not visible externally, similar to 'static' linkage in C.
@ External
Visible externally.
std::function< std::unique_ptr< Internal::CompilerLogger >(const std::string &fn_name, const Target &target)> CompilerLoggerFactory
void compile_multitarget(const std::string &fn_name, const std::map< Output, std::string > &output_files, const std::vector< Target > &targets, const std::vector< std::string > &suffixes, const ModuleFactory &module_factory, const CompilerLoggerFactory &compiler_logger_factory=nullptr)
NameMangling
An enum to specify calling convention for extern stages.
@ Default
Match whatever is specified in the Target.
void compile_standalone_runtime(const std::string &object_filename, const Target &t)
Create an object file containing the Halide runtime for a given target.
Module link_modules(const std::string &name, const std::vector< Module > &modules)
Link a set of modules together into one module.
Output
Enums specifying various kinds of outputs that can be produced from a Halide Pipeline.
std::function< Module(const std::string &fn_name, const Target &target)> ModuleFactory
unsigned __INT8_TYPE__ uint8_t
A struct representing an argument to a halide-generated function.
Kind
An argument is either a primitive type (for parameters), or a buffer pointer.
ArgumentEstimates argument_estimates
Definition of an argument to a LoweredFunc.
ModulusRemainder alignment
For scalar arguments, the modulus and remainder of this argument.
LoweredArgument(const Argument &arg)
LoweredArgument(const std::string &_name, Kind _kind, const Type &_type, uint8_t _dimensions, const ArgumentEstimates &argument_estimates)
LoweredArgument()=default
Definition of a lowered function.
LoweredFunc(const std::string &name, const std::vector< LoweredArgument > &args, Stmt body, LinkageType linkage, NameMangling mangling=NameMangling::Default)
std::vector< LoweredArgument > args
Arguments referred to in the body of this function.
LoweredFunc(const std::string &name, const std::vector< Argument > &args, Stmt body, LinkageType linkage, NameMangling mangling=NameMangling::Default)
NameMangling name_mangling
The name-mangling choice for the function.
LinkageType linkage
The linkage of this function.
Stmt body
Body of this function.
The result of modulus_remainder analysis.
A reference-counted handle to a statement node.
A struct representing a target machine and os to generate code for.
Types in the halide type system.