Halide
Halide::GeneratorContext Class Reference

GeneratorContext is a class that is used when using Generators (or Stubs) directly; it is used to allow the outer context (typically, either a Generator or "top-level" code) to specify certain information to the inner context to ensure that inner and outer Generators are compiled in a compatible way. More...

#include <Generator.h>

Public Member Functions

 GeneratorContext (const Target &t)
 
 GeneratorContext (const Target &t, const AutoschedulerParams &autoscheduler_params)
 
 GeneratorContext ()=default
 
 GeneratorContext (const GeneratorContext &)=default
 
GeneratorContextoperator= (const GeneratorContext &)=default
 
 GeneratorContext (GeneratorContext &&)=default
 
GeneratorContextoperator= (GeneratorContext &&)=default
 
const Targettarget () const
 
const AutoschedulerParamsautoscheduler_params () const
 
GeneratorContext with_target (const Target &t) const
 
template<typename T >
std::unique_ptr< T > create () const
 
template<typename T , typename... Args>
std::unique_ptr< T > apply (const Args &...args) const
 

Detailed Description

GeneratorContext is a class that is used when using Generators (or Stubs) directly; it is used to allow the outer context (typically, either a Generator or "top-level" code) to specify certain information to the inner context to ensure that inner and outer Generators are compiled in a compatible way.

If you are using this at "top level" (e.g. with the JIT), you can construct a GeneratorContext with a Target:

auto my_stub = MyStub(
// inputs
{ ... },
// generator params
{ ... }
);

Note that all Generators embed a GeneratorContext, so if you are using a Stub from within a Generator, you can just pass 'context()' for the GeneratorContext:

struct SomeGen : Generator<SomeGen> {
void generate() {
...
auto my_stub = MyStub(
context(), // GeneratorContext
// inputs
{ ... },
// generator params
{ ... }
);
...
}
};

Definition at line 2998 of file Generator.h.

Constructor & Destructor Documentation

◆ GeneratorContext() [1/5]

Halide::GeneratorContext::GeneratorContext ( const Target t)
explicit

◆ GeneratorContext() [2/5]

Halide::GeneratorContext::GeneratorContext ( const Target t,
const AutoschedulerParams autoscheduler_params 
)
explicit

◆ GeneratorContext() [3/5]

Halide::GeneratorContext::GeneratorContext ( )
default

◆ GeneratorContext() [4/5]

Halide::GeneratorContext::GeneratorContext ( const GeneratorContext )
default

◆ GeneratorContext() [5/5]

Halide::GeneratorContext::GeneratorContext ( GeneratorContext &&  )
default

Member Function Documentation

◆ operator=() [1/2]

GeneratorContext& Halide::GeneratorContext::operator= ( const GeneratorContext )
default

◆ operator=() [2/2]

GeneratorContext& Halide::GeneratorContext::operator= ( GeneratorContext &&  )
default

◆ target()

const Target& Halide::GeneratorContext::target ( ) const
inline

Definition at line 3012 of file Generator.h.

◆ autoscheduler_params()

const AutoschedulerParams& Halide::GeneratorContext::autoscheduler_params ( ) const
inline

Definition at line 3015 of file Generator.h.

◆ with_target()

GeneratorContext Halide::GeneratorContext::with_target ( const Target t) const

◆ create()

template<typename T >
std::unique_ptr<T> Halide::GeneratorContext::create ( ) const
inline

Definition at line 3025 of file Generator.h.

◆ apply()

template<typename T , typename... Args>
std::unique_ptr<T> Halide::GeneratorContext::apply ( const Args &...  args) const
inline

Definition at line 3029 of file Generator.h.


The documentation for this class was generated from the following file:
Halide::GeneratorContext::GeneratorContext
GeneratorContext()=default
Halide::get_target_from_environment
Target get_target_from_environment()
Return the target that Halide will use.