Skip to content

Add system platform detection to CMake - #584

Merged
zichguan-amd merged 4 commits into
amd-stagingfrom
zichguan/wsl
Nov 19, 2026
Merged

zichguan-amd merged 4 commits into
amd-stagingfrom
zichguan/wsl

Conversation

@zichguan-amd

@zichguan-amd zichguan-amd commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

We need to distinguish between WSL, native Linux and native Windows because not all examples work on all platforms.

Technical Details

Add detect_system_platform and reject_unsupported_platform CMake functions.
Migrate existing checks to use the newly added functions.
Fix HIP compiler detection runs before the unsupported-platform guards, causing CUDA-only configurations to fail instead of skipping the callback example.

Test Plan

CMake builds locally. This PR does not change any include/exclude conditions, correctness check is not needed here.

Test Result

Added/Updated documentation?

  • Yes
  • No, does not apply to this PR.

Included Visual Studio files?

  • Yes
  • No, does not apply to this PR.

Submission Checklist

Signed-off-by: Zichuan Guan <zichuan.guan@amd.com>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Standalone configuration can cache an empty platform before project() initializes CMAKE_SYSTEM_NAME, and the DEFINED guard prevents later correction, leaving Windows exclusions and platform-specific settings disabled.

1 open issue
What changed in this PR

Adds shared CMake platform detection so ROCm examples can distinguish WSL from native Linux and Windows, and migrates existing platform checks to use it.

Changes:

  • Adds detect_system_platform and reject_unsupported_platform helpers.
  • Migrates platform checks controlling example selection, compiler workarounds, linking, and installation.
  • Replaces explicit Windows rejection errors in selected examples with the shared helper.
