From b725fd7633acede745c6e80ea1b6e4b8039eccb9 Mon Sep 17 00:00:00 2001 From: David Galiffi Date: Wed, 5 Jun 2024 09:34:09 -0400 Subject: [PATCH] Add cmake-format to CI (#121) * Add cmake file formatting to CI - Using gersemi - https://github.com/BlankSpruce/gersemi * Fix failures in CMake linting --------- Signed-off-by: David Galiffi --- .gersemirc | 10 ++ .github/workflows/linting.yml | 31 +++- Applications/bitonic_sort/CMakeLists.txt | 18 ++- Applications/convolution/CMakeLists.txt | 18 ++- Applications/floyd_warshall/CMakeLists.txt | 18 ++- Applications/histogram/CMakeLists.txt | 18 ++- Applications/monte_carlo_pi/CMakeLists.txt | 19 ++- Applications/prefix_sum/CMakeLists.txt | 18 ++- HIP-Basic/CMakeLists.txt | 57 ++++--- .../assembly_to_executable/CMakeLists.txt | 107 ++++++++----- HIP-Basic/bandwidth/CMakeLists.txt | 18 ++- HIP-Basic/bit_extract/CMakeLists.txt | 18 ++- HIP-Basic/cooperative_groups/CMakeLists.txt | 23 ++- HIP-Basic/device_globals/CMakeLists.txt | 18 ++- HIP-Basic/device_query/CMakeLists.txt | 18 ++- HIP-Basic/dynamic_shared/CMakeLists.txt | 18 ++- HIP-Basic/events/CMakeLists.txt | 18 ++- HIP-Basic/gpu_arch/CMakeLists.txt | 18 ++- HIP-Basic/hello_world/CMakeLists.txt | 18 ++- HIP-Basic/hello_world_cuda/CMakeLists.txt | 19 ++- HIP-Basic/hipify/CMakeLists.txt | 36 +++-- HIP-Basic/inline_assembly/CMakeLists.txt | 18 ++- .../llvm_ir_to_executable/CMakeLists.txt | 140 +++++++++++------- .../matrix_multiplication/CMakeLists.txt | 18 ++- HIP-Basic/module_api/CMakeLists.txt | 27 +++- HIP-Basic/moving_average/CMakeLists.txt | 18 ++- .../multi_gpu_data_transfer/CMakeLists.txt | 18 ++- HIP-Basic/occupancy/CMakeLists.txt | 18 ++- HIP-Basic/opengl_interop/CMakeLists.txt | 18 ++- HIP-Basic/runtime_compilation/CMakeLists.txt | 18 ++- HIP-Basic/saxpy/CMakeLists.txt | 18 ++- HIP-Basic/shared_memory/CMakeLists.txt | 18 ++- HIP-Basic/static_host_library/CMakeLists.txt | 23 ++- HIP-Basic/streams/CMakeLists.txt | 18 ++- HIP-Basic/texture_management/CMakeLists.txt | 23 ++- HIP-Basic/vulkan_interop/CMakeLists.txt | 35 ++++- HIP-Basic/warp_shuffle/CMakeLists.txt | 18 ++- Libraries/CMakeLists.txt | 4 +- Libraries/hipBLAS/CMakeLists.txt | 14 +- .../gemm_strided_batched/CMakeLists.txt | 19 ++- Libraries/hipBLAS/her/CMakeLists.txt | 19 ++- Libraries/hipBLAS/scal/CMakeLists.txt | 19 ++- Libraries/hipCUB/CMakeLists.txt | 14 +- .../hipCUB/device_radix_sort/CMakeLists.txt | 17 +-- Libraries/hipCUB/device_sum/CMakeLists.txt | 17 +-- Libraries/hipSOLVER/CMakeLists.txt | 21 ++- Libraries/hipSOLVER/gels/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/geqrf/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/gesvd/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/getrf/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/potrf/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/syevd/CMakeLists.txt | 20 ++- Libraries/hipSOLVER/syevdx/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/syevj/CMakeLists.txt | 19 ++- .../hipSOLVER/syevj_batched/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/sygvd/CMakeLists.txt | 19 ++- Libraries/hipSOLVER/sygvj/CMakeLists.txt | 19 ++- Libraries/rocBLAS/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_1/axpy/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_1/dot/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_1/scal/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_1/swap/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_2/gemv/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_2/her/CMakeLists.txt | 14 +- Libraries/rocBLAS/level_3/gemm/CMakeLists.txt | 14 +- .../gemm_strided_batched/CMakeLists.txt | 14 +- Libraries/rocPRIM/CMakeLists.txt | 14 +- Libraries/rocPRIM/block_sum/CMakeLists.txt | 12 +- Libraries/rocPRIM/device_sum/CMakeLists.txt | 12 +- Libraries/rocRAND/CMakeLists.txt | 14 +- .../simple_distributions_cpp/CMakeLists.txt | 7 +- Libraries/rocSOLVER/CMakeLists.txt | 24 ++- Libraries/rocSOLVER/getf2/CMakeLists.txt | 16 +- Libraries/rocSOLVER/getri/CMakeLists.txt | 14 +- Libraries/rocSOLVER/syev/CMakeLists.txt | 16 +- .../rocSOLVER/syev_batched/CMakeLists.txt | 14 +- .../syev_strided_batched/CMakeLists.txt | 16 +- Libraries/rocSPARSE/CMakeLists.txt | 19 ++- .../rocSPARSE/level_2/bsrmv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/bsrsv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/bsrxmv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/coomv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/csrmv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/csrsv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/ellmv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/gebsrmv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/gemvi/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/spmv/CMakeLists.txt | 14 +- .../rocSPARSE/level_2/spsv/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/bsrmm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/bsrsm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/csrmm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/csrsm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/gebsrmm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/gemmi/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/sddmm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/spmm/CMakeLists.txt | 14 +- .../rocSPARSE/level_3/spsm/CMakeLists.txt | 14 +- .../preconditioner/bsric0/CMakeLists.txt | 14 +- .../preconditioner/bsrilu0/CMakeLists.txt | 14 +- .../preconditioner/csric0/CMakeLists.txt | 14 +- .../preconditioner/csrilu0/CMakeLists.txt | 14 +- .../preconditioner/csritilu0/CMakeLists.txt | 14 +- Libraries/rocThrust/CMakeLists.txt | 19 ++- Libraries/rocThrust/device_ptr/CMakeLists.txt | 17 +-- Libraries/rocThrust/norm/CMakeLists.txt | 17 +-- Libraries/rocThrust/reduce_sum/CMakeLists.txt | 17 +-- .../rocThrust/remove_points/CMakeLists.txt | 12 +- Libraries/rocThrust/saxpy/CMakeLists.txt | 12 +- Libraries/rocThrust/vectors/CMakeLists.txt | 12 +- 111 files changed, 1535 insertions(+), 575 deletions(-) create mode 100644 .gersemirc diff --git a/.gersemirc b/.gersemirc new file mode 100644 index 000000000..0e7c53861 --- /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 9cb200946..b7b83c379 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 9a3cf182e..8c30f36c6 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 d60ca6778..370c1bae1 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 92aba905f..f665ae2da 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 fe0f43eb0..ba79ccc65 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 8ee0fd9a3..094437c1b 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 f75db53d5..9e3f37897 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 02f1f0eb8..5ba678e40 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 228a3fb42..741627349 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 aec3d62bd..4a82b260b 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 907b316cf..c31135d63 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 fd7bc4d62..2ab7adf56 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 c4031a9e5..3bf789799 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 ff6013b67..f9e8b53f0 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 7b3dc72e3..e26f23634 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 260a82315..219bd7ca1 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 0432a000a..fd941b544 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 54b981ad3..18dbceb04 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 36b696cf2..f221ec64a 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 e8182d1a0..23588c003 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 641c8f268..3f641217b 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 45350de45..25b32762b 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 61cb2735e..2f08e785e 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 35d9daffb..e5dd87f25 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 964b7ee6d..0cac544d1 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 f52ad8ef7..90df91517 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 21f695814..43118c5c8 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 f334a1bd7..41a791bf5 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 4dc7843ec..95f337287 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 5f2e123ea..9fe73cd3c 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 3dfa6ea86..dbdf3ae66 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 f42d103f3..475c9bcb3 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 007726eac..6b2ed19b7 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 0df400a26..e9f2f5678 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 b590a4b32..6a18e4489 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 3c326224a..2f4ebb3b4 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 8ce18bf01..e214e945f 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 233825ed5..8109cada8 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 877b9086a..8449763ee 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 1034606cb..1126647d7 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 58644841a..4c34a5923 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 801737343..ce6c0b456 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 d5ddaf46d..4bd069c7d 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 a82b10982..bc7677fd3 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 137b06701..e86fb14d6 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 a5fd8a936..c65eacd31 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 2c30b6f01..4ddc0e09d 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 c7737c1a9..5cb2245b8 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 0852aee27..8604e2b87 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 f0e9d118f..8becacc74 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 b2f3f6cdf..36f526ca7 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 4ec39ea74..c1a43520d 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 e73d5c61e..f0d860198 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 e2465a5cf..0d3dcf61d 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 1708f8a13..24691849d 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 80fda279c..e5e335551 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 a1ba792a9..23077987a 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 67a135743..f2716f568 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 5e51c8caa..8e3b197fe 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 03633620e..9526dbf54 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 ac923482e..06200dc22 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 129a55200..c76f32c9f 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 8cf4a88bb..0f13b0bc3 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 1a1c554a3..f316aadaa 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 d0f3951f9..955b8e37d 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 631b7843b..16052f429 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 4062496db..6d7d4566e 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 cfff12148..8b337fcf0 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 82d62fd75..5ca142400 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 64da29b6e..cfe01799b 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 f9ba71510..c8ff3774f 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 99e971bca..35573bd4c 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 78f612259..a284a71be 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 d816927c7..0d885591d 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 1a4298069..0b9d1ba15 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 8c210d584..9901f5fdc 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 58a92d3ab..a9edcede1 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 a399930d8..89a79aeb9 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 487174a2d..8d263de5e 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 1ed90f2a4..abfff6076 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 7346410fc..9605babc9 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 60cb2b4f0..cd58e7764 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 e595be2db..6f7604a5b 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 1b2416bbd..01e58f4f5 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 24d0b1111..f6f4ddd21 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 519377185..5d53864fa 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 cbf8b9a3f..6e3b24783 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 0d38a3bdf..839f74b84 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 450d00f32..09077b022 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 d513229ac..bebd9592d 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 2784b9eac..7e35aa93d 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 0aed039b7..b58a8a36e 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 97a52a9a4..14441c5a8 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 9bcfebfe7..d5c8d4f0e 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 4d499a593..042ed6d14 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 be47ab340..94be60269 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 5b8f073a1..de2ffdb02 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 a4d55408d..c455aedf9 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 48d241350..dd50d46cc 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 2940a10ea..8c97d2829 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 825de1d4e..7f404c0be 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 67a1b4f32..375558146 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 72ec74256..be7680388 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 9d2f03df8..0931163ad 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 6191ef624..ae383b67a 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 bed6691aa..e45e1f053 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 c907a4db1..5904d89be 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 a0ea2715d..b399eb587 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 bdb12bbfa..6c973f9d5 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 5c0b8227e..dd9a4abdc 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})