21template<
typename T,
int Dims>
105 std::vector<LoweredArgument>
args;
118 const std::vector<LoweredArgument> &
args,
123 const std::vector<Argument> &
args,
132struct ModuleContents;
136struct AutoSchedulerResults;
153 const std::string &
name()
const;
164 const std::vector<Buffer<void>> &
buffers()
const;
165 const std::vector<Internal::LoweredFunc> &
functions()
const;
194 void compile(
const std::map<OutputFileType, std::string> &output_files)
const;
246 const std::map<OutputFileType, std::string> &output_files,
247 const std::vector<Target> &targets,
248 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.
void append(const Buffer< void > &buffer)
Add a declaration to this module.
MetadataNameMap get_metadata_name_map() const
Retrieve the metadata name map.
Buffer get_cuda_ptx_assembly_buffer() const
Tries to locate the offloaded CUDA PTX assembly contained in this Module.
Buffer get_device_code_buffer() const
Tries to locate the offloaded (GPU) Device assembly contained in this Module.
void set_conceptual_code_stmt(const Internal::Stmt &stmt)
Remember the Stmt during lowing before device-specific offloading.
const std::string & name() const
The name of this module.
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 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< Buffer< void > > & buffers() const
The declarations contained in this module.
const std::vector< Internal::LoweredFunc > & functions() const
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.
Module(const std::string &name, const Target &target, const MetadataNameMap &metadata_name_map={})
const Target & target() const
Get the target this module has been lowered for.
Internal::LoweredFunc get_function_by_name(const std::string &name) const
Return the function with the given name.
const std::vector< Module > & submodules() const
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)
const Internal::Stmt & get_conceptual_stmt() const
Get the remembered conceptual Stmt, remembered before device-specific offloading.
std::vector< Internal::LoweredFunc > & functions()
std::map< OutputFileType, const OutputInfo > get_output_info(const Target &target)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
std::function< std::unique_ptr< Internal::CompilerLogger >(const std::string &fn_name, const Target &target)> CompilerLoggerFactory
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.
@ ExternalPlusArgv
Visible externally. Argv wrapper is generated but not argument metadata.
@ Internal
Not visible externally, similar to 'static' linkage in C.
@ External
Visible externally.
std::function< Module(const std::string &fn_name, const Target &target)> ModuleFactory
OutputFileType
Enums specifying various kinds of outputs that can be produced from a Halide Pipeline.
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.
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)
Module link_modules(const std::string &name, const std::vector< Module > &modules)
Link a set of modules together into one module.
std::map< std::string, std::string > MetadataNameMap
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
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
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.