diff --git a/.gersemirc b/.gersemirc new file mode 100644 index 00000000..0e7c5386 --- /dev/null +++ b/.gersemirc @@ -0,0 +1,10 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json + +color: false +definitions: [] +indent: 4 +line_length: 80 +list_expansion: favour-inlining +quiet: false +unsafe: false +workers: 12 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 9cb20094..b7b83c37 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -3,16 +3,35 @@ name: Linting on: push: branches: - - develop - - main - - 'release/rocm-rel*' + - develop + - main + - 'release/rocm-rel*' pull_request: branches: - - develop - - main - - 'release/roc-rel*' + - develop + - main + - 'release/rocm-rel*' jobs: call-workflow-passing-data: name: Documentation uses: ROCm/rocm-docs-core/.github/workflows/linting.yml@develop + + cmake-formatting: + name: CMake File Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y python3-pip + python3 -m pip install gersemi + - name: Run gersemi + run: | + gersemi --check . + if [ $? -ne 0 ]; then + echo "CMake files are not formatted correctly. Please run gersemi ..." + echo "For example: \`gersemi -i .\`" + exit 1 + fi diff --git a/Applications/bitonic_sort/CMakeLists.txt b/Applications/bitonic_sort/CMakeLists.txt index 9a3cf182..8c30f36c 100644 --- a/Applications/bitonic_sort/CMakeLists.txt +++ b/Applications/bitonic_sort/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/convolution/CMakeLists.txt b/Applications/convolution/CMakeLists.txt index d60ca677..370c1bae 100644 --- a/Applications/convolution/CMakeLists.txt +++ b/Applications/convolution/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/floyd_warshall/CMakeLists.txt b/Applications/floyd_warshall/CMakeLists.txt index 92aba905..f665ae2d 100644 --- a/Applications/floyd_warshall/CMakeLists.txt +++ b/Applications/floyd_warshall/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/histogram/CMakeLists.txt b/Applications/histogram/CMakeLists.txt index fe0f43eb..ba79ccc6 100644 --- a/Applications/histogram/CMakeLists.txt +++ b/Applications/histogram/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/monte_carlo_pi/CMakeLists.txt b/Applications/monte_carlo_pi/CMakeLists.txt index 8ee0fd9a..094437c1 100644 --- a/Applications/monte_carlo_pi/CMakeLists.txt +++ b/Applications/monte_carlo_pi/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -39,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/prefix_sum/CMakeLists.txt b/Applications/prefix_sum/CMakeLists.txt index f75db53d..9e3f3789 100644 --- a/Applications/prefix_sum/CMakeLists.txt +++ b/Applications/prefix_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/CMakeLists.txt b/HIP-Basic/CMakeLists.txt index 02f1f0eb..5ba678e4 100644 --- a/HIP-Basic/CMakeLists.txt +++ b/HIP-Basic/CMakeLists.txt @@ -25,49 +25,64 @@ project(HIP-Basic LANGUAGES CXX) # ROCm installation path if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() # Only supported on HIP (not CUDA) if(NOT "${GPU_RUNTIME}" STREQUAL "CUDA") - # Make sure the dependencies can be found before building. find_program( - LLVM_DIS_COMMAND llvm-dis + LLVM_DIS_COMMAND + llvm-dis PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + ) find_program( - OFFLOAD_BUNDLER_COMMAND clang-offload-bundler + OFFLOAD_BUNDLER_COMMAND + clang-offload-bundler PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + ) find_program( - LLVM_MC_COMMAND llvm-mc + LLVM_MC_COMMAND + llvm-mc PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + ) if(LLVM_DIS_COMMAND AND OFFLOAD_BUNDLER_COMMAND AND LLVM_MC_COMMAND) - add_subdirectory(llvm_ir_to_executable) - else() - message("'llvm-dis', 'llvm-mc', or 'clang-offload-bundler' not found, not building assembly example.") + add_subdirectory(llvm_ir_to_executable) + else() + message( + "'llvm-dis', 'llvm-mc', or 'clang-offload-bundler' not found, not building assembly example." + ) if(NOT WIN32) - message(" These tools can be found in the 'rocm-llvm-dev' package.") + message( + " These tools can be found in the 'rocm-llvm-dev' package." + ) endif() endif() if(OFFLOAD_BUNDLER_COMMAND AND LLVM_MC_COMMAND) add_subdirectory(assembly_to_executable) else() - message("'llvm-mc' or 'clang-offload-bundler' not found, not building LLVM IR example.") + message( + "'llvm-mc' or 'clang-offload-bundler' not found, not building LLVM IR example." + ) if(NOT WIN32) - message(" These tools can be found in the 'rocm-llvm-dev' package.") + message( + " These tools can be found in the 'rocm-llvm-dev' package." + ) endif() endif() diff --git a/HIP-Basic/assembly_to_executable/CMakeLists.txt b/HIP-Basic/assembly_to_executable/CMakeLists.txt index 228a3fb4..74162734 100644 --- a/HIP-Basic/assembly_to_executable/CMakeLists.txt +++ b/HIP-Basic/assembly_to_executable/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,9 @@ set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") # Only supported on HIP (not CUDA) if(NOT "${GPU_RUNTIME}" STREQUAL "HIP") - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be HIP.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be HIP." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -39,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -49,18 +59,30 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") if(NOT DEFINED CMAKE_HIP_ARCHITECTURES) set(GPU_ARCHITECTURES "all" CACHE STRING "GPU architectures to compile for") else() - set(GPU_ARCHITECTURES "${CMAKE_HIP_ARCHITECTURES}" CACHE STRING "GPU architectures to compile for") + set(GPU_ARCHITECTURES + "${CMAKE_HIP_ARCHITECTURES}" + CACHE STRING + "GPU architectures to compile for" + ) endif() if(GPU_ARCHITECTURES STREQUAL "all") - set(GPU_ARCHITECTURES "gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102" CACHE STRING "GPU architectures to compile for" FORCE) + set(GPU_ARCHITECTURES + "gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102" + CACHE STRING + "GPU architectures to compile for" + FORCE + ) endif() # Remove duplicates. list(REMOVE_DUPLICATES GPU_ARCHITECTURES) message(STATUS "GPU_ARCHITECTURES: ${GPU_ARCHITECTURES}") -set_source_files_properties(main.hip PROPERTIES COMPILE_OPTIONS "--cuda-host-only") +set_source_files_properties( + main.hip + PROPERTIES COMPILE_OPTIONS "--cuda-host-only" +) if(WIN32) set(OBJ_TYPE obj) @@ -81,22 +103,24 @@ foreach(HIP_ARCHITECTURE ${GPU_ARCHITECTURES}) add_custom_command( OUTPUT main_${HIP_ARCHITECTURE}.${OBJ_TYPE} COMMAND - ${CMAKE_HIP_COMPILER} -fPIC -target amdgcn-amd-amdhsa -mcpu=${HIP_ARCHITECTURE} - ${CMAKE_CURRENT_SOURCE_DIR}/main_${HIP_ARCHITECTURE}.s - -o ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} + ${CMAKE_HIP_COMPILER} -fPIC -target amdgcn-amd-amdhsa + -mcpu=${HIP_ARCHITECTURE} + ${CMAKE_CURRENT_SOURCE_DIR}/main_${HIP_ARCHITECTURE}.s -o + ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main_${HIP_ARCHITECTURE}.s VERBATIM - COMMENT "Compiling ASM main_${HIP_ARCHITECTURE}.${OBJ_TYPE}") + COMMENT "Compiling ASM main_${HIP_ARCHITECTURE}.${OBJ_TYPE}" + ) endforeach() # Create an offload-bundle from the assembled object files. This needs the clang-offload-bundler tool. find_program( - OFFLOAD_BUNDLER_COMMAND clang-offload-bundler + OFFLOAD_BUNDLER_COMMAND + clang-offload-bundler PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm - REQUIRED) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + REQUIRED +) # Generate object bundle. # The invocation to generate is @@ -110,9 +134,19 @@ set(BUNDLE_INPUTS "-input=${NULDEV}") # Generate BUNDLE_OBJECTS as a string of: ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} set(BUNDLE_OBJECTS "") foreach(HIP_ARCHITECTURE ${GPU_ARCHITECTURES}) - set(BUNDLE_TARGETS "${BUNDLE_TARGETS},hipv4-amdgcn-amd-amdhsa--${HIP_ARCHITECTURE}") - list(APPEND BUNDLE_INPUTS "-input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}") - list(APPEND BUNDLE_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}") + set(BUNDLE_TARGETS + "${BUNDLE_TARGETS},hipv4-amdgcn-amd-amdhsa--${HIP_ARCHITECTURE}" + ) + list( + APPEND + BUNDLE_INPUTS + "-input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}" + ) + list( + APPEND + BUNDLE_OBJECTS + "${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}" + ) endforeach() # Invoke clang-offload-bundler to generate an offload bundle. @@ -120,46 +154,39 @@ set(BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/offload_bundle.hipfb") add_custom_command( OUTPUT "${BUNDLE}" COMMAND - "${OFFLOAD_BUNDLER_COMMAND}" - -type=o - -bundle-align=4096 - "${BUNDLE_TARGETS}" - ${BUNDLE_INPUTS} - "-output=${BUNDLE}" + "${OFFLOAD_BUNDLER_COMMAND}" -type=o -bundle-align=4096 + "${BUNDLE_TARGETS}" ${BUNDLE_INPUTS} "-output=${BUNDLE}" DEPENDS ${BUNDLE_OBJECTS} VERBATIM - COMMENT "Bundling fat binary ${BUNDLE}") + COMMENT "Bundling fat binary ${BUNDLE}" +) # Create the device binary by assembling the template that includes # the offload bundle that was just generated using an .incbin directive. # This needs an assembler. find_program( - LLVM_MC_COMMAND llvm-mc + LLVM_MC_COMMAND + llvm-mc PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm - REQUIRED) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + REQUIRED +) # Invoke llvm-mc to generate an object file containing the offload bundle. set(DEVICE_OBJECT "${CMAKE_CURRENT_BINARY_DIR}/main_device.${OBJ_TYPE}") add_custom_command( OUTPUT "${DEVICE_OBJECT}" COMMAND - "${LLVM_MC_COMMAND}" - -triple "${HOST_TARGET}" - "${CMAKE_CURRENT_SOURCE_DIR}/${HIP_OBJ_GEN_FILE}" - -o "${DEVICE_OBJECT}" + "${LLVM_MC_COMMAND}" -triple "${HOST_TARGET}" + "${CMAKE_CURRENT_SOURCE_DIR}/${HIP_OBJ_GEN_FILE}" -o "${DEVICE_OBJECT}" --filetype=obj DEPENDS "${BUNDLE}" VERBATIM - COMMENT "Bundling object ${DEVICE_OBJECT}") + COMMENT "Bundling object ${DEVICE_OBJECT}" +) # Finally, create the executable. -add_executable( - ${example_name} - main.hip - ${DEVICE_OBJECT}) +add_executable(${example_name} main.hip ${DEVICE_OBJECT}) # Make example runnable using ctest. add_test(${example_name} ${example_name}) diff --git a/HIP-Basic/bandwidth/CMakeLists.txt b/HIP-Basic/bandwidth/CMakeLists.txt index aec3d62b..4a82b260 100644 --- a/HIP-Basic/bandwidth/CMakeLists.txt +++ b/HIP-Basic/bandwidth/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/bit_extract/CMakeLists.txt b/HIP-Basic/bit_extract/CMakeLists.txt index 907b316c..c31135d6 100644 --- a/HIP-Basic/bit_extract/CMakeLists.txt +++ b/HIP-Basic/bit_extract/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/cooperative_groups/CMakeLists.txt b/HIP-Basic/cooperative_groups/CMakeLists.txt index fd7bc4d6..2ab7adf5 100644 --- a/HIP-Basic/cooperative_groups/CMakeLists.txt +++ b/HIP-Basic/cooperative_groups/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -56,7 +66,10 @@ if(GPU_RUNTIME STREQUAL "CUDA") list(APPEND include_dirs "${ROCM_ROOT}/include") else() # Add NDEBUG for HIP version >= 5.5 and < 6.0 due to a known bug in the cooperative groups header - if( ${hip-lang_VERSION} VERSION_GREATER_EQUAL 5.5 AND ${hip-lang_VERSION} VERSION_LESS 6 ) + if( + ${hip-lang_VERSION} VERSION_GREATER_EQUAL 5.5 + AND ${hip-lang_VERSION} VERSION_LESS 6 + ) add_compile_definitions(NDEBUG) endif() endif() diff --git a/HIP-Basic/device_globals/CMakeLists.txt b/HIP-Basic/device_globals/CMakeLists.txt index c4031a9e..3bf78979 100644 --- a/HIP-Basic/device_globals/CMakeLists.txt +++ b/HIP-Basic/device_globals/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/device_query/CMakeLists.txt b/HIP-Basic/device_query/CMakeLists.txt index ff6013b6..f9e8b53f 100644 --- a/HIP-Basic/device_query/CMakeLists.txt +++ b/HIP-Basic/device_query/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -47,9 +49,17 @@ set(CMAKE_${USED_LANGUAGE}_EXTENSIONS OFF) set(CMAKE_${USED_LANGUAGE}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/dynamic_shared/CMakeLists.txt b/HIP-Basic/dynamic_shared/CMakeLists.txt index 7b3dc72e..e26f2363 100644 --- a/HIP-Basic/dynamic_shared/CMakeLists.txt +++ b/HIP-Basic/dynamic_shared/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/events/CMakeLists.txt b/HIP-Basic/events/CMakeLists.txt index 260a8231..219bd7ca 100644 --- a/HIP-Basic/events/CMakeLists.txt +++ b/HIP-Basic/events/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/gpu_arch/CMakeLists.txt b/HIP-Basic/gpu_arch/CMakeLists.txt index 0432a000..fd941b54 100644 --- a/HIP-Basic/gpu_arch/CMakeLists.txt +++ b/HIP-Basic/gpu_arch/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/hello_world/CMakeLists.txt b/HIP-Basic/hello_world/CMakeLists.txt index 54b981ad..18dbceb0 100644 --- a/HIP-Basic/hello_world/CMakeLists.txt +++ b/HIP-Basic/hello_world/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/hello_world_cuda/CMakeLists.txt b/HIP-Basic/hello_world_cuda/CMakeLists.txt index 36b696cf..f221ec64 100644 --- a/HIP-Basic/hello_world_cuda/CMakeLists.txt +++ b/HIP-Basic/hello_world_cuda/CMakeLists.txt @@ -29,9 +29,17 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CUDA) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() add_executable(${example_name} main.hip) @@ -40,9 +48,10 @@ add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) # Make the HIP runtime headers accessible -target_include_directories(${example_name} PRIVATE - "${ROCM_ROOT}/include" - "${CMAKE_CURRENT_SOURCE_DIR}/../../Common") +target_include_directories( + ${example_name} + PRIVATE "${ROCM_ROOT}/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../Common" +) # Set up the compilation language for the source file. # Usually this can be deduced from the file extension, but not in the case of .hip. diff --git a/HIP-Basic/hipify/CMakeLists.txt b/HIP-Basic/hipify/CMakeLists.txt index e8182d1a..23588c00 100644 --- a/HIP-Basic/hipify/CMakeLists.txt +++ b/HIP-Basic/hipify/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,10 @@ set(example_name hip_hipify) if(WIN32) - message(FATAL_ERROR "The hipify example currently does not support Windows.") + message( + FATAL_ERROR + "The hipify example currently does not support Windows." + ) endif() find_package(Perl REQUIRED) @@ -36,7 +39,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -46,20 +51,31 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") # create main.hip add_custom_command( - OUTPUT main.hip - COMMAND ${PERL_EXECUTABLE} ${ROCM_ROOT}/bin/hipify-perl ${CMAKE_CURRENT_SOURCE_DIR}/main.cu - -o ${CMAKE_CURRENT_BINARY_DIR}/main.hip - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main.cu - VERBATIM) + OUTPUT main.hip + COMMAND + ${PERL_EXECUTABLE} ${ROCM_ROOT}/bin/hipify-perl + ${CMAKE_CURRENT_SOURCE_DIR}/main.cu -o + ${CMAKE_CURRENT_BINARY_DIR}/main.hip + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main.cu + VERBATIM +) add_executable(${example_name} ${CMAKE_CURRENT_BINARY_DIR}/main.hip) # Make example runnable using ctest diff --git a/HIP-Basic/inline_assembly/CMakeLists.txt b/HIP-Basic/inline_assembly/CMakeLists.txt index 641c8f26..3f641217 100644 --- a/HIP-Basic/inline_assembly/CMakeLists.txt +++ b/HIP-Basic/inline_assembly/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/llvm_ir_to_executable/CMakeLists.txt b/HIP-Basic/llvm_ir_to_executable/CMakeLists.txt index 45350de4..25b32762 100644 --- a/HIP-Basic/llvm_ir_to_executable/CMakeLists.txt +++ b/HIP-Basic/llvm_ir_to_executable/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,9 @@ set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") # Only supported on HIP (not CUDA) if(NOT "${GPU_RUNTIME}" STREQUAL "HIP") - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be HIP.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be HIP." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -39,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -49,40 +59,55 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") if(NOT DEFINED CMAKE_HIP_ARCHITECTURES) set(GPU_ARCHITECTURES "all" CACHE STRING "GPU architectures to compile for") else() - set(GPU_ARCHITECTURES "${CMAKE_HIP_ARCHITECTURES}" CACHE STRING "GPU architectures to compile for") + set(GPU_ARCHITECTURES + "${CMAKE_HIP_ARCHITECTURES}" + CACHE STRING + "GPU architectures to compile for" + ) endif() if(GPU_ARCHITECTURES STREQUAL "all") - set(GPU_ARCHITECTURES "gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102" CACHE STRING "GPU architectures to compile for" FORCE) + set(GPU_ARCHITECTURES + "gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102" + CACHE STRING + "GPU architectures to compile for" + FORCE + ) endif() # Remove duplicates list(REMOVE_DUPLICATES GPU_ARCHITECTURES) message(STATUS "GPU_ARCHITECTURES: ${GPU_ARCHITECTURES}") -set_source_files_properties(main.hip PROPERTIES COMPILE_OPTIONS "--cuda-host-only") +set_source_files_properties( + main.hip + PROPERTIES COMPILE_OPTIONS "--cuda-host-only" +) find_program( - LLVM_DIS_COMMAND llvm-dis - PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm - REQUIRED) + LLVM_DIS_COMMAND + llvm-dis + PATH_SUFFIXES bin + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + REQUIRED +) # Generate the device LLVM IR using the HIP compiler. foreach(HIP_ARCHITECTURE ${GPU_ARCHITECTURES}) add_custom_command( - OUTPUT main_${HIP_ARCHITECTURE}.ll main_${HIP_ARCHITECTURE}.bc - COMMAND - ${CMAKE_HIP_COMPILER} --cuda-device-only -c -emit-llvm ${CMAKE_CURRENT_SOURCE_DIR}/main.hip - --offload-arch=${HIP_ARCHITECTURE} -o main_${HIP_ARCHITECTURE}.bc - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../Common -std=c++17 - COMMAND - ${LLVM_DIS_COMMAND} main_${HIP_ARCHITECTURE}.bc -o main_${HIP_ARCHITECTURE}.ll - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main.hip - VERBATIM - COMMENT "Generating main_${HIP_ARCHITECTURE}.ll") + OUTPUT main_${HIP_ARCHITECTURE}.ll main_${HIP_ARCHITECTURE}.bc + COMMAND + ${CMAKE_HIP_COMPILER} --cuda-device-only -c -emit-llvm + ${CMAKE_CURRENT_SOURCE_DIR}/main.hip + --offload-arch=${HIP_ARCHITECTURE} -o main_${HIP_ARCHITECTURE}.bc -I + ${CMAKE_CURRENT_SOURCE_DIR}/../../Common -std=c++17 + COMMAND + ${LLVM_DIS_COMMAND} main_${HIP_ARCHITECTURE}.bc -o + main_${HIP_ARCHITECTURE}.ll + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main.hip + VERBATIM + COMMENT "Generating main_${HIP_ARCHITECTURE}.ll" + ) endforeach() if(WIN32) @@ -104,21 +129,23 @@ foreach(HIP_ARCHITECTURE ${GPU_ARCHITECTURES}) add_custom_command( OUTPUT main_${HIP_ARCHITECTURE}.${OBJ_TYPE} COMMAND - ${CMAKE_HIP_COMPILER} -fPIC -target amdgcn-amd-amdhsa -mcpu=${HIP_ARCHITECTURE} main_${HIP_ARCHITECTURE}.ll - -o ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} + ${CMAKE_HIP_COMPILER} -fPIC -target amdgcn-amd-amdhsa + -mcpu=${HIP_ARCHITECTURE} main_${HIP_ARCHITECTURE}.ll -o + ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} DEPENDS main_${HIP_ARCHITECTURE}.ll VERBATIM - COMMENT "Generating main_${HIP_ARCHITECTURE}.${OBJ_TYPE}") + COMMENT "Generating main_${HIP_ARCHITECTURE}.${OBJ_TYPE}" + ) endforeach() # Create an offload-bundle from the assembled object files. This needs the clang-offload-bundler tool. find_program( - OFFLOAD_BUNDLER_COMMAND clang-offload-bundler + OFFLOAD_BUNDLER_COMMAND + clang-offload-bundler PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm - REQUIRED) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + REQUIRED +) # Generate object bundle. # The invocation to generate is @@ -132,9 +159,19 @@ set(BUNDLE_INPUTS "-input=${NULDEV}") # Generate BUNDLE_OBJECTS as a string of: ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} set(BUNDLE_OBJECTS "") foreach(HIP_ARCHITECTURE ${GPU_ARCHITECTURES}) - set(BUNDLE_TARGETS "${BUNDLE_TARGETS},hipv4-amdgcn-amd-amdhsa--${HIP_ARCHITECTURE}") - list(APPEND BUNDLE_INPUTS "-input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}") - list(APPEND BUNDLE_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}") + set(BUNDLE_TARGETS + "${BUNDLE_TARGETS},hipv4-amdgcn-amd-amdhsa--${HIP_ARCHITECTURE}" + ) + list( + APPEND + BUNDLE_INPUTS + "-input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}" + ) + list( + APPEND + BUNDLE_OBJECTS + "${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE}" + ) endforeach() # Invoke clang-offload-bundler to generate an offload bundle. @@ -142,44 +179,37 @@ set(BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/offload_bundle.hipfb") add_custom_command( OUTPUT "${BUNDLE}" COMMAND - "${OFFLOAD_BUNDLER_COMMAND}" - -type=o - -bundle-align=4096 - "${BUNDLE_TARGETS}" - ${BUNDLE_INPUTS} - "-output=${BUNDLE}" + "${OFFLOAD_BUNDLER_COMMAND}" -type=o -bundle-align=4096 + "${BUNDLE_TARGETS}" ${BUNDLE_INPUTS} "-output=${BUNDLE}" DEPENDS ${BUNDLE_OBJECTS} - VERBATIM) + VERBATIM +) # Create the device binary by assembling the template that includes # the offload bundle that was just generated using an .incbin directive. # This needs an assembler. find_program( - LLVM_MC_COMMAND llvm-mc + LLVM_MC_COMMAND + llvm-mc PATH_SUFFIXES bin - PATHS - ${ROCM_ROOT}/llvm - ${CMAKE_INSTALL_PREFIX}/llvm - REQUIRED) + PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm + REQUIRED +) # Invoke llvm-mc to generate an object file containing the offload bundle. set(DEVICE_OBJECT "${CMAKE_CURRENT_BINARY_DIR}/main_device.${OBJ_TYPE}") add_custom_command( OUTPUT "${DEVICE_OBJECT}" COMMAND - "${LLVM_MC_COMMAND}" - -triple "${HOST_TARGET}" - "${CMAKE_CURRENT_SOURCE_DIR}/${HIP_OBJ_GEN_FILE}" - -o "${DEVICE_OBJECT}" + "${LLVM_MC_COMMAND}" -triple "${HOST_TARGET}" + "${CMAKE_CURRENT_SOURCE_DIR}/${HIP_OBJ_GEN_FILE}" -o "${DEVICE_OBJECT}" --filetype=obj DEPENDS "${BUNDLE}" - VERBATIM) + VERBATIM +) # Finally, create the executable. -add_executable( - ${example_name} - main.hip - ${DEVICE_OBJECT}) +add_executable(${example_name} main.hip ${DEVICE_OBJECT}) # Make example runnable using ctest add_test(${example_name} ${example_name}) diff --git a/HIP-Basic/matrix_multiplication/CMakeLists.txt b/HIP-Basic/matrix_multiplication/CMakeLists.txt index 61cb2735..2f08e785 100644 --- a/HIP-Basic/matrix_multiplication/CMakeLists.txt +++ b/HIP-Basic/matrix_multiplication/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/module_api/CMakeLists.txt b/HIP-Basic/module_api/CMakeLists.txt index 35d9daff..e5dd87f2 100644 --- a/HIP-Basic/module_api/CMakeLists.txt +++ b/HIP-Basic/module_api/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,9 @@ set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") # Only supported on HIP (not CUDA) if(NOT "${GPU_RUNTIME}" STREQUAL "HIP") - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be HIP.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be HIP." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -39,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -62,12 +72,15 @@ target_compile_options(${example_name}_module PRIVATE --cuda-device-only) # Copy the code object next to the executable add_custom_command( - TARGET ${example_name} + TARGET ${example_name} POST_BUILD COMMAND "${CMAKE_COMMAND}" - ARGS -E copy $ $/module.co + ARGS + -E copy $ + $/module.co COMMAND_EXPAND_LISTS - COMMENT "Copying HIP code object for ${example_name}") + COMMENT "Copying HIP code object for ${example_name}" +) add_dependencies(${example_name} ${example_name}_module) # Make example runnable using ctest diff --git a/HIP-Basic/moving_average/CMakeLists.txt b/HIP-Basic/moving_average/CMakeLists.txt index 964b7ee6..0cac544d 100644 --- a/HIP-Basic/moving_average/CMakeLists.txt +++ b/HIP-Basic/moving_average/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/multi_gpu_data_transfer/CMakeLists.txt b/HIP-Basic/multi_gpu_data_transfer/CMakeLists.txt index f52ad8ef..90df9151 100644 --- a/HIP-Basic/multi_gpu_data_transfer/CMakeLists.txt +++ b/HIP-Basic/multi_gpu_data_transfer/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/occupancy/CMakeLists.txt b/HIP-Basic/occupancy/CMakeLists.txt index 21f69581..43118c5c 100644 --- a/HIP-Basic/occupancy/CMakeLists.txt +++ b/HIP-Basic/occupancy/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/opengl_interop/CMakeLists.txt b/HIP-Basic/opengl_interop/CMakeLists.txt index f334a1bd..41a791bf 100644 --- a/HIP-Basic/opengl_interop/CMakeLists.txt +++ b/HIP-Basic/opengl_interop/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/runtime_compilation/CMakeLists.txt b/HIP-Basic/runtime_compilation/CMakeLists.txt index 4dc7843e..95f33728 100644 --- a/HIP-Basic/runtime_compilation/CMakeLists.txt +++ b/HIP-Basic/runtime_compilation/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/saxpy/CMakeLists.txt b/HIP-Basic/saxpy/CMakeLists.txt index 5f2e123e..9fe73cd3 100644 --- a/HIP-Basic/saxpy/CMakeLists.txt +++ b/HIP-Basic/saxpy/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/shared_memory/CMakeLists.txt b/HIP-Basic/shared_memory/CMakeLists.txt index 3dfa6ea8..dbdf3ae6 100644 --- a/HIP-Basic/shared_memory/CMakeLists.txt +++ b/HIP-Basic/shared_memory/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/static_host_library/CMakeLists.txt b/HIP-Basic/static_host_library/CMakeLists.txt index f42d103f..475c9bcb 100644 --- a/HIP-Basic/static_host_library/CMakeLists.txt +++ b/HIP-Basic/static_host_library/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -60,7 +70,10 @@ add_library(${library_name} STATIC library/library.hip) target_include_directories(${library_name} PRIVATE ${include_dirs}) target_include_directories(${library_name} PUBLIC library) set_target_properties(${library_name} PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_source_files_properties(library/library.hip PROPERTIES LANGUAGE ${GPU_RUNTIME}) +set_source_files_properties( + library/library.hip + PROPERTIES LANGUAGE ${GPU_RUNTIME} +) # Create a driver executable using ROCm's bundled version of clang. add_executable(${example_name} main.cpp) diff --git a/HIP-Basic/streams/CMakeLists.txt b/HIP-Basic/streams/CMakeLists.txt index 007726ea..6b2ed19b 100644 --- a/HIP-Basic/streams/CMakeLists.txt +++ b/HIP-Basic/streams/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/texture_management/CMakeLists.txt b/HIP-Basic/texture_management/CMakeLists.txt index 0df400a2..e9f2f567 100644 --- a/HIP-Basic/texture_management/CMakeLists.txt +++ b/HIP-Basic/texture_management/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -53,7 +63,10 @@ add_test(${example_name} ${example_name}) # Temporary workaround: a known bug prevents the example from executing succesfully # if multiple GPUs are visible -set_tests_properties(${example_name} PROPERTIES ENVIRONMENT "HIP_VISIBLE_DEVICES=0") +set_tests_properties( + ${example_name} + PROPERTIES ENVIRONMENT "HIP_VISIBLE_DEVICES=0" +) set(include_dirs "../../Common") if(GPU_RUNTIME STREQUAL "CUDA") diff --git a/HIP-Basic/vulkan_interop/CMakeLists.txt b/HIP-Basic/vulkan_interop/CMakeLists.txt index b590a4b3..6a18e448 100644 --- a/HIP-Basic/vulkan_interop/CMakeLists.txt +++ b/HIP-Basic/vulkan_interop/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -61,19 +71,30 @@ set(SHADER_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") add_custom_command( OUTPUT "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" - COMMAND ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} -V100 --vn sinewave_vert -o "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" "${CMAKE_CURRENT_SOURCE_DIR}/sinewave.vert" + COMMAND + ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} -V100 --vn sinewave_vert -o + "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" + "${CMAKE_CURRENT_SOURCE_DIR}/sinewave.vert" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/sinewave.vert" COMMENT "Compiling vertex shader" ) add_custom_command( OUTPUT "${SHADER_BINARY_DIR}/sinewave.frag.spv.h" - COMMAND ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} -V100 --vn sinewave_frag -o "${SHADER_BINARY_DIR}/sinewave.frag.spv.h" "${CMAKE_CURRENT_SOURCE_DIR}/sinewave.frag" + COMMAND + ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} -V100 --vn sinewave_frag -o + "${SHADER_BINARY_DIR}/sinewave.frag.spv.h" + "${CMAKE_CURRENT_SOURCE_DIR}/sinewave.frag" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/sinewave.frag" COMMENT "Compiling fragment shader" ) -add_custom_target(shaders DEPENDS "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" "${SHADER_BINARY_DIR}/sinewave.frag.spv.h") +add_custom_target( + shaders + DEPENDS + "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" + "${SHADER_BINARY_DIR}/sinewave.frag.spv.h" +) list(APPEND include_dirs ${SHADER_BINARY_DIR}) add_dependencies(${example_name} shaders) diff --git a/HIP-Basic/warp_shuffle/CMakeLists.txt b/HIP-Basic/warp_shuffle/CMakeLists.txt index 3c326224..2f4ebb3b 100644 --- a/HIP-Basic/warp_shuffle/CMakeLists.txt +++ b/HIP-Basic/warp_shuffle/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,9 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - set(ERROR_MESSAGE "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA.") + set(ERROR_MESSAGE + "GPU_RUNTIME is set to \"${GPU_RUNTIME}\".\nGPU_RUNTIME must be either HIP or CUDA." + ) message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/CMakeLists.txt b/Libraries/CMakeLists.txt index 8ce18bf0..e214e945 100644 --- a/Libraries/CMakeLists.txt +++ b/Libraries/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,7 @@ project(Libraries LANGUAGES NONE) # CMake configuration files for CUDA versions of HIP libraries are not yet # included under the HIP SDK for Windows. -if (NOT (CMAKE_SYSTEM_NAME MATCHES Windows AND "${GPU_RUNTIME}" STREQUAL "CUDA")) +if(NOT (CMAKE_SYSTEM_NAME MATCHES Windows AND "${GPU_RUNTIME}" STREQUAL "CUDA")) add_subdirectory(hipBLAS) add_subdirectory(hipCUB) add_subdirectory(hipSOLVER) diff --git a/Libraries/hipBLAS/CMakeLists.txt b/Libraries/hipBLAS/CMakeLists.txt index 233825ed..8109cada 100644 --- a/Libraries/hipBLAS/CMakeLists.txt +++ b/Libraries/hipBLAS/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,9 +24,17 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(hipBLAS_examples LANGUAGES NONE) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipBLAS/gemm_strided_batched/CMakeLists.txt b/Libraries/hipBLAS/gemm_strided_batched/CMakeLists.txt index 877b9086..8449763e 100644 --- a/Libraries/hipBLAS/gemm_strided_batched/CMakeLists.txt +++ b/Libraries/hipBLAS/gemm_strided_batched/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -39,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipBLAS/her/CMakeLists.txt b/Libraries/hipBLAS/her/CMakeLists.txt index 1034606c..1126647d 100644 --- a/Libraries/hipBLAS/her/CMakeLists.txt +++ b/Libraries/hipBLAS/her/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -39,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipBLAS/scal/CMakeLists.txt b/Libraries/hipBLAS/scal/CMakeLists.txt index 58644841..4c34a592 100644 --- a/Libraries/hipBLAS/scal/CMakeLists.txt +++ b/Libraries/hipBLAS/scal/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -39,9 +42,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipCUB/CMakeLists.txt b/Libraries/hipCUB/CMakeLists.txt index 80173734..ce6c0b45 100644 --- a/Libraries/hipCUB/CMakeLists.txt +++ b/Libraries/hipCUB/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,9 +24,17 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(hipCUB_examples LANGUAGES CXX) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipCUB/device_radix_sort/CMakeLists.txt b/Libraries/hipCUB/device_radix_sort/CMakeLists.txt index d5ddaf46..4bd069c7 100644 --- a/Libraries/hipCUB/device_radix_sort/CMakeLists.txt +++ b/Libraries/hipCUB/device_radix_sort/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -47,14 +50,8 @@ find_package(hipcub REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - hip::hipcub -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE hip::hipcub) +target_include_directories(${example_name} PRIVATE "../../../Common") set_source_files_properties(main.hip PROPERTIES LANGUAGE ${GPU_RUNTIME}) if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) diff --git a/Libraries/hipCUB/device_sum/CMakeLists.txt b/Libraries/hipCUB/device_sum/CMakeLists.txt index a82b1098..bc7677fd 100644 --- a/Libraries/hipCUB/device_sum/CMakeLists.txt +++ b/Libraries/hipCUB/device_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -47,14 +50,8 @@ find_package(hipcub REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - hip::hipcub -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE hip::hipcub) +target_include_directories(${example_name} PRIVATE "../../../Common") set_source_files_properties(main.hip PROPERTIES LANGUAGE ${GPU_RUNTIME}) if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) diff --git a/Libraries/hipSOLVER/CMakeLists.txt b/Libraries/hipSOLVER/CMakeLists.txt index 137b0670..e86fb14d 100644 --- a/Libraries/hipSOLVER/CMakeLists.txt +++ b/Libraries/hipSOLVER/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,16 +24,27 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(hipSOLVER_examples LANGUAGES NONE) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(hipsolver) if(NOT hipsolver_FOUND) - message(STATUS "hipSOLVER could not be found, not building hipSOLVER examples") + message( + STATUS + "hipSOLVER could not be found, not building hipSOLVER examples" + ) return() endif() @@ -50,6 +61,6 @@ add_subdirectory(sygvd) # this example currently does not work with CUDA # https://github.com/ROCmSoftwarePlatform/hipSOLVER/issues/152 -if (NOT ("${GPU_RUNTIME}" STREQUAL "CUDA")) +if(NOT ("${GPU_RUNTIME}" STREQUAL "CUDA")) add_subdirectory(sygvj) endif() diff --git a/Libraries/hipSOLVER/gels/CMakeLists.txt b/Libraries/hipSOLVER/gels/CMakeLists.txt index a5fd8a93..c65eacd3 100644 --- a/Libraries/hipSOLVER/gels/CMakeLists.txt +++ b/Libraries/hipSOLVER/gels/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/geqrf/CMakeLists.txt b/Libraries/hipSOLVER/geqrf/CMakeLists.txt index 2c30b6f0..4ddc0e09 100644 --- a/Libraries/hipSOLVER/geqrf/CMakeLists.txt +++ b/Libraries/hipSOLVER/geqrf/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/gesvd/CMakeLists.txt b/Libraries/hipSOLVER/gesvd/CMakeLists.txt index c7737c1a..5cb2245b 100644 --- a/Libraries/hipSOLVER/gesvd/CMakeLists.txt +++ b/Libraries/hipSOLVER/gesvd/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/getrf/CMakeLists.txt b/Libraries/hipSOLVER/getrf/CMakeLists.txt index 0852aee2..8604e2b8 100644 --- a/Libraries/hipSOLVER/getrf/CMakeLists.txt +++ b/Libraries/hipSOLVER/getrf/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/potrf/CMakeLists.txt b/Libraries/hipSOLVER/potrf/CMakeLists.txt index f0e9d118..8becacc7 100644 --- a/Libraries/hipSOLVER/potrf/CMakeLists.txt +++ b/Libraries/hipSOLVER/potrf/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/syevd/CMakeLists.txt b/Libraries/hipSOLVER/syevd/CMakeLists.txt index b2f3f6cd..36f526ca 100644 --- a/Libraries/hipSOLVER/syevd/CMakeLists.txt +++ b/Libraries/hipSOLVER/syevd/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -67,4 +78,3 @@ if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS CUDA::cusolver) endif() endif() - diff --git a/Libraries/hipSOLVER/syevdx/CMakeLists.txt b/Libraries/hipSOLVER/syevdx/CMakeLists.txt index 4ec39ea7..c1a43520 100644 --- a/Libraries/hipSOLVER/syevdx/CMakeLists.txt +++ b/Libraries/hipSOLVER/syevdx/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/syevj/CMakeLists.txt b/Libraries/hipSOLVER/syevj/CMakeLists.txt index e73d5c61..f0d86019 100644 --- a/Libraries/hipSOLVER/syevj/CMakeLists.txt +++ b/Libraries/hipSOLVER/syevj/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/syevj_batched/CMakeLists.txt b/Libraries/hipSOLVER/syevj_batched/CMakeLists.txt index e2465a5c..0d3dcf61 100644 --- a/Libraries/hipSOLVER/syevj_batched/CMakeLists.txt +++ b/Libraries/hipSOLVER/syevj_batched/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/sygvd/CMakeLists.txt b/Libraries/hipSOLVER/sygvd/CMakeLists.txt index 1708f8a1..24691849 100644 --- a/Libraries/hipSOLVER/sygvd/CMakeLists.txt +++ b/Libraries/hipSOLVER/sygvd/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/sygvj/CMakeLists.txt b/Libraries/hipSOLVER/sygvj/CMakeLists.txt index 80fda279..e5e33555 100644 --- a/Libraries/hipSOLVER/sygvj/CMakeLists.txt +++ b/Libraries/hipSOLVER/sygvj/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() enable_language(${GPU_RUNTIME}) @@ -38,9 +41,17 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/CMakeLists.txt b/Libraries/rocBLAS/CMakeLists.txt index a1ba792a..23077987 100644 --- a/Libraries/rocBLAS/CMakeLists.txt +++ b/Libraries/rocBLAS/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,9 +29,17 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/axpy/CMakeLists.txt b/Libraries/rocBLAS/level_1/axpy/CMakeLists.txt index 67a13574..f2716f56 100644 --- a/Libraries/rocBLAS/level_1/axpy/CMakeLists.txt +++ b/Libraries/rocBLAS/level_1/axpy/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/dot/CMakeLists.txt b/Libraries/rocBLAS/level_1/dot/CMakeLists.txt index 5e51c8ca..8e3b197f 100644 --- a/Libraries/rocBLAS/level_1/dot/CMakeLists.txt +++ b/Libraries/rocBLAS/level_1/dot/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt b/Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt index 03633620..9526dbf5 100644 --- a/Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt +++ b/Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/scal/CMakeLists.txt b/Libraries/rocBLAS/level_1/scal/CMakeLists.txt index ac923482..06200dc2 100644 --- a/Libraries/rocBLAS/level_1/scal/CMakeLists.txt +++ b/Libraries/rocBLAS/level_1/scal/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/swap/CMakeLists.txt b/Libraries/rocBLAS/level_1/swap/CMakeLists.txt index 129a5520..c76f32c9 100644 --- a/Libraries/rocBLAS/level_1/swap/CMakeLists.txt +++ b/Libraries/rocBLAS/level_1/swap/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_2/gemv/CMakeLists.txt b/Libraries/rocBLAS/level_2/gemv/CMakeLists.txt index 8cf4a88b..0f13b0bc 100644 --- a/Libraries/rocBLAS/level_2/gemv/CMakeLists.txt +++ b/Libraries/rocBLAS/level_2/gemv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_2/her/CMakeLists.txt b/Libraries/rocBLAS/level_2/her/CMakeLists.txt index 1a1c554a..f316aada 100644 --- a/Libraries/rocBLAS/level_2/her/CMakeLists.txt +++ b/Libraries/rocBLAS/level_2/her/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_3/gemm/CMakeLists.txt b/Libraries/rocBLAS/level_3/gemm/CMakeLists.txt index d0f3951f..955b8e37 100644 --- a/Libraries/rocBLAS/level_3/gemm/CMakeLists.txt +++ b/Libraries/rocBLAS/level_3/gemm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_3/gemm_strided_batched/CMakeLists.txt b/Libraries/rocBLAS/level_3/gemm_strided_batched/CMakeLists.txt index 631b7843..16052f42 100644 --- a/Libraries/rocBLAS/level_3/gemm_strided_batched/CMakeLists.txt +++ b/Libraries/rocBLAS/level_3/gemm_strided_batched/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocPRIM/CMakeLists.txt b/Libraries/rocPRIM/CMakeLists.txt index 4062496d..6d7d4566 100644 --- a/Libraries/rocPRIM/CMakeLists.txt +++ b/Libraries/rocPRIM/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,9 +29,17 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocPRIM/block_sum/CMakeLists.txt b/Libraries/rocPRIM/block_sum/CMakeLists.txt index cfff1214..8b337fcf 100644 --- a/Libraries/rocPRIM/block_sum/CMakeLists.txt +++ b/Libraries/rocPRIM/block_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,14 +38,8 @@ find_package(rocprim REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocprim -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocprim) +target_include_directories(${example_name} PRIVATE "../../../Common") if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) endif() diff --git a/Libraries/rocPRIM/device_sum/CMakeLists.txt b/Libraries/rocPRIM/device_sum/CMakeLists.txt index 82d62fd7..5ca14240 100644 --- a/Libraries/rocPRIM/device_sum/CMakeLists.txt +++ b/Libraries/rocPRIM/device_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,14 +38,8 @@ find_package(rocprim REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocprim -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocprim) +target_include_directories(${example_name} PRIVATE "../../../Common") if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) endif() diff --git a/Libraries/rocRAND/CMakeLists.txt b/Libraries/rocRAND/CMakeLists.txt index 64da29b6..cfe01799 100644 --- a/Libraries/rocRAND/CMakeLists.txt +++ b/Libraries/rocRAND/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,9 +24,17 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(rocRAND_examples LANGUAGES CXX) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocRAND/simple_distributions_cpp/CMakeLists.txt b/Libraries/rocRAND/simple_distributions_cpp/CMakeLists.txt index f9ba7151..c8ff3774 100644 --- a/Libraries/rocRAND/simple_distributions_cpp/CMakeLists.txt +++ b/Libraries/rocRAND/simple_distributions_cpp/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,10 @@ set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() if(GPU_RUNTIME STREQUAL "CUDA") diff --git a/Libraries/rocSOLVER/CMakeLists.txt b/Libraries/rocSOLVER/CMakeLists.txt index 99e971bc..35573bd4 100644 --- a/Libraries/rocSOLVER/CMakeLists.txt +++ b/Libraries/rocSOLVER/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,22 +29,36 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(rocblas) if(NOT rocblas_FOUND) - message(STATUS "rocBLAS could not be found, not building rocSOLVER examples") + message( + STATUS + "rocBLAS could not be found, not building rocSOLVER examples" + ) return() endif() find_package(rocsolver) if(NOT rocsolver_FOUND) - message(STATUS "rocSOLVER could not be found, not building rocSOLVER examples") + message( + STATUS + "rocSOLVER could not be found, not building rocSOLVER examples" + ) return() endif() diff --git a/Libraries/rocSOLVER/getf2/CMakeLists.txt b/Libraries/rocSOLVER/getf2/CMakeLists.txt index 78f61225..a284a71b 100644 --- a/Libraries/rocSOLVER/getf2/CMakeLists.txt +++ b/Libraries/rocSOLVER/getf2/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_HIP_EXTENSIONS OFF) set(CMAKE_HIP_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -57,4 +65,4 @@ target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS roc::rocsolver) -endif() \ No newline at end of file +endif() diff --git a/Libraries/rocSOLVER/getri/CMakeLists.txt b/Libraries/rocSOLVER/getri/CMakeLists.txt index d816927c..0d885591 100644 --- a/Libraries/rocSOLVER/getri/CMakeLists.txt +++ b/Libraries/rocSOLVER/getri/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -36,9 +36,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSOLVER/syev/CMakeLists.txt b/Libraries/rocSOLVER/syev/CMakeLists.txt index 1a429806..0b9d1ba1 100644 --- a/Libraries/rocSOLVER/syev/CMakeLists.txt +++ b/Libraries/rocSOLVER/syev/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_HIP_EXTENSIONS OFF) set(CMAKE_HIP_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -57,4 +65,4 @@ target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS roc::rocsolver) -endif() \ No newline at end of file +endif() diff --git a/Libraries/rocSOLVER/syev_batched/CMakeLists.txt b/Libraries/rocSOLVER/syev_batched/CMakeLists.txt index 8c210d58..9901f5fd 100644 --- a/Libraries/rocSOLVER/syev_batched/CMakeLists.txt +++ b/Libraries/rocSOLVER/syev_batched/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_HIP_EXTENSIONS OFF) set(CMAKE_HIP_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSOLVER/syev_strided_batched/CMakeLists.txt b/Libraries/rocSOLVER/syev_strided_batched/CMakeLists.txt index 58a92d3a..a9edcede 100644 --- a/Libraries/rocSOLVER/syev_strided_batched/CMakeLists.txt +++ b/Libraries/rocSOLVER/syev_strided_batched/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_HIP_EXTENSIONS OFF) set(CMAKE_HIP_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") @@ -57,4 +65,4 @@ target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS roc::rocsolver) -endif() \ No newline at end of file +endif() diff --git a/Libraries/rocSPARSE/CMakeLists.txt b/Libraries/rocSPARSE/CMakeLists.txt index a399930d..89a79aeb 100644 --- a/Libraries/rocSPARSE/CMakeLists.txt +++ b/Libraries/rocSPARSE/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,16 +29,27 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(rocsparse) if(NOT rocsparse_FOUND) - message(STATUS "rocSPARSE could not be found, not building rocSPARSE examples") + message( + STATUS + "rocSPARSE could not be found, not building rocSPARSE examples" + ) return() endif() diff --git a/Libraries/rocSPARSE/level_2/bsrmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/bsrmv/CMakeLists.txt index 487174a2..8d263de5 100644 --- a/Libraries/rocSPARSE/level_2/bsrmv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/bsrmv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/bsrsv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/bsrsv/CMakeLists.txt index 1ed90f2a..abfff607 100644 --- a/Libraries/rocSPARSE/level_2/bsrsv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/bsrsv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/bsrxmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/bsrxmv/CMakeLists.txt index 7346410f..9605babc 100644 --- a/Libraries/rocSPARSE/level_2/bsrxmv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/bsrxmv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/coomv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/coomv/CMakeLists.txt index 60cb2b4f..cd58e776 100644 --- a/Libraries/rocSPARSE/level_2/coomv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/coomv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/csrmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/csrmv/CMakeLists.txt index e595be2d..6f7604a5 100644 --- a/Libraries/rocSPARSE/level_2/csrmv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/csrmv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/csrsv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/csrsv/CMakeLists.txt index 1b2416bb..01e58f4f 100644 --- a/Libraries/rocSPARSE/level_2/csrsv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/csrsv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/ellmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/ellmv/CMakeLists.txt index 24d0b111..f6f4ddd2 100644 --- a/Libraries/rocSPARSE/level_2/ellmv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/ellmv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/gebsrmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/gebsrmv/CMakeLists.txt index 51937718..5d53864f 100644 --- a/Libraries/rocSPARSE/level_2/gebsrmv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/gebsrmv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/gemvi/CMakeLists.txt b/Libraries/rocSPARSE/level_2/gemvi/CMakeLists.txt index cbf8b9a3..6e3b2478 100644 --- a/Libraries/rocSPARSE/level_2/gemvi/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/gemvi/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/spmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/spmv/CMakeLists.txt index 0d38a3bd..839f74b8 100644 --- a/Libraries/rocSPARSE/level_2/spmv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/spmv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/spsv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/spsv/CMakeLists.txt index 450d00f3..09077b02 100644 --- a/Libraries/rocSPARSE/level_2/spsv/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_2/spsv/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/bsrmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/bsrmm/CMakeLists.txt index d513229a..bebd9592 100644 --- a/Libraries/rocSPARSE/level_3/bsrmm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/bsrmm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/bsrsm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/bsrsm/CMakeLists.txt index 2784b9ea..7e35aa93 100644 --- a/Libraries/rocSPARSE/level_3/bsrsm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/bsrsm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/csrmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/csrmm/CMakeLists.txt index 0aed039b..b58a8a36 100644 --- a/Libraries/rocSPARSE/level_3/csrmm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/csrmm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/csrsm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/csrsm/CMakeLists.txt index 97a52a9a..14441c5a 100644 --- a/Libraries/rocSPARSE/level_3/csrsm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/csrsm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/gebsrmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/gebsrmm/CMakeLists.txt index 9bcfebfe..d5c8d4f0 100644 --- a/Libraries/rocSPARSE/level_3/gebsrmm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/gebsrmm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/gemmi/CMakeLists.txt b/Libraries/rocSPARSE/level_3/gemmi/CMakeLists.txt index 4d499a59..042ed6d1 100644 --- a/Libraries/rocSPARSE/level_3/gemmi/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/gemmi/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/sddmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/sddmm/CMakeLists.txt index be47ab34..94be6026 100644 --- a/Libraries/rocSPARSE/level_3/sddmm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/sddmm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/spmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/spmm/CMakeLists.txt index 5b8f073a..de2ffdb0 100644 --- a/Libraries/rocSPARSE/level_3/spmm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/spmm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/spsm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/spsm/CMakeLists.txt index a4d55408..c455aedf 100644 --- a/Libraries/rocSPARSE/level_3/spsm/CMakeLists.txt +++ b/Libraries/rocSPARSE/level_3/spsm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/bsric0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/bsric0/CMakeLists.txt index 48d24135..dd50d46c 100644 --- a/Libraries/rocSPARSE/preconditioner/bsric0/CMakeLists.txt +++ b/Libraries/rocSPARSE/preconditioner/bsric0/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/bsrilu0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/bsrilu0/CMakeLists.txt index 2940a10e..8c97d282 100644 --- a/Libraries/rocSPARSE/preconditioner/bsrilu0/CMakeLists.txt +++ b/Libraries/rocSPARSE/preconditioner/bsrilu0/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/csric0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/csric0/CMakeLists.txt index 825de1d4..7f404c0b 100644 --- a/Libraries/rocSPARSE/preconditioner/csric0/CMakeLists.txt +++ b/Libraries/rocSPARSE/preconditioner/csric0/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/csrilu0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/csrilu0/CMakeLists.txt index 67a1b4f3..37555814 100644 --- a/Libraries/rocSPARSE/preconditioner/csrilu0/CMakeLists.txt +++ b/Libraries/rocSPARSE/preconditioner/csrilu0/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/csritilu0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/csritilu0/CMakeLists.txt index 72ec7425..be768038 100644 --- a/Libraries/rocSPARSE/preconditioner/csritilu0/CMakeLists.txt +++ b/Libraries/rocSPARSE/preconditioner/csritilu0/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,9 +37,17 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocThrust/CMakeLists.txt b/Libraries/rocThrust/CMakeLists.txt index 9d2f03df..0931163a 100644 --- a/Libraries/rocThrust/CMakeLists.txt +++ b/Libraries/rocThrust/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,16 +29,27 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH + "Root directory of the ROCm installation" + ) else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH + "Root directory of the ROCm installation" + ) endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(rocthrust) if(NOT rocthrust_FOUND) - message(STATUS "rocThrust could not be found, not building rocThrust examples") + message( + STATUS + "rocThrust could not be found, not building rocThrust examples" + ) return() endif() diff --git a/Libraries/rocThrust/device_ptr/CMakeLists.txt b/Libraries/rocThrust/device_ptr/CMakeLists.txt index 6191ef62..ae383b67 100644 --- a/Libraries/rocThrust/device_ptr/CMakeLists.txt +++ b/Libraries/rocThrust/device_ptr/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,16 +38,13 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") # TODO: remove when rocPRIM #ifdef WIN32 is fixed -target_compile_definitions(${example_name} PRIVATE $<$:WIN32>) +target_compile_definitions( + ${example_name} + PRIVATE $<$:WIN32> +) install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/norm/CMakeLists.txt b/Libraries/rocThrust/norm/CMakeLists.txt index bed6691a..e45e1f05 100644 --- a/Libraries/rocThrust/norm/CMakeLists.txt +++ b/Libraries/rocThrust/norm/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,16 +38,13 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") # TODO: remove when rocPRIM #ifdef WIN32 is fixed -target_compile_definitions(${example_name} PRIVATE $<$:WIN32>) +target_compile_definitions( + ${example_name} + PRIVATE $<$:WIN32> +) install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/reduce_sum/CMakeLists.txt b/Libraries/rocThrust/reduce_sum/CMakeLists.txt index c907a4db..5904d89b 100644 --- a/Libraries/rocThrust/reduce_sum/CMakeLists.txt +++ b/Libraries/rocThrust/reduce_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,16 +38,13 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") # TODO: remove when rocPRIM #ifdef WIN32 is fixed -target_compile_definitions(${example_name} PRIVATE $<$:WIN32>) +target_compile_definitions( + ${example_name} + PRIVATE $<$:WIN32> +) install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/remove_points/CMakeLists.txt b/Libraries/rocThrust/remove_points/CMakeLists.txt index a0ea2715..b399eb58 100644 --- a/Libraries/rocThrust/remove_points/CMakeLists.txt +++ b/Libraries/rocThrust/remove_points/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,13 +38,7 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/saxpy/CMakeLists.txt b/Libraries/rocThrust/saxpy/CMakeLists.txt index bdb12bbf..6c973f9d 100644 --- a/Libraries/rocThrust/saxpy/CMakeLists.txt +++ b/Libraries/rocThrust/saxpy/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,13 +38,7 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/vectors/CMakeLists.txt b/Libraries/rocThrust/vectors/CMakeLists.txt index 5c0b8227..dd9a4abd 100644 --- a/Libraries/rocThrust/vectors/CMakeLists.txt +++ b/Libraries/rocThrust/vectors/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,13 +38,7 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name})