tvm
Loading...
Searching...
No Matches
exec_scope.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 */
20#ifndef TVM_TIRX_TILE_EXEC_SCOPE_H_
21#define TVM_TIRX_TILE_EXEC_SCOPE_H_
22#include <tvm/ffi/object.h>
23#include <tvm/ir/expr.h>
24
25namespace tvm::tirx {
26
28TVM_TIRX_DLL void RegisterExecScope(const ffi::String& backend, const ffi::String& name, int rank);
29
30class ExecScopeNode : public ffi::Object {
31 public:
32 ffi::String backend;
33 ffi::String scope_name;
34 ffi::String name() const { return scope_name; }
35 int rank() const;
36
37 static void RegisterReflection() {
38 namespace refl = tvm::ffi::reflection;
39 refl::ObjectDef<ExecScopeNode>()
40 .def_ro("backend", &ExecScopeNode::backend)
41 .def_ro("name", &ExecScopeNode::scope_name);
42 }
43 static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
44 TVM_FFI_DECLARE_OBJECT_INFO("tirx.ExecScope", ExecScopeNode, ffi::Object);
45};
46
47class ExecScope : public ffi::ObjectRef {
48 public:
49 TVM_TIRX_DLL ExecScope(ffi::String backend, ffi::String name);
51};
52
55
56} // namespace tvm::tirx
57#endif // TVM_TIRX_TILE_EXEC_SCOPE_H_
Definition exec_scope.h:30
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition exec_scope.h:43
static void RegisterReflection()
Definition exec_scope.h:37
ffi::String scope_name
Definition exec_scope.h:33
ffi::String backend
Definition exec_scope.h:32
TVM_FFI_DECLARE_OBJECT_INFO("tirx.ExecScope", ExecScopeNode, ffi::Object)
ffi::String name() const
Definition exec_scope.h:34
Definition exec_scope.h:47
TVM_TIRX_DLL ExecScope(ffi::String backend, ffi::String name)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ExecScope, ffi::ObjectRef, ExecScopeNode)
Base expr nodes in TVM.
Backend-defined execution hierarchy nodes shared by layouts and tile calls.
Definition axis_group_graph.h:41
TVM_TIRX_DLL void RegisterExecScope(const ffi::String &backend, const ffi::String &name, int rank)
Register a backend's execution hierarchy. Smaller rank means wider scope.
TVM_TIRX_DLL bool ScopeHigher(const ExecScope &a, const ExecScope &b)
Compare scopes within the same backend's hierarchy.
#define TVM_TIRX_DLL
Definition base.h:83