#include <tvm/s_tir/sblock_scope.h>
#include <tvm/tirx/stmt.h>
#include <unordered_map>
Go to the source code of this file.
|
| | tvm |
| | An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
|
| |
| | tvm::tirx |
| |
|
| #define | TVM_SREF_AS_OR_ERR(Result, SRef, Type) |
| | A helper macro to convert an sref to the statement it points to, then check if the downcasting succeeded. More...
|
| |
| #define | TVM_SREF_TO_SBLOCK(SRef) |
| | A helper macro to convert an sref to the block it points to,. More...
|
| |
| #define | TVM_SREF_TO_FOR(SRef) |
| | A helper macro to convert an sref to the for-loop it points to. More...
|
| |
| #define | TVM_TYPE_AS_OR_ERR(Result, From, Type) |
| | Downcast a TVM ffi::ObjectRef to its corresponding container using ffi::ObjectRef::as<Type>, then check if the downcasting succeeded. More...
|
| |
| #define | TVM_TYPE_AS(From, Type) |
| | Downcast a TVM ffi::ObjectRef to its corresponding container using ffi::ObjectRef::as<Type>, throwing an internal error if downcast fails. More...
|
| |
◆ TVM_SREF_AS_OR_ERR
| #define TVM_SREF_AS_OR_ERR |
( |
|
Result, |
|
|
|
SRef, |
|
|
|
Type |
|
) |
| |
Value: SRef->StmtAs<Type>(); \
TVM_FFI_CHECK(Result, TypeError)
A helper macro to convert an sref to the statement it points to, then check if the downcasting succeeded.
- Parameters
-
| Result | The result variable, used for checking |
| SRef | The SRef to be cast |
| Type | The type to be cast to, can be SBlock or For |
◆ TVM_SREF_TO_FOR
| #define TVM_SREF_TO_FOR |
( |
|
SRef | ) |
|
Value: [&]() { \
<< "Expects StmtSRef `" << #SRef << "` points to `Loop`, but gets: " \
<< ((SRef)->stmt ? (SRef)->stmt->GetTypeKey() : "None"); \
return result; \
}()
A for loop, with possible type annotations.
Definition: stmt.h:588
#define TVM_SREF_AS_OR_ERR(Result, SRef, Type)
A helper macro to convert an sref to the statement it points to, then check if the downcasting succee...
Definition: utils.h:37
A helper macro to convert an sref to the for-loop it points to.
Throws an internal error if downcasting fails. The variable name in the parent scope is used for the error message.
- Parameters
-
◆ TVM_SREF_TO_SBLOCK
| #define TVM_SREF_TO_SBLOCK |
( |
|
SRef | ) |
|
Value: [&]() { \
<< "Expects StmtSRef `" << #SRef << "` points to `Block`, but gets: " \
<< ((SRef)->stmt ? (SRef)->stmt->GetTypeKey() : "None"); \
return result; \
}()
A block is a basic schedule unit in TIR.
Definition: stmt.h:852
A helper macro to convert an sref to the block it points to,.
Throws an internal error if downcasting fails. The variable name in the parent scope is used for the error message.
- Parameters
-
◆ TVM_TYPE_AS
| #define TVM_TYPE_AS |
( |
|
From, |
|
|
|
Type |
|
) |
| |
Value: [&]() { \
<< "Expects `" << #From << "` to have type `" << Type::_type_key \
<< "`, but gets: " << ((From).GetTypeKey()); \
return result; \
}()
#define TVM_TYPE_AS_OR_ERR(Result, From, Type)
Downcast a TVM ffi::ObjectRef to its corresponding container using ffi::ObjectRef::as<Type>,...
Definition: utils.h:80
Downcast a TVM ffi::ObjectRef to its corresponding container using ffi::ObjectRef::as<Type>, throwing an internal error if downcast fails.
- Parameters
-
| From | The ffi::ObjectRef to be downcast |
| Type | The type to be downcast to |
◆ TVM_TYPE_AS_OR_ERR
| #define TVM_TYPE_AS_OR_ERR |
( |
|
Result, |
|
|
|
From, |
|
|
|
Type |
|
) |
| |
Value: From.as<Type>(); \
TVM_FFI_CHECK(Result, TypeError)
Downcast a TVM ffi::ObjectRef to its corresponding container using ffi::ObjectRef::as<Type>, then check if the downcasting succeeded.
- Parameters
-
| Result | The result variable, used for checking |
| From | The ffi::ObjectRef to be downcast |
| Type | The type to be downcast to |