Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Libraries/hipTensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ 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)

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")
return()
endif()
endforeach()

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
message(STATUS "hipTensor examples are only available on Linux")
return()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_bf16_f32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

Choose a reason for hiding this comment

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

Ideally this list of supported arch should be set by hipTensor, and you could just lookup for the value here, right after the find_package(hiptensor), so when new architectures are supported, no changes are needed here.

I'm creating an internal ticket for hipTensor for us to provide this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you have any ETA for that? Or should I go ahead and merge the PR for now?

Choose a reason for hiding this comment

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

Go ahead and merge it, so you don't get blocked. Once it's done I can let you know, so you can change the examples, or I can submit a PR for the examples myself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good thanks!


foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_cf32_cf32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/bilinear/f16_f32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_f16_f32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_f32_bf16)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/bilinear/f32_f16/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_f32_f16)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/bilinear/f32_f32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_f32_f32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/bilinear/f64_f32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_f64_f32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/bilinear/f64_f64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_bilinear_f64_f64)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/scale/bf16_f32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_scale_bf16_f32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
27 changes: 20 additions & 7 deletions Libraries/hipTensor/contraction/scale/cf32_cf32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ set(example_name hiptensor_contraction_scale_cf32_cf32)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(${example_name} LANGUAGES CXX)

if(GPU_RUNTIME STREQUAL "CUDA")
message(STATUS "hipTensor examples do not support the CUDA runtime")
return()
include("${CMAKE_CURRENT_LIST_DIR}/../../../../../Common/HipPlatform.cmake")
select_gpu_language()

if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
message(FATAL_ERROR "hipTensor examples do not support the CUDA runtime.")
endif()

enable_language(${GPU_RUNTIME})
set(CMAKE_${GPU_RUNTIME}_STANDARD 17)
set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF)
set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON)
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)

foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
if(NOT ARCH IN_LIST HIPTENSOR_SUPPORTED_ARCH)
message(FATAL_ERROR "hipTensor does not support architecture: ${ARCH}, not building hipTensor examples")
endif()
endforeach()

set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
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")
Expand Down
Loading