File Description
Tutorials/​reduction/​test/​CMakeLists.txt Migrates Windows CUDA workaround check.
Tutorials/​reduction/​example/​CMakeLists.txt Migrates Windows CUDA workaround check.
Tutorials/​reduction/​CMakeLists.txt Migrates Windows exclusion guard.
Tutorials/​reduction/​benchmark/​CMakeLists.txt Migrates Windows CUDA workaround check.
Tools/​CMakeLists.txt Migrates Windows/CUDA tools guard.
Systems/​hipFile/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​RPP/​resize/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RPP/​gamma_correction/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RPP/​flip/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RPP/​contrast/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RPP/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​RPP/​brightness/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RPP/​box_filter/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocWMMA/​CMakeLists.txt Migrates Windows OpenMP workaround check.
Libraries/​rocSPARSE/​preconditioner/​gtsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​preconditioner/​gpsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​preconditioner/​csritilu0/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​preconditioner/​csrilu0/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​preconditioner/​csric0/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​preconditioner/​bsrilu0/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​preconditioner/​bsric0/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​spsm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​spmm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​sddmm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​gemmi/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​gebsrmm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​csrsm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​csrmm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​bsrsm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_3/​bsrmm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​spsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​spmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​spitsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​gemvi/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​gebsrmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​ellmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​csrsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​csrmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​csritsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​coomv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​bsrxmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​bsrsv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_2/​bsrmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_1/​sctr/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_1/​roti/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_1/​gthr/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_1/​doti/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSPARSE/​level_1/​axpyi/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSOLVER/​syev/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSOLVER/​syev_strided_batched/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSOLVER/​syev_batched/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocSOLVER/​getf2/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocRAND/​device_api/​quasirandom_generations/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​rocRAND/​device_api/​pseudorandom_generations/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​rocRAND/​c_cpp_api/​simple_distributions_cpp/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​rocProfiler-SDK/​thread_trace/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​pc_sampling/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​openmp_target/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​intercept_table/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​external_correlation_id_request/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​counter_collection/​print_functional_counters/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​counter_collection/​device_profiling/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​counter_collection/​device_profiling_sync/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​counter_collection/​callback/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​counter_collection/​buffer/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​counter_collection/​buffer_device_serialization/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​code_object_tracing/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​code_object_isa_decode/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​rocProfiler-SDK/​api_callback_tracing/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocProfiler-SDK/​api_buffered_tracing/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocPRIM/​device_sum/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​rocPRIM/​block_sum/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​rocJPEG/​rocjpeg_decode/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocJPEG/​rocjpeg_decode_perf/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocJPEG/​rocjpeg_decode_batched/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocJPEG/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​rocFFT/​real_complex/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocFFT/​complex_real/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocFFT/​complex_complex/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocDecode/​video_to_sequence/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_rgb/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_raw/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_pic_files/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_perf/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_multi_files/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_mem/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_caps/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​video_decode_batch/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​rocdec_decode/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocDecode/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​rocCV/​warp_perspective/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​normalize/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​gamma_contrast/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​custom_crop/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​cropandresize/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​copy_make_border/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​composite/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​rocCV/​center_crop/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​bnd_box/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocCV/​bilateral_filter/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocBLAS/​level_3/​gemm/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_3/​gemm_strided_batched/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_2/​her/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_2/​gemv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_1/​swap/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_1/​scal/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_1/​nrm2/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_1/​dot/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocBLAS/​level_1/​axpy/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​rocALUTION/​var_precond/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​ua_amg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​tns/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​stencil/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​simple_spmv/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​sa_amg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​power_method/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​mixed_precision/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​me_preconditioner/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​key/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​itsolve/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​idr/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​gmres/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​fixed_point/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​fgmres/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​fcg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​direct/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​complex/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​cmk/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​rocALUTION/​cg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​cg_saamg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​cg_rsamg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​cg_amg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​block_precond/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​bicgstab/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​benchmark/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​async/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​as_precond/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocALUTION/​amg/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocAL/​video/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocAL/​image_augmentation/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocAL/​dataloader/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​rocAL/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​rocAL/​basic/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​send_recv/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​reducescatter/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​reduce/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​gradient_allreduce/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​device_api/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​RCCL/​buffer_registration/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​broadcast/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​allreduce/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​RCCL/​allgather/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIVisionX/​opencv_orb/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIVisionX/​mv_objdetect/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIVisionX/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​MIVisionX/​canny/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​vision/​cpp_mnist/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​migraphx/​custom_op_rocblas_kernel/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​migraphx/​custom_op_miopen_kernel/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​migraphx/​custom_op_hip_kernel/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​migraphx/​cpp_parse_load_save/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​migraphx/​cpp_dynamic_batch/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​MIGraphX/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​hipTensor/​reduction/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​elementwise/​trinary/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​elementwise/​permute/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​elementwise/​binary/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​f64_f64/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​f64_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​f32_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​f32_f16/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​f32_bf16/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​f16_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​cf32_cf32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​scale/​bf16_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​f64_f64/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​f64_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​f32_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​f32_f16/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​f32_bf16/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​f16_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​cf32_cf32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipTensor/​contraction/​bilinear/​bf16_f32/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSPARSELt/​spmm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​hipSPARSELt/​spmm_advanced/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​hipSPARSELt/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​hipSPARSE/​hybmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSPARSE/​handle/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSPARSE/​csrmv/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSPARSE/​axpyi/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​sygvj/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​sygvd/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​syevj/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​syevj_batched/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​syevdx/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​syevd/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipSOLVER/​getrf/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipRAND/​device_api/​quasirandom_generations/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​hipRAND/​device_api/​pseudorandom_generations/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​hipRAND/​c_cpp_api/​simple_distributions_cpp/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​hipFFT/​setworkarea/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​hipFFT/​plan_z2z/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​hipFFT/​plan_many_2d_z2z/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​hipFFT/​plan_many_2d_r2c/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​hipFFT/​plan_d2z/​CMakeLists.txt Migrates Windows definitions and installation checks.
Libraries/​hipFFT/​multi_gpu/​CMakeLists.txt Migrates Windows exclusion and installation checks.
Libraries/​hipFFT/​callback/​CMakeLists.txt Migrates Windows exclusion guard.
Libraries/​hipCUB/​device_sum/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​hipCUB/​device_radix_sort/​CMakeLists.txt Migrates Windows compile-definition check.
Libraries/​hipBLASLt/​weight_swizzle_padding/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​groupedgemm_get_all_algos_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​groupedgemm_fixed_mk_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​groupedgemm_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_with_TF32/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_with_scale_a_b/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_with_scale_a_b_vector/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_with_scale_a_b_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_tuning_wgm_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_tuning_splitk_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_swizzle_b/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_swizzle_a/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_swish_bias/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_mix_precision/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_mix_precision_with_amax_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_mix_precision_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_is_tuned_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_get_all_algos/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_get_all_algos_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_get_algo_by_index_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_gelu_aux_bias/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_gelu_aux_bias_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_ext_bgradb/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_dgelu_bgradb/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_dgelu_bgradb_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_clamp_bias/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_bias/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_bias_swizzle_a_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_bias_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_bgradb/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_batched/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_batched_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_attr_tciA_tciB/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_amax/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_amax_with_scale/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_amax_with_scale_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_amax_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​gemm_alphavec_ext/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​ext_op_layernorm/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLASLt/​ext_op_amax/​CMakeLists.txt Migrates Windows linking and installation checks.
Libraries/​hipBLAS/​scal/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipBLAS/​her/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​hipBLAS/​gemm_strided_batched/​CMakeLists.txt Migrates Windows runtime installation check.
Libraries/​ComposableKernel/​quantization/​smoothquant/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​pooling/​pool3d/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​normalization/​rmsnorm2d/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​normalization/​layernorm2d/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​normalization/​add_rmsnorm2d_rdquant/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​moe/​moe_sorting/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​moe/​moe_smoothquant/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​moe/​fused_moe/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​streamk_gemm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​grouped_gemm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​gemm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​gemm_multi_d/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​gemm_multi_abd/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​flatmm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​block_scale_gemm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​gemm/​batched_gemm/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​convolution/​grouped_convolution/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​contraction/​batched_contraction/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​CMakeLists.txt Migrates library-level Windows exclusion.
Libraries/​ComposableKernel/​basic/​reduce/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​basic/​permute/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​basic/​img2col/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​basic/​elementwise/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​basic/​copy/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​basic/​batched_transpose/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​attention/​topk_softmax/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​attention/​fmha/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​ComposableKernel/​attention/​fmha_fwd_v3/​CMakeLists.txt Migrates early Windows exclusion.
Libraries/​CMakeLists.txt Migrates Windows/CUDA library selection guard.
HIP-Doc/​Tutorials/​graph_api/​src/​CMakeLists.txt Migrates graph selection and Windows DLL checks.
HIP-Doc/​Reference/​Low-Precision-Floating-Point-Types/​low_precision_float_fp16/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Reference/​Low-Precision-Floating-Point-Types/​CMakeLists.txt Migrates FP16 platform selection.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​Virtual-Memory-Management/​virtual_memory/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​Virtual-Memory-Management/​CMakeLists.txt Migrates virtual-memory platform selection.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​Unified-Memory-Management/​static_unified_memory/​CMakeLists.txt Adds whitespace only; no behavior change.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​Unified-Memory-Management/​standard_unified_memory/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​Unified-Memory-Management/​memory_range_attributes/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​Unified-Memory-Management/​CMakeLists.txt Migrates unified-memory example selection.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​stream_ordered_memory_allocation/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​memory_pool/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​memory_pool_trim/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​memory_pool_threshold/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​memory_pool_resource_usage_statistics/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​ipc_memory_pool_shareable_handle/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​ipc_memory_pool_device_pointer/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​Memory-Management/​SOMA/​CMakeLists.txt Migrates memory-pool example selection.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​HIP-Graphs/​graph_creation/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​HIP-Graphs/​graph_capture/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Doc/​Programming-Guide/​Using-HIP-Runtime-API/​HIP-Graphs/​CMakeLists.txt Migrates graph example selection.
HIP-Basic/​llvm_ir_to_executable/​CMakeLists.txt Migrates Windows object-format and target checks.
HIP-Basic/​hipify/​CMakeLists.txt Uses shared Windows rejection helper.
HIP-Basic/​CMakeLists.txt Migrates platform paths, warnings, and example selection.
HIP-Basic/​assembly_to_executable/​CMakeLists.txt Migrates Windows object-format and target checks.
cmake/​HipPlatform.cmake Adds platform detection and rejection helpers.
Applications/​monte_carlo_pi/​CMakeLists.txt Migrates Windows compile-definition check.
Applications/​CMakeLists.txt Migrates Monte Carlo platform selection.

