20 #ifndef TVM_META_SCHEDULE_POSTPROC_H_
21 #define TVM_META_SCHEDULE_POSTPROC_H_
23 #include <tvm/ffi/function.h>
24 #include <tvm/ffi/reflection/registry.h>
29 namespace meta_schedule {
66 static constexpr
const char*
_type_key =
"meta_schedule.Postproc";
206 static constexpr const
char*
_type_key = "meta_schedule.PyPostproc";
Rules to apply a postprocessor to a schedule.
Definition: postproc.h:37
virtual void InitializeWithTuneContext(const TuneContext &context)=0
Initialize the design space generator with tuning context.
virtual Postproc Clone() const =0
Clone the postprocessor.
virtual ~PostprocNode()=default
Virtual destructor.
virtual bool Apply(const tir::Schedule &sch)=0
Apply a postprocessor to the given schedule.
TVM_DECLARE_BASE_OBJECT_INFO(PostprocNode, Object)
static void RegisterReflection()
Definition: postproc.h:42
static constexpr const char * _type_key
Definition: postproc.h:66
Managed reference to PostprocNode.
Definition: postproc.h:74
static Postproc DisallowAsyncStridedMemCopy()
Create a postprocessor that checks if all async mem copies are not strided.
static Postproc RewriteReductionBlock()
Create a postprocessor that rewrites reduction block by moving the init block out.
ffi::TypedFunction< String()> FAsString
Get the postprocessor function as string with name.
Definition: postproc.h:96
static Postproc RewriteUnboundBlock(int max_threadblocks)
Create a postprocessor that adds thread binding to unbound blocks.
ffi::TypedFunction< void(const TuneContext &)> FInitializeWithTuneContext
The function type of InitializeWithTuneContext method.
Definition: postproc.h:80
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(Postproc, ObjectRef, PostprocNode)
static Array< Postproc, void > DefaultCUDATensorCore()
Create default postprocessors for CUDA with TensorCore.
static Array< Postproc, void > DefaultCPUTensorization()
Create default postprocessors for x86 (AVX512 and VNNI)
static Array< Postproc, void > DefaultLLVM()
Create default postprocessors for LLVM.
ffi::TypedFunction< bool(const tir::Schedule &)> FApply
Apply a postprocessor to the given schedule.
Definition: postproc.h:86
static Postproc VerifyGPUCode()
Creates a postprocessor that verifies if the GPU code is correct.
static Array< Postproc, void > DefaultCUDA()
Create default postprocessors for CUDA.
static Postproc RewriteLayout()
Creates a postprocessor that rewrites the layout of input tensor.
static Postproc RewriteCooperativeFetch()
Create a postprocessor that rewrites the cooperative fetch annotation to actual vectorized cooperativ...
static Postproc RewriteTensorize(bool vectorize_init_loop=false)
Create a postprocessor that applies tensorization to annotated blocks.
static Postproc VerifyVTCMLimit()
Verifies that the VTCM usage of a given schedule is within the provided limit.
static Postproc RewriteParallelVectorizeUnroll()
Creates a postprocessor that applies parallelization, vectorization and auto unrolling according to t...
ffi::TypedFunction< Postproc()> FClone
Clone the postprocessor.
Definition: postproc.h:91
static Postproc PyPostproc(FInitializeWithTuneContext f_initialize_with_tune_context, FApply f_apply, FClone f_clone, FAsString f_as_string)
Create a postprocessor with customized methods on the python-side.
static Array< Postproc, void > DefaultHexagon()
Create default postprocessors for Hexagon.
static Postproc DisallowDynamicLoop()
Create a postprocessor that checks if all loops are static.
The postprocessor with customized methods on the python-side.
Definition: postproc.h:180
Postproc Clone() const final
Clone the postprocessor.
FAsString f_as_string
The packed function to the AsString function.
Definition: postproc.h:193
void InitializeWithTuneContext(const TuneContext &context) final
Initialize the design space generator with tuning context.
FApply f_apply
The packed function to the Apply function.
Definition: postproc.h:189
bool Apply(const tir::Schedule &sch) final
Apply a postprocessor to the given schedule.
static constexpr const char * _type_key
Definition: postproc.h:206
static void RegisterReflection()
Definition: postproc.h:195
FInitializeWithTuneContext f_initialize_with_tune_context
The packed function to the InitializeWithTuneContext function.
Definition: postproc.h:187
TVM_DECLARE_FINAL_OBJECT_INFO(PyPostprocNode, PostprocNode)
Postproc::FInitializeWithTuneContext FInitializeWithTuneContext
Definition: postproc.h:182
FClone f_clone
The packed function to the Clone function.
Definition: postproc.h:191
Postproc::FClone FClone
Definition: postproc.h:184
Postproc::FAsString FAsString
Definition: postproc.h:185
Postproc::FApply FApply
Definition: postproc.h:183
Managed reference to TuneContextNode.
Definition: tune_context.h:98
Managed reference to ScheduleNode.
Definition: schedule.h:880
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
A managed object in the TVM runtime.