[ROCm][Windows] Fix offload gpu arch list in tests (#155212)

Added fix to get ROCM_PROPERTY_ARCH_LIST value in set_target_properties in c10/cuda and caffe2 tests

Pull Request resolved: https://github.com/pytorch/pytorch/pull/155212
Approved by: https://github.com/malfet
This commit is contained in:
tvukovic-amd
2025-06-05 20:30:23 +00:00
committed by PyTorch MergeBot
parent 9a42f01586
commit a85ad55525
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ if(BUILD_TEST)
set_source_files_properties(${test_src} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) set_source_files_properties(${test_src} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_add_executable(${test_name} "${test_src}") hip_add_executable(${test_name} "${test_src}")
list(JOIN PYTORCH_ROCM_ARCH " " ROCM_PROPERTY_ARCH_LIST) list(JOIN PYTORCH_ROCM_ARCH " " ROCM_PROPERTY_ARCH_LIST)
set_target_properties(${test_name} PROPERTIES LINKER_LANGUAGE CXX HIP_ARCHITECTURES ROCM_PROPERTY_ARCH_LIST) set_target_properties(${test_name} PROPERTIES LINKER_LANGUAGE CXX HIP_ARCHITECTURES ${ROCM_PROPERTY_ARCH_LIST})
else() else()
add_executable(${test_name} "${test_src}") add_executable(${test_name} "${test_src}")
endif() endif()

View File

@ -1949,7 +1949,7 @@ if(BUILD_TEST)
set_source_files_properties(${test_src} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) set_source_files_properties(${test_src} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_add_executable(${test_name} "${test_src}") hip_add_executable(${test_name} "${test_src}")
list(JOIN PYTORCH_ROCM_ARCH " " ROCM_PROPERTY_ARCH_LIST) list(JOIN PYTORCH_ROCM_ARCH " " ROCM_PROPERTY_ARCH_LIST)
set_target_properties(${test_name} PROPERTIES HIP_ARCHITECTURES ROCM_PROPERTY_ARCH_LIST) set_target_properties(${test_name} PROPERTIES HIP_ARCHITECTURES ${ROCM_PROPERTY_ARCH_LIST})
else() else()
add_executable(${test_name} "${test_src}") add_executable(${test_name} "${test_src}")
endif() endif()