Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADRENO][WINDOWS] Windows build dependencies for Adreno target #17515

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,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
1 change: 1 addition & 0 deletions 3rdparty/zlib
Submodule zlib added at d47682
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ The Unlicense
-------------

3rdparty/rang
3rdparty/zlib

BSD 3-Clause "New" or "Revised" License
---------------------------------------
Expand Down
17 changes: 13 additions & 4 deletions apps/cpp_rtvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -55,6 +58,7 @@ target_include_directories(
rtvm
PUBLIC "../../include"
PUBLIC "../../3rdparty/cnpy"
PUBLIC "../../3rdparty/zlib"
PUBLIC DLPACK_PATH
PUBLIC DMLC_PATH
)
Expand All @@ -80,9 +84,13 @@ if(USE_ETHOSN)
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})
Expand All @@ -92,6 +100,7 @@ target_include_directories(
tvm_runner_objs
PUBLIC "../../include"
PUBLIC "../../3rdparty/cnpy"
PUBLIC "../../3rdparty/zlib"
PUBLIC DLPACK_PATH
PUBLIC DMLC_PATH
)
Expand Down
4 changes: 0 additions & 4 deletions apps/cpp_rtvm/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion apps/cpp_rtvm/tvm_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 22 additions & 0 deletions licenses/LICENSE.zlib.txt
Original file line number Diff line number Diff line change
@@ -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]
6 changes: 6 additions & 0 deletions python/tvm/driver/tvmc/config_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading