Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit fcd838a

Browse files
committed
fix(windows): ok the issue is not with _WIN32 but with USE_CUDA=1 which is not set
1 parent cdd0f70 commit fcd838a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

build2cmake/src/templates/cuda/preamble.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ message(STATUS "Rendered for platform {{ platform }}")
104104
{% if platform == 'windows' %}
105105
include(${CMAKE_CURRENT_LIST_DIR}/cmake/windows.cmake)
106106

107-
# This preprocessor macro should be defined in building with MSVC but not for CUDA and co.
108-
# Also, if not using MVSC, this may not be set too ...
109-
# So we explicitly set it to avoid any side effect due to preprocessor-guards not being defined.
110-
add_compile_definitions(_WIN32)
107+
if(GPU_LANG STREQUAL "CUDA")
108+
add_compile_definitions(USE_CUDA=1)
109+
elseif(GPU STREQUAL "HIP")
110+
add_compile_definitions(USE_ROCM=1)
111+
endif()
111112

112113
# Generate standardized build name
113114
run_python(TORCH_VERSION "import torch; print(torch.__version__.split('+')[0])" "Failed to get Torch version")

0 commit comments

Comments
 (0)