diff --git a/CMakeLists.txt b/CMakeLists.txt index b97f8d4ce8..e76a62d7a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,6 +319,7 @@ list(APPEND COMPILER_SRCS "src/target/datatype/myfloat/myfloat.cc") tvm_file_glob(GLOB RUNTIME_SRCS src/runtime/*.cc src/runtime/vm/*.cc + src/runtime/relax_vm/*.cc ) if(BUILD_FOR_HEXAGON) diff --git a/include/tvm/relax/vm/exec_builder.h b/include/tvm/relax/exec_builder.h similarity index 93% rename from include/tvm/relax/vm/exec_builder.h rename to include/tvm/relax/exec_builder.h index 1b222bf671..3ce97be77c 100644 --- a/include/tvm/relax/vm/exec_builder.h +++ b/include/tvm/relax/exec_builder.h @@ -18,23 +18,22 @@ */ /*! - * \file tvm/relax/vm/exec_builder.h + * \file tvm/relax/exec_builder.h */ -#ifndef TVM_RELAX_VM_EXEC_BUILDER_H_ -#define TVM_RELAX_VM_EXEC_BUILDER_H_ +#ifndef TVM_RELAX_EXEC_BUILDER_H_ +#define TVM_RELAX_EXEC_BUILDER_H_ #include #include #include #include #include +#include +#include #include #include -#include "./bytecode.h" -#include "./executable.h" - namespace tvm { namespace relax { @@ -121,4 +120,4 @@ class ExecBuilder : public ObjectRef { } // namespace relax } // namespace tvm -#endif // TVM_RELAX_VM_EXEC_BUILDER_H_ +#endif // TVM_RELAX_EXEC_BUILDER_H_ diff --git a/include/tvm/relax/vm/bytecode.h b/include/tvm/runtime/relax_vm/bytecode.h similarity index 96% rename from include/tvm/relax/vm/bytecode.h rename to include/tvm/runtime/relax_vm/bytecode.h index 250c3eeb9a..bc56c1e3a7 100644 --- a/include/tvm/relax/vm/bytecode.h +++ b/include/tvm/runtime/relax_vm/bytecode.h @@ -18,11 +18,11 @@ */ /*! - * \file tvm/relax/vm/bytecode.h + * \file tvm/runtime/relax_vm/bytecode.h * \brief The bytecode for the virtual machine. */ -#ifndef TVM_RELAX_VM_BYTECODE_H_ -#define TVM_RELAX_VM_BYTECODE_H_ +#ifndef TVM_RUNTIME_RELAX_VM_BYTECODE_H_ +#define TVM_RUNTIME_RELAX_VM_BYTECODE_H_ #include #include @@ -177,4 +177,4 @@ struct Instruction { } // namespace runtime } // namespace tvm -#endif // TVM_RELAX_VM_BYTECODE_H_ +#endif // TVM_RUNTIME_RELAX_VM_BYTECODE_H_ diff --git a/include/tvm/relax/vm/executable.h b/include/tvm/runtime/relax_vm/executable.h similarity index 97% rename from include/tvm/relax/vm/executable.h rename to include/tvm/runtime/relax_vm/executable.h index c3b4476b86..2e9a31d2d1 100644 --- a/include/tvm/relax/vm/executable.h +++ b/include/tvm/runtime/relax_vm/executable.h @@ -18,11 +18,10 @@ */ /*! - * \file tvm/relax/vm/executable.h - * \brief + * \file tvm/runtime/relax_vm/executable.h */ -#ifndef TVM_RELAX_VM_EXECUTABLE_H_ -#define TVM_RELAX_VM_EXECUTABLE_H_ +#ifndef TVM_RUNTIME_RELAX_VM_EXECUTABLE_H_ +#define TVM_RUNTIME_RELAX_VM_EXECUTABLE_H_ #include #include @@ -192,4 +191,4 @@ class Executable : public runtime::ModuleNode { } // namespace runtime } // namespace tvm -#endif // TVM_RELAX_VM_EXECUTABLE_H_ +#endif // TVM_RUNTIME_RELAX_VM_EXECUTABLE_H_ diff --git a/include/tvm/relax/vm/memory_manager.h b/include/tvm/runtime/relax_vm/memory_manager.h similarity index 95% rename from include/tvm/relax/vm/memory_manager.h rename to include/tvm/runtime/relax_vm/memory_manager.h index 3deb7a5edd..e5ae8cfcfb 100644 --- a/include/tvm/relax/vm/memory_manager.h +++ b/include/tvm/runtime/relax_vm/memory_manager.h @@ -18,11 +18,11 @@ */ /*! - * \file tvm/relax/vm/memory_manager.h + * \file tvm/runtime/relax_vm/memory_manager.h * \brief Abstract device memory management API */ -#ifndef TVM_RELAX_VM_MEMORY_MANAGER_H_ -#define TVM_RELAX_VM_MEMORY_MANAGER_H_ +#ifndef TVM_RUNTIME_RELAX_VM_MEMORY_MANAGER_H_ +#define TVM_RUNTIME_RELAX_VM_MEMORY_MANAGER_H_ #include #include @@ -139,4 +139,4 @@ class Storage : public ObjectRef { } // namespace runtime } // namespace tvm -#endif // TVM_RELAX_VM_MEMORY_MANAGER_H_ +#endif // TVM_RUNTIME_RELAX_VM_MEMORY_MANAGER_H_ diff --git a/include/tvm/relax/vm/vm.h b/include/tvm/runtime/relax_vm/vm.h similarity index 97% rename from include/tvm/relax/vm/vm.h rename to include/tvm/runtime/relax_vm/vm.h index 0565fb4e2e..ab6f8104c6 100644 --- a/include/tvm/relax/vm/vm.h +++ b/include/tvm/runtime/relax_vm/vm.h @@ -18,11 +18,10 @@ */ /*! - * \file tvm/relax/vm/vm.h - * \brief + * \file tvm/runtime/relax_vm/vm.h */ -#ifndef TVM_RELAX_VM_VM_H_ -#define TVM_RELAX_VM_VM_H_ +#ifndef TVM_RUNTIME_RELAX_VM_VM_H_ +#define TVM_RUNTIME_RELAX_VM_VM_H_ #include #include @@ -202,4 +201,4 @@ class VirtualMachine : public runtime::ModuleNode { } // namespace runtime } // namespace tvm -#endif // TVM_RELAX_VM_VM_H_ +#endif // TVM_RUNTIME_RELAX_VM_VM_H_ diff --git a/src/relax/vm/builtin.cc b/src/relax/backend/vm/builtin.cc similarity index 97% rename from src/relax/vm/builtin.cc rename to src/relax/backend/vm/builtin.cc index 68f0e6d1b4..f1089c31f3 100644 --- a/src/relax/vm/builtin.cc +++ b/src/relax/backend/vm/builtin.cc @@ -17,11 +17,8 @@ * under the License. */ /*! - * \file src/relax/vm/builtin.cc + * \file src/relax/backend/vm/builtin.cc */ -#include -#include -#include #include #include #include @@ -30,6 +27,9 @@ #include #include #include +#include +#include +#include namespace tvm { namespace runtime { diff --git a/src/relax/backend/vm/codegen_vm.h b/src/relax/backend/vm/codegen_vm.h index e2a7a046d3..5791f86888 100644 --- a/src/relax/backend/vm/codegen_vm.h +++ b/src/relax/backend/vm/codegen_vm.h @@ -26,8 +26,8 @@ #define TVM_RELAX_BACKEND_VM_CODEGEN_VM_H_ #include -#include -#include +#include +#include #include #include diff --git a/src/relax/vm/exec_builder.cc b/src/relax/backend/vm/exec_builder.cc similarity index 99% rename from src/relax/vm/exec_builder.cc rename to src/relax/backend/vm/exec_builder.cc index e35eb1a8aa..853c0d67b9 100644 --- a/src/relax/vm/exec_builder.cc +++ b/src/relax/backend/vm/exec_builder.cc @@ -18,9 +18,9 @@ */ /*! - * \file src/relax/vm/exec_builder.cc + * \file src/relax/backend/vm/exec_builder.cc */ -#include +#include #include diff --git a/src/relax/vm/bytecode.cc b/src/runtime/relax_vm/bytecode.cc similarity index 95% rename from src/relax/vm/bytecode.cc rename to src/runtime/relax_vm/bytecode.cc index fd55a52af3..9084207848 100644 --- a/src/relax/vm/bytecode.cc +++ b/src/runtime/relax_vm/bytecode.cc @@ -18,12 +18,12 @@ */ /*! - * \file src/relax/vm/bytecode.cc + * \file src/runtime/relax_vm/bytecode.cc * \brief The bytecode for Relax virtual machine. */ -#include #include +#include #include #include diff --git a/src/relax/vm/executable.cc b/src/runtime/relax_vm/executable.cc similarity index 99% rename from src/relax/vm/executable.cc rename to src/runtime/relax_vm/executable.cc index 7aeb605d2f..8bff5a6a51 100644 --- a/src/relax/vm/executable.cc +++ b/src/runtime/relax_vm/executable.cc @@ -18,19 +18,18 @@ */ /*! - * \file src/relax/vm/executable.cc - * \brief + * \file src/runtime/relax_vm/executable.cc */ #include -#include -#include #include +#include +#include #include #include -#include "../../runtime/file_utils.h" +#include "../file_utils.h" namespace tvm { namespace runtime { diff --git a/src/relax/vm/memory_manager.cc b/src/runtime/relax_vm/memory_manager.cc similarity index 98% rename from src/relax/vm/memory_manager.cc rename to src/runtime/relax_vm/memory_manager.cc index 6cc51d804a..a017b9c6d9 100644 --- a/src/relax/vm/memory_manager.cc +++ b/src/runtime/relax_vm/memory_manager.cc @@ -18,10 +18,10 @@ */ /*! - * \file tvm/relax/vm/memory_manager.cc + * \file tvm/runtime/relax_vm/memory_manager.cc * \brief Allocate and manage memory for the Relay VM. */ -#include +#include #include #include diff --git a/src/relax/vm/naive_allocator.h b/src/runtime/relax_vm/naive_allocator.h similarity index 88% rename from src/relax/vm/naive_allocator.h rename to src/runtime/relax_vm/naive_allocator.h index 08a4159ec1..843a559602 100644 --- a/src/relax/vm/naive_allocator.h +++ b/src/runtime/relax_vm/naive_allocator.h @@ -18,13 +18,13 @@ */ /*! - * \file tvm/relax/vm/naive_allocator.h + * \file tvm/runtime/relax_vm/naive_allocator.h */ -#ifndef TVM_RELAX_VM_NAIVE_ALLOCATOR_H_ -#define TVM_RELAX_VM_NAIVE_ALLOCATOR_H_ +#ifndef TVM_RUNTIME_RELAX_VM_NAIVE_ALLOCATOR_H_ +#define TVM_RUNTIME_RELAX_VM_NAIVE_ALLOCATOR_H_ -#include #include +#include #include @@ -62,4 +62,4 @@ class NaiveAllocator final : public Allocator { } // namespace runtime } // namespace tvm -#endif // TVM_RELAX_VM_NAIVE_ALLOCATOR_H_ +#endif // TVM_RUNTIME_RELAX_VM_NAIVE_ALLOCATOR_H_ diff --git a/src/relax/vm/pooled_allocator.h b/src/runtime/relax_vm/pooled_allocator.h similarity index 93% rename from src/relax/vm/pooled_allocator.h rename to src/runtime/relax_vm/pooled_allocator.h index 919b846671..0dd7d8b027 100644 --- a/src/relax/vm/pooled_allocator.h +++ b/src/runtime/relax_vm/pooled_allocator.h @@ -18,13 +18,13 @@ */ /*! - * \file tvm/relax/vm/pooled_allocator.h + * \file tvm/runtime/relax_vm/pooled_allocator.h */ -#ifndef TVM_RELAX_VM_POOLED_ALLOCATOR_H_ -#define TVM_RELAX_VM_POOLED_ALLOCATOR_H_ +#ifndef TVM_RUNTIME_RELAX_VM_POOLED_ALLOCATOR_H_ +#define TVM_RUNTIME_RELAX_VM_POOLED_ALLOCATOR_H_ -#include #include +#include #include #include @@ -108,4 +108,4 @@ class PooledAllocator final : public Allocator { } // namespace runtime } // namespace tvm -#endif // TVM_RELAX_VM_POOLED_ALLOCATOR_H_ +#endif // TVM_RUNTIME_RELAX_VM_POOLED_ALLOCATOR_H_ diff --git a/src/relax/vm/vm.cc b/src/runtime/relax_vm/vm.cc similarity index 99% rename from src/relax/vm/vm.cc rename to src/runtime/relax_vm/vm.cc index 9ecf0b3d73..65e42473a6 100644 --- a/src/relax/vm/vm.cc +++ b/src/runtime/relax_vm/vm.cc @@ -18,11 +18,10 @@ */ /*! - * \file src/relax/vm/vm.cc - * \brief + * \file src/runtime/relax_vm/vm.cc */ -#include +#include namespace tvm { namespace runtime {