Go to the documentation of this file. 1 #ifndef HALIDE_MODULE_H
2 #define HALIDE_MODULE_H
21 template<
typename T,
int Dims>
101 std::vector<LoweredArgument>
args;
114 const std::vector<LoweredArgument> &
args,
119 const std::vector<Argument> &
args,
128 struct ModuleContents;
129 class CompilerLogger;
132 struct AutoSchedulerResults;
149 const std::string &
name()
const;
160 const std::vector<Buffer<void>> &
buffers()
const;
161 const std::vector<Internal::LoweredFunc> &
functions()
const;
162 std::vector<Internal::LoweredFunc> &
functions();
163 const std::vector<Module> &
submodules()
const;
179 void compile(
const std::map<OutputFileType, std::string> &output_files)
const;
225 const std::map<OutputFileType, std::string> &output_files,
226 const std::vector<Target> &targets,
227 const std::vector<std::string> &suffixes,
ModulusRemainder alignment
For scalar arguments, the modulus and remainder of this argument.
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'.
unsigned __INT8_TYPE__ uint8_t
Buffer< uint8_t > compile_to_buffer() const
Compile a halide Module to in-memory object code.
NameMangling name_mangling
The name-mangling choice for the function.
const std::vector< Module > & submodules() const
A struct representing an argument to a halide-generated function.
const Target & target() const
Get the target this module has been lowered for.
Module resolve_submodules() const
Return a new module with all submodules compiled to buffers on on the result Module.
@ Default
Match whatever is specified in the Target.
bool any_strict_float() const
Return whether this module uses strict floating-point anywhere.
A reference-counted handle to a statement node.
LinkageType linkage
The linkage of this function.
Types in the halide type system.
LoweredFunc(const std::string &name, const std::vector< LoweredArgument > &args, Stmt body, LinkageType linkage, NameMangling mangling=NameMangling::Default)
const std::string & name() const
The name of this module.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
void set_any_strict_float(bool any_strict_float)
Set whether this module uses strict floating-point directives anywhere.
MetadataNameMap get_metadata_name_map() const
Retrieve the metadata name map.
void append(const Buffer< void > &buffer)
Add a declaration to this module.
@ Internal
Not visible externally, similar to 'static' linkage in C.
OutputFileType
Enums specifying various kinds of outputs that can be produced from a Halide Pipeline.
LoweredArgument()=default
LinkageType
Type of linkage a function in a lowered Halide module can have.
Kind
An argument is either a primitive type (for parameters), or a buffer pointer.
LoweredArgument(const Argument &arg)
const std::vector< Internal::LoweredFunc > & functions() const
std::map< std::string, std::string > MetadataNameMap
Module link_modules(const std::string &name, const std::vector< Module > &modules)
Link a set of modules together into one module.
Stmt body
Body of this function.
void set_auto_scheduler_results(const AutoSchedulerResults &results)
Set the AutoSchedulerResults for the Module.
Definition of a lowered function.
NameMangling
An enum to specify calling convention for extern stages.
const AutoSchedulerResults * get_auto_scheduler_results() const
If this Module had an auto-generated schedule, return a read-only pointer to the AutoSchedulerResults...
Module(const std::string &name, const Target &target, const MetadataNameMap &metadata_name_map={})
Internal::LoweredFunc get_function_by_name(const std::string &name) const
Return the function with the given name.
void compile_multitarget(const std::string &fn_name, const std::map< OutputFileType, 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)
const std::vector< Buffer< void > > & buffers() const
The declarations contained in this module.
void compile_standalone_runtime(const std::string &object_filename, const Target &t)
Create an object file containing the Halide runtime for a given target.
std::vector< LoweredArgument > args
Arguments referred to in the body of this function.
@ External
Visible externally.
std::function< Module(const std::string &fn_name, const Target &target)> ModuleFactory
std::map< OutputFileType, const OutputInfo > get_output_info(const Target &target)
LoweredArgument(const std::string &_name, Kind _kind, const Type &_type, uint8_t _dimensions, const ArgumentEstimates &argument_estimates)
The result of modulus_remainder analysis.
Definition of an argument to a LoweredFunc.
A struct representing a target machine and os to generate code for.
void compile(const std::map< OutputFileType, std::string > &output_files) const
Compile a halide Module to variety of outputs, depending on the fields set in output_files.
@ ExternalPlusMetadata
Visible externally. Argument metadata and an argv wrapper are also generated.
std::function< std::unique_ptr< Internal::CompilerLogger >(const std::string &fn_name, const Target &target)> CompilerLoggerFactory
ArgumentEstimates argument_estimates
@ ExternalPlusArgv
Visible externally. Argv wrapper is generated but not argument metadata.