tvm
Loading...
Searching...
No Matches
attr.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
28#ifndef TVM_TIRX_OP_ATTR_H_
29#define TVM_TIRX_OP_ATTR_H_
30
31#include <tvm/ffi/extra/structural_mutate.h>
32#include <tvm/ffi/function.h>
33#include <tvm/ffi/reflection/native_function.h>
34#include <tvm/ffi/string.h>
35#include <tvm/ir/expr.h>
36#include <tvm/ir/stmt.h>
37#include <tvm/target/target.h>
38
39namespace tvm {
40namespace tirx {
41
42class StructuralVisitorWithConstraintContextObj;
43class StructuralMutatorWithConstraintContextObj;
44
48using FLowerIntrinsic = ffi::TypedFunction<PrimExpr(PrimExpr, Target)>;
49
53using FLegalize = ffi::TypedFunction<PrimExpr(PrimExpr, Target)>;
54
55namespace op_attr {
59inline constexpr ffi::reflection::AttrKey<ffi::String> kGlobalSymbol{"TGlobalSymbol"};
63inline constexpr ffi::reflection::AttrKey<bool> kVectorizable{"TVectorizable"};
70inline constexpr ffi::reflection::AttrKey<ffi::reflection::NativeFunctionView<ffi::Optional<
71 ffi::VisitInterrupt>(StructuralVisitorWithConstraintContextObj*, ffi::AnyView value)>>
72 kStructuralVisitWithConstraintContext{"__s_visit_with_constraint_context__"};
78inline constexpr ffi::reflection::AttrKey<ffi::reflection::NativeFunctionView<
79 ffi::UnchangedOr<ffi::Any>(StructuralMutatorWithConstraintContextObj*, ffi::AnyView value)>>
80 kStructuralMutateWithConstraintContext{"__s_mutate_with_constraint_context__"};
86inline constexpr ffi::reflection::AttrKey<ffi::reflection::NativeFunctionView<
87 ffi::UnchangedOr<ffi::Any>(StructuralMutatorWithConstraintContextObj*, ffi::AnyView value)>>
89 "__s_maybe_inplace_mutate_with_constraint_context__"};
90} // namespace op_attr
91
92} // namespace tirx
93} // namespace tvm
94#endif // TVM_TIRX_OP_ATTR_H_
Base expr nodes in TVM.
Statements shared across IR dialects.
Typed reference/view over any Expr whose ExprObj::ty is PrimType.
Definition expr.h:187
Managed reference class to TargetObj.
Definition target.h:155
Mutates values using their structural mutation behavior while maintaining the constraint context rele...
Definition structural_mutate_with_constraint_context.h:40
Visits values using their structural visit behavior while maintaining the constraint context relevant...
Definition structural_visit_with_constraint_context.h:38
constexpr ffi::reflection::AttrKey< ffi::reflection::NativeFunctionView< ffi::Optional< ffi::VisitInterrupt >(StructuralVisitorWithConstraintContextObj *, ffi::AnyView value)> > kStructuralVisitWithConstraintContext
Constraint-aware descent for a Call or RegionStmt using this Op. Receives the complete containing nod...
Definition attr.h:72
constexpr ffi::reflection::AttrKey< ffi::reflection::NativeFunctionView< ffi::UnchangedOr< ffi::Any >(StructuralMutatorWithConstraintContextObj *, ffi::AnyView value)> > kStructuralMaybeInplaceMutateWithConstraintContext
Mutation when the engine permits in-place updates of the containing node. Child mutation still checks...
Definition attr.h:88
constexpr ffi::reflection::AttrKey< ffi::reflection::NativeFunctionView< ffi::UnchangedOr< ffi::Any >(StructuralMutatorWithConstraintContextObj *, ffi::AnyView value)> > kStructuralMutateWithConstraintContext
Copying mutation of a complete Call or RegionStmt using this Op. The hook owns descent,...
Definition attr.h:80
constexpr ffi::reflection::AttrKey< bool > kVectorizable
Whether the op is overloaded for vector form.
Definition attr.h:63
constexpr ffi::reflection::AttrKey< ffi::String > kGlobalSymbol
Global symbol of the op after lowering.
Definition attr.h:59
ffi::TypedFunction< PrimExpr(PrimExpr, Target)> FLegalize
The legalization function for given tirx op, receiving its compilation target.
Definition attr.h:53
ffi::TypedFunction< PrimExpr(PrimExpr, Target)> FLowerIntrinsic
The intrinsic lowering function for given op, receiving its compilation target.
Definition attr.h:48
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41
Compilation target object.