23#ifndef TVM_TIRX_TILE_THREAD_SCOPE_H_
24#define TVM_TIRX_TILE_THREAD_SCOPE_H_
25#include <tvm/ffi/enum.h>
26#include <tvm/ffi/reflection/enum_def.h>
33namespace thread_scope_attr {
35inline constexpr ffi::reflection::AttrKey<ffi::String>
kBackend{
"backend"};
37inline constexpr ffi::reflection::AttrKey<int64_t>
kRank{
"rank"};
42 const ffi::String&
name()
const {
return _str_index; }
59 const ffi::String&
name()
const {
return get()->name(); }
69 return os << scope.
name();
76inline constexpr bool use_default_type_traits_v<tirx::ThreadScope> =
false;
78struct TypeTraits<tirx::ThreadScope>
79 :
public ObjectRefWithFallbackTraitsBase<tirx::ThreadScope, ffi::String> {
81 return tirx::ThreadScope::Get(name);
#define TVM_TIRX_DLL
Definition base.h:55
Definition thread_scope.h:40
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.ThreadScope", ThreadScopeObj, ffi::EnumObj)
const ffi::String & name() const
Definition thread_scope.h:42
TVM_TIRX_DLL ffi::String local_name() const
TVM_TIRX_DLL ffi::String backend() const
TVM_TIRX_DLL int64_t rank() const
Canonical thread-scope identity, named as backend.scope.
Definition thread_scope.h:55
ThreadScope(const ffi::String &name)
Definition thread_scope.h:57
static TVM_TIRX_DLL ThreadScope Get(const ffi::String &name)
bool operator!=(const ThreadScope &other) const
Definition thread_scope.h:61
bool operator==(const ThreadScope &other) const
Definition thread_scope.h:60
const ffi::String & name() const
Definition thread_scope.h:59
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ThreadScope, ffi::Enum, ThreadScopeObj)
Definition nested_msg.h:600
constexpr ffi::reflection::AttrKey< ffi::String > kBackend
Backend owning a thread scope.
Definition thread_scope.h:35
constexpr ffi::reflection::AttrKey< int64_t > kRank
Explicit hierarchy rank. Smaller ranks denote wider scopes.
Definition thread_scope.h:37
Definition axis_group_graph.h:41
std::ostream & operator<<(std::ostream &os, const ThreadScope &scope)
Definition thread_scope.h:68
TVM_TIRX_DLL bool ScopeHigher(const ThreadScope &a, const ThreadScope &b)
Compare explicit ranks within one backend's hierarchy.
static tirx::ThreadScope ConvertFallbackValue(ffi::String name)
Definition thread_scope.h:80