From dcf4b46806117c25cc4022d9465aff94c463e3db Mon Sep 17 00:00:00 2001 From: tqchen Date: Sun, 14 Jun 2026 01:51:12 +0000 Subject: [PATCH] [REFACTOR][VM] Move CUDA graph VM builtin back under VM runtime CUDA graph VM support is Relax VM functionality, so it should stay with the VM runtime layout instead of living under the CUDA backend runtime tree introduced by the backend reorg. This moves the CUDA graph builtin back under src/runtime/vm/cuda and points the CUDA runtime CMake source glob at that VM-owned location while preserving the existing symbols and behavior. --- cmake/modules/CUDA.cmake | 2 +- .../runtime/vm => runtime/vm/cuda}/cuda_graph_builtin.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/{backend/cuda/runtime/vm => runtime/vm/cuda}/cuda_graph_builtin.cc (98%) diff --git a/cmake/modules/CUDA.cmake b/cmake/modules/CUDA.cmake index 53f4bf8d868c..7a383aa0deae 100644 --- a/cmake/modules/CUDA.cmake +++ b/cmake/modules/CUDA.cmake @@ -63,7 +63,7 @@ if(USE_CUDA) message(STATUS "Build cuda device runtime") tvm_file_glob(GLOB RUNTIME_CUDA_SRCS src/backend/cuda/runtime/*.cc) - tvm_file_glob(GLOB VM_CUDA_BUILTIN_SRC_CC src/backend/cuda/runtime/vm/*.cc) + tvm_file_glob(GLOB VM_CUDA_BUILTIN_SRC_CC src/runtime/vm/cuda/*.cc) add_library(tvm_runtime_cuda_objs OBJECT ${RUNTIME_CUDA_SRCS} ${VM_CUDA_BUILTIN_SRC_CC}) target_link_libraries(tvm_runtime_cuda_objs PUBLIC tvm_ffi_header) diff --git a/src/backend/cuda/runtime/vm/cuda_graph_builtin.cc b/src/runtime/vm/cuda/cuda_graph_builtin.cc similarity index 98% rename from src/backend/cuda/runtime/vm/cuda_graph_builtin.cc rename to src/runtime/vm/cuda/cuda_graph_builtin.cc index 6d60042b19b7..58348fb695d8 100644 --- a/src/backend/cuda/runtime/vm/cuda_graph_builtin.cc +++ b/src/runtime/vm/cuda/cuda_graph_builtin.cc @@ -18,7 +18,7 @@ */ /*! - * \file src/runtime/vm/cuda_graph_builtin.cc + * \file src/runtime/vm/cuda/cuda_graph_builtin.cc * \brief The CUDA graph related builtin functions for Relax virtual machine. */ @@ -28,8 +28,8 @@ #include #include -#include "../../../../support/utils.h" -#include "../cuda_common.h" +#include "../../../backend/cuda/runtime/cuda_common.h" +#include "../../../support/utils.h" namespace tvm { namespace runtime { namespace vm {