Review effort: Balanced

Comment thread cmake/HipPlatform.cmake Resolved
Signed-off-by: Zichuan Guan <zichuan.guan@amd.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

HIP compiler detection runs before the unsupported-platform guards, causing CUDA-only configurations to fail instead of skipping the callback example.

1 open issue
1 resolved since last review

Review effort: Balanced

Signed-off-by: Zichuan Guan <zichuan.guan@amd.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active issues cause fresh standalone rocWMMA configurations to silently omit example targets and WSL-to-Windows cross-builds to lose required Windows-specific build and runtime settings.

1 open issue
1 resolved since last review

Review effort: Balanced

Signed-off-by: Zichuan Guan <zichuan.guan@amd.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because Windows targets configured from WSL can be misclassified, bypassing Windows-specific linking and runtime installation.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@darren-amd darren-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Confirmed on Linux: top-level configure gives identical skip/status output to amd-staging. All parents of examples using reject_unsupported_platform already skip them on Windows. A Windows or WSL configure log would be good to have, since that's the only place the new detection changes anything.

@zichguan-amd
zichguan-amd added this pull request to stack #590 November 19, 2026 14:36
@zichguan-amd
zichguan-amd merged commit 1c49e30 into amd-staging Nov 19, 2026
33 of 34 checks passed
@zichguan-amd
zichguan-amd deleted the zichguan/wsl branch November 19, 2026 15:36
zichguan-amd added a commit that referenced this pull request Nov 19, 2026
## Motivation

