This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new ed2c26abae [ADRENO][WINDOWS] Windows build dependencies for Adreno 
target
ed2c26abae is described below

commit ed2c26abae6aa2ec2011568149c1f0689491005f
Author: Siva <[email protected]>
AuthorDate: Sun Jan 26 12:54:04 2025 +0530

    [ADRENO][WINDOWS] Windows build dependencies for Adreno target
    
    This brings in basic support for Adreno target on Windows platforms
    and the tools we generally use for Adreno
---
 .gitmodules                              |  3 +++
 3rdparty/zlib                            |  1 +
 LICENSE                                  |  1 +
 apps/cpp_rtvm/CMakeLists.txt             | 17 +++++++++++++----
 apps/cpp_rtvm/main.cc                    |  4 ----
 apps/cpp_rtvm/tvm_runner.cc              |  3 ++-
 licenses/LICENSE.zlib.txt                | 22 ++++++++++++++++++++++
 python/tvm/driver/tvmc/config_options.py |  6 ++++++
 8 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/.gitmodules b/.gitmodules
index cb22b3d3d3..a1187967f7 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -28,3 +28,6 @@
 [submodule "3rdparty/flashinfer"]
        path = 3rdparty/flashinfer
        url = https://github.com/flashinfer-ai/flashinfer.git
+[submodule "3rdparty/zlib"]
+       path = 3rdparty/zlib
+       url = https://github.com/madler/zlib.git
diff --git a/3rdparty/zlib b/3rdparty/zlib
new file mode 160000
index 0000000000..ef24c4c750
--- /dev/null
+++ b/3rdparty/zlib
@@ -0,0 +1 @@
+Subproject commit ef24c4c7502169f016dcd2a26923dbaf3216748c
diff --git a/LICENSE b/LICENSE
index 82c7871cc6..f6126d011a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -242,6 +242,7 @@ The Unlicense
 -------------
 
 3rdparty/rang
+3rdparty/zlib
 
 BSD 3-Clause "New" or "Revised" License
 ---------------------------------------
diff --git a/apps/cpp_rtvm/CMakeLists.txt b/apps/cpp_rtvm/CMakeLists.txt
index 0f20920af4..b8f2d50e47 100644
--- a/apps/cpp_rtvm/CMakeLists.txt
+++ b/apps/cpp_rtvm/CMakeLists.txt
@@ -13,8 +13,11 @@ set(TVM_RUNNER_SOURCES
 set(RTVM_LINKER_LIBS "")
 
 if(WIN32)
-  list(APPEND RTVM_SOURCES ../cpp_rpc/win32_process.cc)
-  list(APPEND TVM_RUNNER_SOURCES ../cpp_rpc/win32_process.cc)
+  file(GLOB ZLIB_SRC
+       "../../3rdparty/zlib/*.c"
+  )
+  list(APPEND RTVM_SOURCES ${ZLIB_SRC})
+  list(APPEND TVM_RUNNER_SOURCES ${ZLIB_SRC})
 endif()
 
 # Set output to same directory as the other TVM libs
@@ -55,6 +58,7 @@ target_include_directories(
   rtvm
   PUBLIC "../../include"
   PUBLIC "../../3rdparty/cnpy"
+  PUBLIC "../../3rdparty/zlib"
   PUBLIC DLPACK_PATH
   PUBLIC DMLC_PATH
 )
@@ -72,9 +76,13 @@ if (BUILD_FOR_ANDROID AND USE_HEXAGON)
 endif()
 
 if(BUILD_STATIC_RUNTIME)
-  list(APPEND RTVM_LINKER_LIBS -Wl,--whole-archive tvm_runtime 
-Wl,--no-whole-archive z)
+  list(APPEND RTVM_LINKER_LIBS -Wl,--whole-archive tvm_runtime 
-Wl,--no-whole-archive)
 else()
-  list(APPEND RTVM_LINKER_LIBS tvm_runtime z)
+  list(APPEND RTVM_LINKER_LIBS tvm_runtime)
+endif()
+
+if(NOT WIN32)
+  list(APPEND RTVM_LINKER_LIBS z)
 endif()
 
 target_link_libraries(rtvm ${RTVM_LINKER_LIBS})
@@ -84,6 +92,7 @@ target_include_directories(
   tvm_runner_objs
   PUBLIC "../../include"
   PUBLIC "../../3rdparty/cnpy"
+  PUBLIC "../../3rdparty/zlib"
   PUBLIC DLPACK_PATH
   PUBLIC DMLC_PATH
 )
diff --git a/apps/cpp_rtvm/main.cc b/apps/cpp_rtvm/main.cc
index 2efd7f4a94..ee3d4d2583 100644
--- a/apps/cpp_rtvm/main.cc
+++ b/apps/cpp_rtvm/main.cc
@@ -39,10 +39,6 @@
 #include "../../src/support/utils.h"
 #include "tvm_runner.h"
 
-#if defined(_WIN32)
-#include "../cpp_rpc/win32_process.h"
-#endif
-
 using namespace std;
 using namespace tvm::runtime;
 using namespace tvm::support;
diff --git a/apps/cpp_rtvm/tvm_runner.cc b/apps/cpp_rtvm/tvm_runner.cc
index 7d6dbc23ee..945b541cfa 100644
--- a/apps/cpp_rtvm/tvm_runner.cc
+++ b/apps/cpp_rtvm/tvm_runner.cc
@@ -154,7 +154,8 @@ void TVMRunner::UsePreCompiledPrograms(std::string 
file_name) {
   if (f_get != nullptr && f_set != nullptr) {
     std::ifstream ifs(file_name, std::ios::in | std::ios::binary);
     if (ifs.fail()) {
-      auto bytes = String(f_get());
+      std::string ss = f_get();
+      auto bytes = tvm::String(ss);
       std::ofstream fs(file_name, std::ofstream::binary);
       fs.write(bytes.c_str(), bytes.size());
     } else {
diff --git a/licenses/LICENSE.zlib.txt b/licenses/LICENSE.zlib.txt
new file mode 100644
index 0000000000..b517acd576
--- /dev/null
+++ b/licenses/LICENSE.zlib.txt
@@ -0,0 +1,22 @@
+Copyright notice:
+
+ (C) 1995-2024 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  [email protected]          [email protected]
diff --git a/python/tvm/driver/tvmc/config_options.py 
b/python/tvm/driver/tvmc/config_options.py
index c384c89b1a..6ba89d650e 100644
--- a/python/tvm/driver/tvmc/config_options.py
+++ b/python/tvm/driver/tvmc/config_options.py
@@ -59,6 +59,12 @@ def get_configs_json_dir() -> str:
         candidate_paths.extend(
             [os.path.abspath(os.path.join(lib_path, "..")) for lib_path in 
libinfo.find_lib_path()]
         )
+        candidate_paths.extend(
+            [
+                os.path.abspath(os.path.join(lib_path, "../.."))
+                for lib_path in libinfo.find_lib_path()
+            ]
+        )
         for path in candidate_paths:
             configs_path = os.path.join(os.path.dirname(path), "configs")
             if os.path.isdir(configs_path):

Reply via email to