diff --git a/Applications/bitonic_sort/CMakeLists.txt b/Applications/bitonic_sort/CMakeLists.txt index 9a3cf182..3e16fecd 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 @@ -25,12 +25,16 @@ set(example_name applications_bitonic_sort) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/convolution/CMakeLists.txt b/Applications/convolution/CMakeLists.txt index d60ca677..a406889e 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 @@ -25,12 +25,16 @@ set(example_name applications_convolution) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/floyd_warshall/CMakeLists.txt b/Applications/floyd_warshall/CMakeLists.txt index 92aba905..97cbe6d2 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 @@ -25,12 +25,15 @@ set(example_name applications_floyd_warshall) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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}\".\n + GPU_RUNTIME must be either HIP or CUDA.") message(FATAL_ERROR ${ERROR_MESSAGE}) endif() @@ -40,9 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/histogram/CMakeLists.txt b/Applications/histogram/CMakeLists.txt index fe0f43eb..a1aaad81 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 @@ -25,12 +25,16 @@ set(example_name applications_histogram) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/monte_carlo_pi/CMakeLists.txt b/Applications/monte_carlo_pi/CMakeLists.txt index 8ee0fd9a..f48eb4ec 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 @@ -25,12 +25,17 @@ set(example_name applications_monte_carlo_pi) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Applications/prefix_sum/CMakeLists.txt b/Applications/prefix_sum/CMakeLists.txt index f75db53d..eb7bc537 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 @@ -25,12 +25,16 @@ set(example_name applications_prefix_sum) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/CMakeLists.txt b/HIP-Basic/CMakeLists.txt index 02f1f0eb..2cb76682 100644 --- a/HIP-Basic/CMakeLists.txt +++ b/HIP-Basic/CMakeLists.txt @@ -25,9 +25,13 @@ 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) @@ -37,37 +41,39 @@ if(NOT "${GPU_RUNTIME}" STREQUAL "CUDA") find_program( 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 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 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.") + 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." + ) 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() @@ -107,7 +113,8 @@ add_subdirectory(occupancy) add_subdirectory(runtime_compilation) add_subdirectory(saxpy) add_subdirectory(shared_memory) -# We cannot build the static library on Windows as the HIP SDK does not include CMAKE_AR. +# We cannot build the static library on Windows as the HIP SDK does not include +# CMAKE_AR. if(NOT WIN32 AND NOT "${GPU_RUNTIME}" STREQUAL "HIP") add_subdirectory(static_host_library) endif() diff --git a/HIP-Basic/assembly_to_executable/CMakeLists.txt b/HIP-Basic/assembly_to_executable/CMakeLists.txt index 228a3fb4..9d353400 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 @@ -25,11 +25,14 @@ set(example_name hip_assembly_to_executable) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +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,28 +42,39 @@ 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}") if(NOT DEFINED CMAKE_HIP_ARCHITECTURES) - set(GPU_ARCHITECTURES "all" CACHE STRING "GPU architectures to compile for") + 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) @@ -74,92 +88,87 @@ else() set(HIP_OBJ_GEN_FILE hip_obj_gen.mcin) endif() -# Assemble the device assemblies to object files using the HIP compiler. -# The compiler needs -target amdgcn-amd-amdhsa -mcpu=gfx* in order to assemble the object file -# for the right GPU. +# Assemble the device assemblies to object files using the HIP compiler. The +# compiler needs -target amdgcn-amd-amdhsa -mcpu=gfx* in order to assemble the +# object file for the right GPU. 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}") endforeach() -# Create an offload-bundle from the assembled object files. This needs the clang-offload-bundler tool. +# Create an offload-bundle from the assembled object files. This needs the +# clang-offload-bundler tool. find_program( 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 -# clang-offload-bundler -targets= -input= -inputs= ... -output= -# Note that the host target must be the first target present here, and it should have an empty input associated to it. +# Generate object bundle. The invocation to generate is clang-offload-bundler +# -targets= -input= -inputs= ... +# -output= Note that the host target must be the first target present +# here, and it should have an empty input associated to it. -# Generate BUNDLE_TARGETS as a string of: -targets=host-${HOST_TARGET},hip-amdgcn-amd-amdhsa-${HIP_ARCHITECTURE},... +# Generate BUNDLE_TARGETS as a string of: +# -targets=host-${HOST_TARGET},hip-amdgcn-amd-amdhsa-${HIP_ARCHITECTURE},... set(BUNDLE_TARGETS "-targets=host-${HOST_TARGET}") -# Generate BUNDLE_INPUTS as a string of: -input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} ... +# Generate BUNDLE_INPUTS as a string of: +# -input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} ... set(BUNDLE_INPUTS "-input=${NULDEV}") -# Generate BUNDLE_OBJECTS as a string of: ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} +# 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. 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}" + COMMAND "${OFFLOAD_BUNDLER_COMMAND}" -type=o -bundle-align=4096 + "${BUNDLE_TARGETS}" ${BUNDLE_INPUTS} "-output=${BUNDLE}" DEPENDS ${BUNDLE_OBJECTS} VERBATIM 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. +# 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 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}") # Finally, create the executable. -add_executable( - ${example_name} - main.hip - ${DEVICE_OBJECT}) +add_executable(${example_name} main.hip ${DEVICE_OBJECT}) # Make example runnable using ctest. add_test(${example_name} ${example_name}) diff --git a/HIP-Basic/bandwidth/CMakeLists.txt b/HIP-Basic/bandwidth/CMakeLists.txt index aec3d62b..25db335b 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 @@ -25,12 +25,16 @@ set(example_name hip_bandwidth) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/bit_extract/CMakeLists.txt b/HIP-Basic/bit_extract/CMakeLists.txt index 907b316c..7fc56dcc 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 @@ -25,12 +25,16 @@ set(example_name hip_bit_extract) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/cooperative_groups/CMakeLists.txt b/HIP-Basic/cooperative_groups/CMakeLists.txt index fd7bc4d6..5c999edf 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 @@ -25,12 +25,16 @@ set(example_name hip_cooperative_groups) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ 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}") @@ -55,8 +63,10 @@ set(include_dirs "../../Common") 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 ) + # 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) add_compile_definitions(NDEBUG) endif() endif() diff --git a/HIP-Basic/device_globals/CMakeLists.txt b/HIP-Basic/device_globals/CMakeLists.txt index c4031a9e..c8d66f77 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 @@ -25,12 +25,16 @@ set(example_name hip_device_globals) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/device_query/CMakeLists.txt b/HIP-Basic/device_query/CMakeLists.txt index ff6013b6..2c36aaaf 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 @@ -25,17 +25,22 @@ set(example_name hip_device_query) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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() if(GPU_RUNTIME STREQUAL "HIP") - # This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. + # This example does not contain device code, thereby it can be compiled with + # any conforming C++ compiler. set(USED_LANGUAGE "CXX") else() set(USED_LANGUAGE "CUDA") @@ -47,9 +52,13 @@ 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}") @@ -68,8 +77,8 @@ target_include_directories(${example_name} PRIVATE ${include_dirs}) set_source_files_properties(main.cpp PROPERTIES LANGUAGE ${USED_LANGUAGE}) if(GPU_RUNTIME STREQUAL "HIP") - # When an ordinary C++ compiler is used (on the ROCm backend), - # it must be set up to link to the HIP runtime. + # When an ordinary C++ compiler is used (on the ROCm backend), it must be + # set up to link to the HIP runtime. target_compile_definitions(${example_name} PRIVATE __HIP_PLATFORM_AMD__) find_package(HIP) target_link_libraries(${example_name} PRIVATE hip::host) diff --git a/HIP-Basic/dynamic_shared/CMakeLists.txt b/HIP-Basic/dynamic_shared/CMakeLists.txt index 7b3dc72e..b02e7383 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 @@ -25,12 +25,16 @@ set(example_name hip_dynamic_shared) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/events/CMakeLists.txt b/HIP-Basic/events/CMakeLists.txt index 260a8231..09288ac6 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 @@ -25,12 +25,16 @@ set(example_name hip_events) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/gpu_arch/CMakeLists.txt b/HIP-Basic/gpu_arch/CMakeLists.txt index 0432a000..38e54bc7 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 @@ -25,12 +25,16 @@ set(example_name hip_gpu_arch) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/hello_world/CMakeLists.txt b/HIP-Basic/hello_world/CMakeLists.txt index 54b981ad..29d31f4d 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 @@ -25,12 +25,16 @@ set(example_name hip_hello_world) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/hello_world_cuda/CMakeLists.txt b/HIP-Basic/hello_world_cuda/CMakeLists.txt index 36b696cf..fb5887b7 100644 --- a/HIP-Basic/hello_world_cuda/CMakeLists.txt +++ b/HIP-Basic/hello_world_cuda/CMakeLists.txt @@ -24,14 +24,18 @@ set(example_name hip_hello_world_cuda) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) -# CMake's HIP language mode does not yet support compiling with CUDA, thereby we must -# resort to the CUDA language mode. +# CMake's HIP language mode does not yet support compiling with CUDA, thereby we +# must resort to the CUDA language mode. 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,12 +44,12 @@ 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. +# 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. set_source_files_properties(main.hip PROPERTIES LANGUAGE CUDA) install(TARGETS ${example_name}) diff --git a/HIP-Basic/hipify/CMakeLists.txt b/HIP-Basic/hipify/CMakeLists.txt index e8182d1a..04c77656 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,8 @@ 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) @@ -31,12 +32,16 @@ find_package(Perl REQUIRED) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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,26 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") # create main.hip add_custom_command( - OUTPUT main.hip - COMMAND ${PERL_EXECUTABLE} ${ROCM_ROOT}/bin/hipify-perl ${CMAKE_CURRENT_SOURCE_DIR}/main.cu - -o ${CMAKE_CURRENT_BINARY_DIR}/main.hip - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main.cu - VERBATIM) + OUTPUT main.hip + COMMAND + ${PERL_EXECUTABLE} ${ROCM_ROOT}/bin/hipify-perl + ${CMAKE_CURRENT_SOURCE_DIR}/main.cu -o + ${CMAKE_CURRENT_BINARY_DIR}/main.hip + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/main.cu + VERBATIM) add_executable(${example_name} ${CMAKE_CURRENT_BINARY_DIR}/main.hip) # Make example runnable using ctest diff --git a/HIP-Basic/inline_assembly/CMakeLists.txt b/HIP-Basic/inline_assembly/CMakeLists.txt index 641c8f26..f32c1001 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 @@ -25,12 +25,16 @@ set(example_name hip_inline_assembly) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/llvm_ir_to_executable/CMakeLists.txt b/HIP-Basic/llvm_ir_to_executable/CMakeLists.txt index 45350de4..a03daa6a 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 @@ -25,11 +25,14 @@ set(example_name hip_llvm_ir_to_executable) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +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,50 +42,59 @@ 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}") if(NOT DEFINED CMAKE_HIP_ARCHITECTURES) - set(GPU_ARCHITECTURES "all" CACHE STRING "GPU architectures to compile for") + 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) @@ -97,89 +109,86 @@ else() set(HIP_OBJ_GEN_FILE hip_obj_gen.mcin) endif() -# Assemble the device assemblies to object files using the HIP compiler. -# The compiler needs -target amdgcn-amd-amdhsa -mcpu=gfx* in order to assemble the object file -# for the right GPU. +# Assemble the device assemblies to object files using the HIP compiler. The +# compiler needs -target amdgcn-amd-amdhsa -mcpu=gfx* in order to assemble the +# object file for the right GPU. 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}") endforeach() -# Create an offload-bundle from the assembled object files. This needs the clang-offload-bundler tool. +# Create an offload-bundle from the assembled object files. This needs the +# clang-offload-bundler tool. find_program( 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 -# clang-offload-bundler -targets= -input= -inputs= ... -output= -# Note that the host target must be the first target present here, and it should have an empty input associated to it. +# Generate object bundle. The invocation to generate is clang-offload-bundler +# -targets= -input= -inputs= ... +# -output= Note that the host target must be the first target present +# here, and it should have an empty input associated to it. -# Generate BUNDLE_TARGETS as a string of: -targets=host-${HOST_TARGET},hip-amdgcn-amd-amdhsa-${HIP_ARCHITECTURE},... +# Generate BUNDLE_TARGETS as a string of: +# -targets=host-${HOST_TARGET},hip-amdgcn-amd-amdhsa-${HIP_ARCHITECTURE},... set(BUNDLE_TARGETS "-targets=host-${HOST_TARGET}") -# Generate BUNDLE_INPUTS as a string of: -input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} ... +# Generate BUNDLE_INPUTS as a string of: +# -input=${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} ... set(BUNDLE_INPUTS "-input=${NULDEV}") -# Generate BUNDLE_OBJECTS as a string of: ${CMAKE_CURRENT_BINARY_DIR}/main_${HIP_ARCHITECTURE}.${OBJ_TYPE} +# 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. 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}" + COMMAND "${OFFLOAD_BUNDLER_COMMAND}" -type=o -bundle-align=4096 + "${BUNDLE_TARGETS}" ${BUNDLE_INPUTS} "-output=${BUNDLE}" DEPENDS ${BUNDLE_OBJECTS} - VERBATIM) + VERBATIM + COMMENT "Generating offload_bundle.hipfb") -# 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. +# 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 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 + COMMENT "Generating main_device.${OBJ_TYPE}") # Finally, create the executable. -add_executable( - ${example_name} - main.hip - ${DEVICE_OBJECT}) +add_executable(${example_name} main.hip ${DEVICE_OBJECT}) # Make example runnable using ctest add_test(${example_name} ${example_name}) diff --git a/HIP-Basic/matrix_multiplication/CMakeLists.txt b/HIP-Basic/matrix_multiplication/CMakeLists.txt index 61cb2735..40559f12 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 @@ -25,12 +25,16 @@ set(example_name hip_matrix_multiplication) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/module_api/CMakeLists.txt b/HIP-Basic/module_api/CMakeLists.txt index 35d9daff..4ae1bd36 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 @@ -25,11 +25,14 @@ set(example_name hip_module_api) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +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,33 +42,40 @@ 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}") add_executable(${example_name} main.hip) -# This is a mild hack. CMake (like most build systems) don't play well with targeting multiple -# architectures in the same build. This example builds an executable for the host system and a -# device code object for potentially multiple device architectures. Code objects need not and -# _should not_ be linked using the host linker. We're creating an OBJECT library, because in -# CMake terms, OBJECT libraries don't involve a linking step, but in reality, we'll also add -# the `--cuda-device-only` compile option, which changes the target triplet of the compiler -# from host to device code. +# This is a mild hack. CMake (like most build systems) don't play well with +# targeting multiple architectures in the same build. This example builds an +# executable for the host system and a device code object for potentially +# multiple device architectures. Code objects need not and _should not_ be +# linked using the host linker. We're creating an OBJECT library, because in +# CMake terms, OBJECT libraries don't involve a linking step, but in reality, +# we'll also add the `--cuda-device-only` compile option, which changes the +# target triplet of the compiler from host to device code. add_library(${example_name}_module OBJECT module.hip) -# Ideally we'd need a non-existent CheckHIPCompilerFlag module before assuming this flag works. +# Ideally we'd need a non-existent CheckHIPCompilerFlag module before assuming +# this flag works. 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 + COMMAND + "${CMAKE_COMMAND}" ARGS -E copy $ + $/module.co COMMAND_EXPAND_LISTS COMMENT "Copying HIP code object for ${example_name}") diff --git a/HIP-Basic/moving_average/CMakeLists.txt b/HIP-Basic/moving_average/CMakeLists.txt index 964b7ee6..d1638ebd 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 @@ -25,12 +25,16 @@ set(example_name hip_moving_average) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/multi_gpu_data_transfer/CMakeLists.txt b/HIP-Basic/multi_gpu_data_transfer/CMakeLists.txt index f52ad8ef..eb73f6c6 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 @@ -25,12 +25,16 @@ set(example_name hip_multi_gpu_data_transfer) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/occupancy/CMakeLists.txt b/HIP-Basic/occupancy/CMakeLists.txt index 21f69581..92acc596 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 @@ -25,12 +25,16 @@ set(example_name hip_occupancy) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/opengl_interop/CMakeLists.txt b/HIP-Basic/opengl_interop/CMakeLists.txt index f334a1bd..4e18a193 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 @@ -25,12 +25,16 @@ set(example_name hip_opengl_interop) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/runtime_compilation/CMakeLists.txt b/HIP-Basic/runtime_compilation/CMakeLists.txt index 4dc7843e..8ec508ea 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 @@ -25,12 +25,16 @@ set(example_name hip_runtime_compilation) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/saxpy/CMakeLists.txt b/HIP-Basic/saxpy/CMakeLists.txt index 5f2e123e..bbd311f9 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 @@ -25,12 +25,16 @@ set(example_name hip_saxpy) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/shared_memory/CMakeLists.txt b/HIP-Basic/shared_memory/CMakeLists.txt index 3dfa6ea8..2014f29b 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 @@ -25,12 +25,16 @@ set(example_name hip_shared_memory) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/static_host_library/CMakeLists.txt b/HIP-Basic/static_host_library/CMakeLists.txt index f42d103f..158df663 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 @@ -25,12 +25,16 @@ set(example_name hip_static_host_library) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ 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,14 +68,15 @@ 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) # Link the static host library we have just created. target_link_libraries(${example_name} PRIVATE ${library_name}) -# We are creating a regular, non-HIP, executable, and so we don't need to pass -# a list of devices for this target. +# We are creating a regular, non-HIP, executable, and so we don't need to pass a +# list of devices for this target. set_target_properties(${example_name} PROPERTIES HIP_ARCHITECTURES FALSE) # Create a driver executable using the host c++ compiler. @@ -75,8 +84,8 @@ add_executable(${example_name_cxx} main.cpp) # Link the static host library we have just created. target_link_libraries(${example_name_cxx} PRIVATE ${library_name}) -# Set the linker language to CXX so that CMake uses the host CXX compiler to compile -# and link this version of the executable. +# Set the linker language to CXX so that CMake uses the host CXX compiler to +# compile and link this version of the executable. set_target_properties(${example_name_cxx} PROPERTIES LINKER_LANGUAGE CXX) # Make examples runnable using ctest diff --git a/HIP-Basic/streams/CMakeLists.txt b/HIP-Basic/streams/CMakeLists.txt index 007726ea..40decdee 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 @@ -25,12 +25,16 @@ set(example_name hip_streams) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/HIP-Basic/texture_management/CMakeLists.txt b/HIP-Basic/texture_management/CMakeLists.txt index 0df400a2..e5ba2fa4 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 @@ -25,12 +25,16 @@ set(example_name hip_texture_management) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ 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}") @@ -51,9 +59,10 @@ add_executable(${example_name} main.hip) # Make example runnable using ctest 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") +# 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(include_dirs "../../Common") if(GPU_RUNTIME STREQUAL "CUDA") diff --git a/HIP-Basic/vulkan_interop/CMakeLists.txt b/HIP-Basic/vulkan_interop/CMakeLists.txt index b590a4b3..1ceaa7c1 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 @@ -25,12 +25,16 @@ set(example_name hip_vulkan_interop) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ 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 +69,24 @@ 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" -) + 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" -) + COMMENT "Compiling fragment shader") -add_custom_target(shaders DEPENDS "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" "${SHADER_BINARY_DIR}/sinewave.frag.spv.h") +add_custom_target(shaders DEPENDS "${SHADER_BINARY_DIR}/sinewave.vert.spv.h" + "${SHADER_BINARY_DIR}/sinewave.frag.spv.h") list(APPEND include_dirs ${SHADER_BINARY_DIR}) add_dependencies(${example_name} shaders) diff --git a/HIP-Basic/warp_shuffle/CMakeLists.txt b/HIP-Basic/warp_shuffle/CMakeLists.txt index 3c326224..aede0c9f 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 @@ -25,12 +25,16 @@ set(example_name hip_warp_shuffle) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/CMakeLists.txt b/Libraries/CMakeLists.txt index 8ce18bf0..e214e945 100644 --- a/Libraries/CMakeLists.txt +++ b/Libraries/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,7 @@ project(Libraries LANGUAGES NONE) # CMake configuration files for CUDA versions of HIP libraries are not yet # included under the HIP SDK for Windows. -if (NOT (CMAKE_SYSTEM_NAME MATCHES Windows AND "${GPU_RUNTIME}" STREQUAL "CUDA")) +if(NOT (CMAKE_SYSTEM_NAME MATCHES Windows AND "${GPU_RUNTIME}" STREQUAL "CUDA")) add_subdirectory(hipBLAS) add_subdirectory(hipCUB) add_subdirectory(hipSOLVER) diff --git a/Libraries/hipBLAS/CMakeLists.txt b/Libraries/hipBLAS/CMakeLists.txt index 233825ed..d16e4efe 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,13 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(hipBLAS_examples LANGUAGES NONE) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipBLAS/gemm_strided_batched/CMakeLists.txt b/Libraries/hipBLAS/gemm_strided_batched/CMakeLists.txt index 877b9086..ef08279d 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 @@ -25,12 +25,17 @@ set(example_name hipblas_gemm_strided_batched) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipBLAS/her/CMakeLists.txt b/Libraries/hipBLAS/her/CMakeLists.txt index 1034606c..eec2bf0f 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 @@ -25,12 +25,17 @@ set(example_name hipblas_her) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipBLAS/scal/CMakeLists.txt b/Libraries/hipBLAS/scal/CMakeLists.txt index 58644841..bcccb541 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 @@ -25,12 +25,17 @@ set(example_name hipblas_scal) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +44,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipCUB/CMakeLists.txt b/Libraries/hipCUB/CMakeLists.txt index 80173734..38867d55 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,13 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(hipCUB_examples LANGUAGES CXX) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipCUB/device_radix_sort/CMakeLists.txt b/Libraries/hipCUB/device_radix_sort/CMakeLists.txt index d5ddaf46..344c0afd 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 @@ -25,12 +25,17 @@ set(example_name hipcub_device_radix_sort) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +52,8 @@ find_package(hipcub REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - hip::hipcub -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE hip::hipcub) +target_include_directories(${example_name} PRIVATE "../../../Common") set_source_files_properties(main.hip PROPERTIES LANGUAGE ${GPU_RUNTIME}) if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) diff --git a/Libraries/hipCUB/device_sum/CMakeLists.txt b/Libraries/hipCUB/device_sum/CMakeLists.txt index a82b1098..3a4ac4aa 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 @@ -25,12 +25,17 @@ set(example_name hipcub_device_sum) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(hipcub_device_sum LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +52,8 @@ find_package(hipcub REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - hip::hipcub -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE hip::hipcub) +target_include_directories(${example_name} PRIVATE "../../../Common") set_source_files_properties(main.hip PROPERTIES LANGUAGE ${GPU_RUNTIME}) if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) diff --git a/Libraries/hipSOLVER/CMakeLists.txt b/Libraries/hipSOLVER/CMakeLists.txt index 137b0670..2aa54660 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,21 @@ 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 +55,6 @@ add_subdirectory(sygvd) # this example currently does not work with CUDA # https://github.com/ROCmSoftwarePlatform/hipSOLVER/issues/152 -if (NOT ("${GPU_RUNTIME}" STREQUAL "CUDA")) +if(NOT ("${GPU_RUNTIME}" STREQUAL "CUDA")) add_subdirectory(sygvj) endif() diff --git a/Libraries/hipSOLVER/gels/CMakeLists.txt b/Libraries/hipSOLVER/gels/CMakeLists.txt index a5fd8a93..428eaa7f 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_gels) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/geqrf/CMakeLists.txt b/Libraries/hipSOLVER/geqrf/CMakeLists.txt index 2c30b6f0..79becbb7 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_geqrf) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/gesvd/CMakeLists.txt b/Libraries/hipSOLVER/gesvd/CMakeLists.txt index c7737c1a..b065d4fb 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_gesvd) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/getrf/CMakeLists.txt b/Libraries/hipSOLVER/getrf/CMakeLists.txt index 0852aee2..4a8bd83f 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_getrf) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/potrf/CMakeLists.txt b/Libraries/hipSOLVER/potrf/CMakeLists.txt index f0e9d118..aeac6d12 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_potrf) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/syevd/CMakeLists.txt b/Libraries/hipSOLVER/syevd/CMakeLists.txt index b2f3f6cd..33dd7550 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_syevd) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ 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 +76,3 @@ if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS CUDA::cusolver) endif() endif() - diff --git a/Libraries/hipSOLVER/syevdx/CMakeLists.txt b/Libraries/hipSOLVER/syevdx/CMakeLists.txt index 4ec39ea7..d4dfd893 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_syevdx) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/syevj/CMakeLists.txt b/Libraries/hipSOLVER/syevj/CMakeLists.txt index e73d5c61..255f7acd 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_syevj) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/syevj_batched/CMakeLists.txt b/Libraries/hipSOLVER/syevj_batched/CMakeLists.txt index e2465a5c..f42683dd 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_syevj_batched) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/sygvd/CMakeLists.txt b/Libraries/hipSOLVER/sygvd/CMakeLists.txt index 1708f8a1..d7425c68 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_sygvd) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/hipSOLVER/sygvj/CMakeLists.txt b/Libraries/hipSOLVER/sygvj/CMakeLists.txt index 80fda279..fba4b6b6 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 @@ -24,12 +24,17 @@ set(example_name hipsolver_sygvj) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") 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 +43,13 @@ set(CMAKE_${GPU_RUNTIME}_EXTENSIONS OFF) set(CMAKE_${GPU_RUNTIME}_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/CMakeLists.txt b/Libraries/rocBLAS/CMakeLists.txt index a1ba792a..83779dc5 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,13 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/axpy/CMakeLists.txt b/Libraries/rocBLAS/level_1/axpy/CMakeLists.txt index 67a13574..462eb167 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/dot/CMakeLists.txt b/Libraries/rocBLAS/level_1/dot/CMakeLists.txt index 5e51c8ca..f751067d 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt b/Libraries/rocBLAS/level_1/nrm2/CMakeLists.txt index 03633620..083fe085 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/scal/CMakeLists.txt b/Libraries/rocBLAS/level_1/scal/CMakeLists.txt index ac923482..9cec640e 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_1/swap/CMakeLists.txt b/Libraries/rocBLAS/level_1/swap/CMakeLists.txt index 129a5520..155f9f63 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_2/gemv/CMakeLists.txt b/Libraries/rocBLAS/level_2/gemv/CMakeLists.txt index 8cf4a88b..7b64bc52 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_2/her/CMakeLists.txt b/Libraries/rocBLAS/level_2/her/CMakeLists.txt index 1a1c554a..8aa40e30 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_3/gemm/CMakeLists.txt b/Libraries/rocBLAS/level_3/gemm/CMakeLists.txt index d0f3951f..ab6f69e2 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocBLAS/level_3/gemm_strided_batched/CMakeLists.txt b/Libraries/rocBLAS/level_3/gemm_strided_batched/CMakeLists.txt index 631b7843..3b362a59 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocPRIM/CMakeLists.txt b/Libraries/rocPRIM/CMakeLists.txt index 4062496d..a4136a16 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,13 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocPRIM/block_sum/CMakeLists.txt b/Libraries/rocPRIM/block_sum/CMakeLists.txt index cfff1214..8b337fcf 100644 --- a/Libraries/rocPRIM/block_sum/CMakeLists.txt +++ b/Libraries/rocPRIM/block_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,14 +38,8 @@ find_package(rocprim REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocprim -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocprim) +target_include_directories(${example_name} PRIVATE "../../../Common") if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) endif() diff --git a/Libraries/rocPRIM/device_sum/CMakeLists.txt b/Libraries/rocPRIM/device_sum/CMakeLists.txt index 82d62fd7..5ca14240 100644 --- a/Libraries/rocPRIM/device_sum/CMakeLists.txt +++ b/Libraries/rocPRIM/device_sum/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,14 +38,8 @@ find_package(rocprim REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocprim -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocprim) +target_include_directories(${example_name} PRIVATE "../../../Common") if(WIN32) target_compile_definitions(${example_name} PRIVATE WIN32) endif() diff --git a/Libraries/rocRAND/CMakeLists.txt b/Libraries/rocRAND/CMakeLists.txt index 64da29b6..92e4e400 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,13 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(rocRAND_examples LANGUAGES CXX) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocRAND/simple_distributions_cpp/CMakeLists.txt b/Libraries/rocRAND/simple_distributions_cpp/CMakeLists.txt index f9ba7151..aeb12afc 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 @@ -25,12 +25,17 @@ set(example_name rocrand_simple_distributions_cpp) cmake_minimum_required(VERSION 3.21 FATAL_ERROR) project(${example_name} LANGUAGES CXX) -set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA") +set(GPU_RUNTIME + "HIP" + CACHE STRING "Switches between HIP and CUDA") set(GPU_RUNTIMES "HIP" "CUDA") set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES}) if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES) - message(FATAL_ERROR "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}") + message( + FATAL_ERROR + "Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}" + ) endif() if(GPU_RUNTIME STREQUAL "CUDA") diff --git a/Libraries/rocSOLVER/CMakeLists.txt b/Libraries/rocSOLVER/CMakeLists.txt index 99e971bc..9bcf35b1 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,28 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(rocblas) if(NOT rocblas_FOUND) - message(STATUS "rocBLAS could not be found, not building rocSOLVER examples") + message( + STATUS "rocBLAS could not be found, not building rocSOLVER examples") return() endif() find_package(rocsolver) if(NOT rocsolver_FOUND) - message(STATUS "rocSOLVER could not be found, not building rocSOLVER examples") + message( + STATUS "rocSOLVER could not be found, not building rocSOLVER examples") return() endif() diff --git a/Libraries/rocSOLVER/getf2/CMakeLists.txt b/Libraries/rocSOLVER/getf2/CMakeLists.txt index 78f61225..def1f092 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 @@ -29,7 +29,8 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_HIP_STANDARD 17) @@ -37,9 +38,13 @@ 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 +62,4 @@ target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS roc::rocsolver) -endif() \ No newline at end of file +endif() diff --git a/Libraries/rocSOLVER/getri/CMakeLists.txt b/Libraries/rocSOLVER/getri/CMakeLists.txt index d816927c..a1ed7b7d 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 @@ -29,16 +29,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSOLVER/syev/CMakeLists.txt b/Libraries/rocSOLVER/syev/CMakeLists.txt index 1a429806..7b7cb312 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 @@ -29,7 +29,8 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_HIP_STANDARD 17) @@ -37,9 +38,13 @@ 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 +62,4 @@ target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS roc::rocsolver) -endif() \ No newline at end of file +endif() diff --git a/Libraries/rocSOLVER/syev_batched/CMakeLists.txt b/Libraries/rocSOLVER/syev_batched/CMakeLists.txt index 8c210d58..31637c74 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 @@ -29,7 +29,8 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_HIP_STANDARD 17) @@ -37,9 +38,13 @@ set(CMAKE_HIP_EXTENSIONS OFF) set(CMAKE_HIP_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSOLVER/syev_strided_batched/CMakeLists.txt b/Libraries/rocSOLVER/syev_strided_batched/CMakeLists.txt index 58a92d3a..9c5c8600 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 @@ -29,7 +29,8 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_HIP_STANDARD 17) @@ -37,9 +38,13 @@ 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 +62,4 @@ target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) if(CMAKE_SYSTEM_NAME MATCHES Windows) install(IMPORTED_RUNTIME_ARTIFACTS roc::rocsolver) -endif() \ No newline at end of file +endif() diff --git a/Libraries/rocSPARSE/CMakeLists.txt b/Libraries/rocSPARSE/CMakeLists.txt index a399930d..368c9006 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,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(rocsparse) if(NOT rocsparse_FOUND) - message(STATUS "rocSPARSE could not be found, not building rocSPARSE examples") + message( + STATUS "rocSPARSE could not be found, not building rocSPARSE examples") return() endif() diff --git a/Libraries/rocSPARSE/level_2/bsrmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/bsrmv/CMakeLists.txt index 487174a2..cc1bc63b 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/bsrsv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/bsrsv/CMakeLists.txt index 1ed90f2a..af6b5924 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/bsrxmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/bsrxmv/CMakeLists.txt index 7346410f..3b67d8e1 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/coomv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/coomv/CMakeLists.txt index 60cb2b4f..f3ca6d8a 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/csrmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/csrmv/CMakeLists.txt index e595be2d..a5e67884 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/csrsv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/csrsv/CMakeLists.txt index 1b2416bb..47be05d9 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/ellmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/ellmv/CMakeLists.txt index 24d0b111..a7985d85 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/gebsrmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/gebsrmv/CMakeLists.txt index 51937718..f7fe7e30 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/gemvi/CMakeLists.txt b/Libraries/rocSPARSE/level_2/gemvi/CMakeLists.txt index cbf8b9a3..99e47b18 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/spmv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/spmv/CMakeLists.txt index 0d38a3bd..b1f797ab 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_2/spsv/CMakeLists.txt b/Libraries/rocSPARSE/level_2/spsv/CMakeLists.txt index 450d00f3..4fdb9127 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/bsrmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/bsrmm/CMakeLists.txt index d513229a..3d882d7f 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/bsrsm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/bsrsm/CMakeLists.txt index 2784b9ea..669aee1d 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/csrmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/csrmm/CMakeLists.txt index 0aed039b..99b64845 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/csrsm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/csrsm/CMakeLists.txt index 97a52a9a..1f9592eb 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/gebsrmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/gebsrmm/CMakeLists.txt index 9bcfebfe..508e3978 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/gemmi/CMakeLists.txt b/Libraries/rocSPARSE/level_3/gemmi/CMakeLists.txt index 4d499a59..a3cc8997 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/sddmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/sddmm/CMakeLists.txt index be47ab34..a0f5e535 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/spmm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/spmm/CMakeLists.txt index 5b8f073a..aef11a4d 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/level_3/spsm/CMakeLists.txt b/Libraries/rocSPARSE/level_3/spsm/CMakeLists.txt index a4d55408..0629523d 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/bsric0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/bsric0/CMakeLists.txt index 48d24135..eaeae79f 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/bsrilu0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/bsrilu0/CMakeLists.txt index 2940a10e..2a079037 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/csric0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/csric0/CMakeLists.txt index 825de1d4..66414e10 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/csrilu0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/csrilu0/CMakeLists.txt index 67a1b4f3..82b0998e 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocSPARSE/preconditioner/csritilu0/CMakeLists.txt b/Libraries/rocSPARSE/preconditioner/csritilu0/CMakeLists.txt index 72ec7425..cec50ca5 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 @@ -30,16 +30,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") return() endif() -# This example does not contain device code, thereby it can be compiled with any conforming C++ compiler. +# This example does not contain device code, thereby it can be compiled with any +# conforming C++ compiler. set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") diff --git a/Libraries/rocThrust/CMakeLists.txt b/Libraries/rocThrust/CMakeLists.txt index 9d2f03df..61cc6a4c 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,21 @@ if(GPU_RUNTIME STREQUAL "CUDA") endif() if(WIN32) - set(ROCM_ROOT "$ENV{HIP_PATH}" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "$ENV{HIP_PATH}" + CACHE PATH "Root directory of the ROCm installation") else() - set(ROCM_ROOT "/opt/rocm" CACHE PATH "Root directory of the ROCm installation") + set(ROCM_ROOT + "/opt/rocm" + CACHE PATH "Root directory of the ROCm installation") endif() list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}") find_package(rocthrust) if(NOT rocthrust_FOUND) - message(STATUS "rocThrust could not be found, not building rocThrust examples") + message( + STATUS "rocThrust could not be found, not building rocThrust examples") return() endif() diff --git a/Libraries/rocThrust/device_ptr/CMakeLists.txt b/Libraries/rocThrust/device_ptr/CMakeLists.txt index 6191ef62..f5b1eeaa 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,11 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") # TODO: remove when rocPRIM #ifdef WIN32 is fixed -target_compile_definitions(${example_name} PRIVATE $<$:WIN32>) +target_compile_definitions(${example_name} + PRIVATE $<$:WIN32>) install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/norm/CMakeLists.txt b/Libraries/rocThrust/norm/CMakeLists.txt index bed6691a..e5fd4962 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,11 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") # TODO: remove when rocPRIM #ifdef WIN32 is fixed -target_compile_definitions(${example_name} PRIVATE $<$:WIN32>) +target_compile_definitions(${example_name} + PRIVATE $<$:WIN32>) install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/reduce_sum/CMakeLists.txt b/Libraries/rocThrust/reduce_sum/CMakeLists.txt index c907a4db..5e873479 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,11 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") # TODO: remove when rocPRIM #ifdef WIN32 is fixed -target_compile_definitions(${example_name} PRIVATE $<$:WIN32>) +target_compile_definitions(${example_name} + PRIVATE $<$:WIN32>) install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/remove_points/CMakeLists.txt b/Libraries/rocThrust/remove_points/CMakeLists.txt index a0ea2715..b399eb58 100644 --- a/Libraries/rocThrust/remove_points/CMakeLists.txt +++ b/Libraries/rocThrust/remove_points/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,13 +38,7 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/saxpy/CMakeLists.txt b/Libraries/rocThrust/saxpy/CMakeLists.txt index bdb12bbf..6c973f9d 100644 --- a/Libraries/rocThrust/saxpy/CMakeLists.txt +++ b/Libraries/rocThrust/saxpy/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,13 +38,7 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name}) diff --git a/Libraries/rocThrust/vectors/CMakeLists.txt b/Libraries/rocThrust/vectors/CMakeLists.txt index 5c0b8227..dd9a4abd 100644 --- a/Libraries/rocThrust/vectors/CMakeLists.txt +++ b/Libraries/rocThrust/vectors/CMakeLists.txt @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,13 +38,7 @@ find_package(rocthrust REQUIRED) add_executable(${example_name} main.hip) add_test(${example_name} ${example_name}) -target_link_libraries(${example_name} - PRIVATE - roc::rocthrust -) -target_include_directories(${example_name} - PRIVATE - "../../../Common" -) +target_link_libraries(${example_name} PRIVATE roc::rocthrust) +target_include_directories(${example_name} PRIVATE "../../../Common") install(TARGETS ${example_name})