Stacked on #584. HMM is not supported on Windows nor WSL.
`static_unified_memory` works on native Windows but errors on WSL,
although native Windows doesn't error, it is not using HMM as intended
(since Widnows doesn't support it), thus disabling it on both platforms.

`static_unified_memory` currently has no platform guard at all (unlike
its siblings `standard_unified_memory` and `memory_range_attributes`,
which already exclude Windows).


## Technical Details

- Added `reject_unsupported_platform(EXAMPLE ${example_name} EXCLUDE
Windows WSL)` to the example's own `CMakeLists.txt`, matching the
convention established in #584.
- Added a matching graceful skip (`STATUS` message, no
`add_subdirectory`) in the parent
`Unified-Memory-Management/CMakeLists.txt`.
- Removed Visual Studio project files for this example
(`static_unified_memory_vs{2017,2019,2022}.{sln,vcxproj,vcxproj.filters}`)
and their references in all 6 top-level solution files
(`ROCm-Examples(-Portable)-VS{2017,2019,2022}.sln`).
- Documented the restriction in the example's README under a new
"Prerequisites" section, matching `standard_unified_memory`'s README.

## Test Plan

- Standalone configure of `static_unified_memory` on native Linux:
succeeds as before.
- Standalone configure with `WSL_DISTRO_NAME` set (simulates WSL
detection): fails with a clear `FATAL_ERROR` naming the example and
platform.
- Root configure of `Unified-Memory-Management` with `WSL_DISTRO_NAME`
set: prints a `STATUS` skip message instead of descending into the
example, configures cleanly.
- Verified no dangling GUID references remain in any of the 6 top-level
`.sln` files after removing the per-example project files.

## Added/Updated documentation?

- [x] Yes

## Included Visual Studio files?

- [x] No, Visual Studio files were removed for this example since it's
no longer supported on Windows.

## Submission Checklist

- [x] New examples contain proper CMake and Make files.
- [ ] I have updated relevant CI workflows and the new examples are
being built and tested in CI.
- [ ] Check and guard against unsupported ASICs if relevant dependent
libraries have limited support.
- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Zichuan Guan <zichuan.guan@amd.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants