#include <tvm/tir/block_scope.h>
#include <tvm/tir/stmt.h>
#include <unordered_map>
Go to the source code of this file.
|
| tvm |
| Performance counters for profiling via the PAPI library.
|
|
| tvm::tir |
|
|
#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_BLOCK(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 ObjectRef to its corresponding container using ObjectRef::as<Type> , then check if the downcasting succeeded. More...
|
|
#define | TVM_TYPE_AS(From, Type) |
| Downcast a TVM ObjectRef to its corresponding container using 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>(); \
ICHECK(Result)
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 Block or For |
◆ TVM_SREF_TO_BLOCK
#define TVM_SREF_TO_BLOCK |
( |
|
SRef | ) |
|
Value: [&]() { \
<< "TypeError: 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:1258
#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 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_SREF_TO_FOR
#define TVM_SREF_TO_FOR |
( |
|
SRef | ) |
|
Value: [&]() { \
<< "TypeError: 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:967
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_TYPE_AS
#define TVM_TYPE_AS |
( |
|
From, |
|
|
|
Type |
|
) |
| |
Value: [&]() { \
<< "TypeError: Expects `" << #From << "` to have type `" << Type::_type_key \
<< "`, but gets: " << ((From).defined() ? (From)->GetTypeKey() : "None"); \
return result; \
}()
#define TVM_TYPE_AS_OR_ERR(Result, From, Type)
Downcast a TVM ObjectRef to its corresponding container using ObjectRef::as<Type>,...
Definition: utils.h:80
Downcast a TVM ObjectRef to its corresponding container using ObjectRef::as<Type>
, throwing an internal error if downcast fails.
- Parameters
-
From | The 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>(); \
ICHECK(Result)
Downcast a TVM ObjectRef to its corresponding container using ObjectRef::as<Type>
, then check if the downcasting succeeded.
- Parameters
-
Result | The result variable, used for checking |
From | The ObjectRef to be downcast |
Type | The type to be downcast to |