Skip to content

Commit

Permalink
[runtime] upgrade libtorch version to 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cdliang11 committed Oct 18, 2024
1 parent 5e2840e commit 199b720
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions runtime/core/cmake/libtorch.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if(TORCH)
set(TORCH_VERSION "2.1.0")
set(TORCH_VERSION "2.2.0")
add_definitions(-DUSE_TORCH)
if(NOT ANDROID)
if(GPU)
Expand All @@ -13,32 +13,37 @@ if(TORCH)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-${TORCH_VERSION}%2Bcpu.zip")
set(URL_HASH "SHA256=77815aa799f15e91b6fbb0216ac78cc0479adb5cd0ca662072241484cf23f667")
set(URL_HASH "SHA256=96bc833184a7c13a088a2a83cab5a2be853c0c9d9f972740a50580173d0c796d")
else()
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-debug-${TORCH_VERSION}%2Bcpu.zip")
set(URL_HASH "SHA256=5f887c02d9abf805c8b53fef89bf5a4dab9dd78771754344e73c98d9c484aa9d")
set(URL_HASH "SHA256=5b7dbabbecd86051b800ce0a244f15b89e9de0f8b5370e5fa65668aa37ecb878")
endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(CXX11_ABI)
if(NOT GPU)
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${TORCH_VERSION}%2Bcpu.zip")
set(URL_HASH "SHA256=04f699d5181048b0062ef52de1df44b46859b8fbeeee12abdbcb9aac63e2a14b")
set(URL_HASH "SHA256=62cd3001a2886d2db125aabc3be5c4fb66b3e34b32727d84323968f507ee8e32")
else()
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-${TORCH_VERSION}%2Bcu118.zip")
set(URL_HASH "SHA256=7796249faa9828a53b72d3f616fc97a1d9e87e6a35ac72b392ca1ddc7b125188")
set(URL_HASH "SHA256=a2b0f51ff59ef2787a82c36bba67f7380236a6384dbbd2459c558989af27184f")
endif()
else()
if(NOT GPU)
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-${TORCH_VERSION}%2Bcpu.zip")
set(URL_HASH "SHA256=0e86d364d05b83c6c66c3bb32e7eee932847843e4085487eefd9b3bbde4e2c58")
set(URL_HASH "SHA256=e1f6bc48403022ff4680c7299cc8b160df146892c414b8a6b6f7d5aff65bcbce")
else()
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cu118/libtorch-shared-with-deps-${TORCH_VERSION}%2Bcu118.zip")
set(URL_HASH "SHA256=f70cfae25b02ff419e1d51ad137a746941773d2c4b0155a44b4b6b50702d661a")
set(URL_HASH "SHA256=f9c887085207f9500357cae4324a53c3010b8890397db915d7dbefb9183c7964")
endif()
endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-macos-${TORCH_VERSION}.zip")
set(URL_HASH "SHA256=ce744d2d27a96df8f34d4227e8b1179dad5a76612dc7230b61db65affce6e7bd")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-${TORCH_VERSION}.zip")
set(URL_HASH "SHA256=a2ac530e5db2f5be33fe7f7e3049b9a525ee60b110dbb1e08835e22002756ed1")
else()
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-macos-x86_64-${TORCH_VERSION}.zip")
set(URL_HASH "SHA256=300940c6b1d4402ece72d31cd5694d9579dcfb23b7cf6b05676006411f9b516c")
endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
add_definitions(-DIOS)
else()
Expand Down

0 comments on commit 199b720

Please sign in to comment.