From 6d17276502e517a7d37702703929514ee7ad6c82 Mon Sep 17 00:00:00 2001 From: Estevan Vedovelli Date: Wed, 22 Oct 2025 11:38:06 -0400 Subject: [PATCH 1/2] Consult hipTensor to determine if an arch is supported when building their examples --- Libraries/hipTensor/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/hipTensor/CMakeLists.txt b/Libraries/hipTensor/CMakeLists.txt index 218d78513..1de6d013d 100644 --- a/Libraries/hipTensor/CMakeLists.txt +++ b/Libraries/hipTensor/CMakeLists.txt @@ -27,18 +27,19 @@ include(CTest) file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) - message(STATUS "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) + message(WARNING "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") return() endif() endforeach() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -50,7 +51,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor) if(NOT hiptensor_FOUND) message( STATUS From 717b14494d535463b9c325c55623ddeda09f2c7e Mon Sep 17 00:00:00 2001 From: Estevan Vedovelli Date: Wed, 22 Oct 2025 16:06:04 -0400 Subject: [PATCH 2/2] Update all the CMakeLists for hipTensor with hiptensor_is_supported_architecture --- .../contraction/bilinear/bf16_f32/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/cf32_cf32/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/f16_f32/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/f32_bf16/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/f32_f16/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/f32_f32/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/f64_f32/CMakeLists.txt | 11 +++++------ .../contraction/bilinear/f64_f64/CMakeLists.txt | 11 +++++------ .../contraction/scale/bf16_f32/CMakeLists.txt | 11 +++++------ .../contraction/scale/cf32_cf32/CMakeLists.txt | 11 +++++------ .../contraction/scale/f16_f32/CMakeLists.txt | 11 +++++------ .../contraction/scale/f32_bf16/CMakeLists.txt | 11 +++++------ .../contraction/scale/f32_f16/CMakeLists.txt | 11 +++++------ .../contraction/scale/f32_f32/CMakeLists.txt | 11 +++++------ .../contraction/scale/f64_f32/CMakeLists.txt | 11 +++++------ .../contraction/scale/f64_f64/CMakeLists.txt | 11 +++++------ Libraries/hipTensor/elementwise/binary/CMakeLists.txt | 11 +++++------ .../hipTensor/elementwise/permute/CMakeLists.txt | 11 +++++------ .../hipTensor/elementwise/trinary/CMakeLists.txt | 11 +++++------ Libraries/hipTensor/reduction/CMakeLists.txt | 11 +++++------ 20 files changed, 100 insertions(+), 120 deletions(-) diff --git a/Libraries/hipTensor/contraction/bilinear/bf16_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/bf16_f32/CMakeLists.txt index ee2baca9e..a588f60ee 100644 --- a/Libraries/hipTensor/contraction/bilinear/bf16_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/bf16_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/cf32_cf32/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/cf32_cf32/CMakeLists.txt index be1a3c07e..4354fc777 100644 --- a/Libraries/hipTensor/contraction/bilinear/cf32_cf32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/cf32_cf32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/f16_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/f16_f32/CMakeLists.txt index 246a8102b..8060c3d27 100644 --- a/Libraries/hipTensor/contraction/bilinear/f16_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/f16_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/f32_bf16/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/f32_bf16/CMakeLists.txt index 1cc912afe..dccf4a2b7 100644 --- a/Libraries/hipTensor/contraction/bilinear/f32_bf16/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/f32_bf16/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/f32_f16/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/f32_f16/CMakeLists.txt index 6d4e3803d..aa98710a8 100644 --- a/Libraries/hipTensor/contraction/bilinear/f32_f16/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/f32_f16/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/f32_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/f32_f32/CMakeLists.txt index 97423eee3..93a8db535 100644 --- a/Libraries/hipTensor/contraction/bilinear/f32_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/f32_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/f64_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/f64_f32/CMakeLists.txt index 469847644..a4a4d842f 100644 --- a/Libraries/hipTensor/contraction/bilinear/f64_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/f64_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/bilinear/f64_f64/CMakeLists.txt b/Libraries/hipTensor/contraction/bilinear/f64_f64/CMakeLists.txt index 84bc2bf60..2eae0f766 100644 --- a/Libraries/hipTensor/contraction/bilinear/f64_f64/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/bilinear/f64_f64/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/bf16_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/bf16_f32/CMakeLists.txt index 0b51d145d..a767d4043 100644 --- a/Libraries/hipTensor/contraction/scale/bf16_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/bf16_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/cf32_cf32/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/cf32_cf32/CMakeLists.txt index 7b7da2ea8..2dd0468ff 100644 --- a/Libraries/hipTensor/contraction/scale/cf32_cf32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/cf32_cf32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/f16_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/f16_f32/CMakeLists.txt index 54f4b450f..9ed02520d 100644 --- a/Libraries/hipTensor/contraction/scale/f16_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/f16_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/f32_bf16/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/f32_bf16/CMakeLists.txt index e456dd794..9a79c1c91 100644 --- a/Libraries/hipTensor/contraction/scale/f32_bf16/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/f32_bf16/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/f32_f16/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/f32_f16/CMakeLists.txt index ce95347fb..9cbaab011 100644 --- a/Libraries/hipTensor/contraction/scale/f32_f16/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/f32_f16/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/f32_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/f32_f32/CMakeLists.txt index 85209a8b5..fff61cac4 100644 --- a/Libraries/hipTensor/contraction/scale/f32_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/f32_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/f64_f32/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/f64_f32/CMakeLists.txt index 72e5818b4..9b790064e 100644 --- a/Libraries/hipTensor/contraction/scale/f64_f32/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/f64_f32/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/contraction/scale/f64_f64/CMakeLists.txt b/Libraries/hipTensor/contraction/scale/f64_f64/CMakeLists.txt index 5f137b2e2..8740b3f34 100644 --- a/Libraries/hipTensor/contraction/scale/f64_f64/CMakeLists.txt +++ b/Libraries/hipTensor/contraction/scale/f64_f64/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/elementwise/binary/CMakeLists.txt b/Libraries/hipTensor/elementwise/binary/CMakeLists.txt index f86ec9f40..bde4ce87b 100644 --- a/Libraries/hipTensor/elementwise/binary/CMakeLists.txt +++ b/Libraries/hipTensor/elementwise/binary/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/elementwise/permute/CMakeLists.txt b/Libraries/hipTensor/elementwise/permute/CMakeLists.txt index 2720eae54..3c017264d 100644 --- a/Libraries/hipTensor/elementwise/permute/CMakeLists.txt +++ b/Libraries/hipTensor/elementwise/permute/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/elementwise/trinary/CMakeLists.txt b/Libraries/hipTensor/elementwise/trinary/CMakeLists.txt index 7764e3873..6a5f082ad 100644 --- a/Libraries/hipTensor/elementwise/trinary/CMakeLists.txt +++ b/Libraries/hipTensor/elementwise/trinary/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name}) diff --git a/Libraries/hipTensor/reduction/CMakeLists.txt b/Libraries/hipTensor/reduction/CMakeLists.txt index 45c1551c2..cef611ac9 100644 --- a/Libraries/hipTensor/reduction/CMakeLists.txt +++ b/Libraries/hipTensor/reduction/CMakeLists.txt @@ -34,11 +34,12 @@ endif() enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE}) -# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support -set(HIPTENSOR_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950) +find_package(hiptensor REQUIRED) +# see https://rocm.docs.amd.com/projects/hipTensor/en/latest/install/installation.html#gpu-support foreach(ARCH ${CMAKE_HIP_ARCHITECTURES}) - if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH) + hiptensor_is_supported_architecture(${ARCH} IS_SUPPORTED) + if(NOT IS_SUPPORTED) message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples") endif() endforeach() @@ -49,7 +50,7 @@ set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON) select_hip_platform() if(CMAKE_SYSTEM_NAME MATCHES "Windows") - message(STATUS "hipTensor examples are only available on Linux") + message(WARNING "hipTensor examples are only available on Linux") return() else() set(ROCM_ROOT @@ -61,8 +62,6 @@ endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") -find_package(hiptensor REQUIRED) - add_executable(${example_name} main.cpp) # Make example runnable using ctest add_test(NAME ${example_name} COMMAND ${example_name})