You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2025/03/12 13:26:02 UTC
(tvm) 37/38: lint
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch refactor-s0
in repository https://gitbox.apache.org/repos/asf/tvm.git
commit ffc1ec0ebde1ed97fde9eebaddb295978a9b6d61
Author: tqchen <ti...@gmail.com>
AuthorDate: Mon Mar 10 10:06:45 2025 -0400
lint
---
include/tvm/ir/attrs.h | 8 ++++----
include/tvm/runtime/memory.h | 2 +-
src/runtime/ndarray.cc | 8 +++-----
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/include/tvm/ir/attrs.h b/include/tvm/ir/attrs.h
index 479cc476bf..6fcf07bfaa 100644
--- a/include/tvm/ir/attrs.h
+++ b/include/tvm/ir/attrs.h
@@ -63,10 +63,10 @@ namespace tvm {
* \param ClassName The name of the class.
* \param TypeKey The type key to be used by the TVM node system.
*/
-#define TVM_DECLARE_ATTRS(ClassName, TypeKey) \
- static constexpr const char* _type_key = TypeKey; \
- TVM_DECLARE_FINAL_OBJECT_INFO(ClassName, ::tvm::BaseAttrsNode);\
- template <typename FVisit> \
+#define TVM_DECLARE_ATTRS(ClassName, TypeKey) \
+ static constexpr const char* _type_key = TypeKey; \
+ TVM_DECLARE_FINAL_OBJECT_INFO(ClassName, ::tvm::BaseAttrsNode); \
+ template <typename FVisit> \
void _tvm_VisitAttrs(FVisit& _tvm_fvisit) // NOLINT(*)
/*!
diff --git a/include/tvm/runtime/memory.h b/include/tvm/runtime/memory.h
index 2b317d05c5..96ca0c8d69 100644
--- a/include/tvm/runtime/memory.h
+++ b/include/tvm/runtime/memory.h
@@ -28,9 +28,9 @@
namespace tvm {
namespace runtime {
+using tvm::ffi::FObjectDeleter;
using tvm::ffi::make_inplace_array_object;
using tvm::ffi::make_object;
-using tvm::ffi::FObjectDeleter;
} // namespace runtime
} // namespace tvm
diff --git a/src/runtime/ndarray.cc b/src/runtime/ndarray.cc
index 9ad2b19ef9..37f470b07e 100644
--- a/src/runtime/ndarray.cc
+++ b/src/runtime/ndarray.cc
@@ -102,8 +102,7 @@ void ArrayCopyToBytes(const DLTensor* handle, void* data, size_t nbytes) {
struct NDArray::Internal {
// Default deleter for the container
static void DefaultDeleter(TVMFFIObject* ptr_obj) {
- auto* ptr =
- ffi::details::ObjectUnsafe::RawObjectPtrFromUnowned<NDArray::Container>(ptr_obj);
+ auto* ptr = ffi::details::ObjectUnsafe::RawObjectPtrFromUnowned<NDArray::Container>(ptr_obj);
if (ptr->manager_ctx != nullptr) {
ffi::details::ObjectUnsafe::DecRefObjectHandle(
static_cast<NDArray::Container*>(ptr->manager_ctx));
@@ -119,8 +118,7 @@ struct NDArray::Internal {
// This enables us to create NDArray from memory allocated by other
// frameworks that are DLPack compatible
static void DLPackDeleter(TVMFFIObject* ptr_obj) {
- auto* ptr =
- ffi::details::ObjectUnsafe::RawObjectPtrFromUnowned<NDArray::Container>(ptr_obj);
+ auto* ptr = ffi::details::ObjectUnsafe::RawObjectPtrFromUnowned<NDArray::Container>(ptr_obj);
DLManagedTensor* tensor = static_cast<DLManagedTensor*>(ptr->manager_ctx);
if (tensor->deleter != nullptr) {
(*tensor->deleter)(tensor);
@@ -132,7 +130,7 @@ struct NDArray::Internal {
// responsibility for its freeing is also outside
static void SelfDeleter(TVMFFIObject* ptr_obj) {
NDArray::Container* ptr =
- ffi::details::ObjectUnsafe::RawObjectPtrFromUnowned<NDArray::Container>(ptr_obj);
+ ffi::details::ObjectUnsafe::RawObjectPtrFromUnowned<NDArray::Container>(ptr_obj);
delete ptr;
}
// Local create function which allocates tensor metadata