This repository was archived by the owner on Apr 6, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
build2cmake/src/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,15 +111,14 @@ add_compile_definitions(_WIN32>)
111111
112112# Generate standardized build name
113113run_python (TORCH_VERSION "import torch; print(torch.__version__.split('+')[0])" "Failed to get Torch version" )
114- run_python (CXX11_ABI_VALUE "import torch; print('TRUE' if torch._C._GLIBCXX_USE_CXX11_ABI else 'FALSE')" "Failed to get CXX11 ABI" )
115114cmake_host_system_information (RESULT HOST_ARCH QUERY OS_PLATFORM )
116115
117116set (SYSTEM_STRING "${HOST_ARCH} -windows" )
118117
119118if (GPU_LANG STREQUAL "CUDA" )
120- generate_build_name (BUILD_VARIANT_NAME "${TORCH_VERSION} " "${CXX11_ABI_VALUE} " " cuda" "${CUDA_VERSION} " "${SYSTEM_STRING} " )
119+ generate_build_name (BUILD_VARIANT_NAME "${TORCH_VERSION} " "cuda" "${CUDA_VERSION} " "${SYSTEM_STRING} " )
121120elseif (GPU_LANG STREQUAL "HIP" )
122121 run_python (ROCM_VERSION "import torch.version; print(torch.version.hip.split('.')[0] + '.' + torch.version.hip.split('.')[1])" "Failed to get ROCm version" )
123- generate_build_name (BUILD_VARIANT_NAME "${TORCH_VERSION} " "${CXX11_ABI_VALUE} " " rocm" "${ROCM_VERSION} " "${SYSTEM_STRING} " )
122+ generate_build_name (BUILD_VARIANT_NAME "${TORCH_VERSION} " "rocm" "${ROCM_VERSION} " "${SYSTEM_STRING} " )
124123endif ()
125124{% endif %}
Original file line number Diff line number Diff line change 44# Arguments:
55# OUT_BUILD_NAME - Output variable name
66# TORCH_VERSION - PyTorch version (e.g., "2.7.1")
7- # CXX11_ABI - Whether C++11 ABI is enabled (TRUE/FALSE)
87# COMPUTE_FRAMEWORK - One of: cuda, rocm, metal, xpu
98# COMPUTE_VERSION - Version of compute framework (e.g., "12.4" for CUDA, "6.0" for ROCm)
109# Example output: torch271-cxx11-cu124-x86_64-windows
1110#
12- function (generate_build_name OUT_BUILD_NAME TORCH_VERSION CXX11_ABI COMPUTE_FRAMEWORK COMPUTE_VERSION )
11+ function (generate_build_name OUT_BUILD_NAME TORCH_VERSION COMPUTE_FRAMEWORK COMPUTE_VERSION )
1312 # Flatten version by removing dots and padding to 2 components
1413 string (REPLACE "." ";" VERSION_LIST "${TORCH_VERSION} " )
1514 list (LENGTH VERSION_LIST VERSION_COMPONENTS)
@@ -74,11 +73,7 @@ function(generate_build_name OUT_BUILD_NAME TORCH_VERSION CXX11_ABI COMPUTE_FRAM
7473 endif ()
7574
7675 # Assemble the final build name
77- if (CXX11_ABI STREQUAL "" OR CXX11_ABI STREQUAL "FALSE" )
78- set (BUILD_NAME "torch${FLATTENED_TORCH} -${COMPUTE_STRING} -${CPU_ARCH} -windows" )
79- else ()
80- set (BUILD_NAME "torch${FLATTENED_TORCH} -cxx11-${COMPUTE_STRING} -${CPU_ARCH} -windows" )
81- endif ()
76+ set (BUILD_NAME "torch${FLATTENED_TORCH} -${COMPUTE_STRING} -${CPU_ARCH} -windows" )
8277
8378 set (${OUT_BUILD_NAME} "${BUILD_NAME} " PARENT_SCOPE )
8479 message (STATUS "Generated build name: ${BUILD_NAME} " )
You can’t perform that action at this time.
0 commit comments