From f8dc238ca6956490a64e415b50ecf4d8abcac50a Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Tue, 28 May 2019 14:19:32 -0700 Subject: [PATCH 1/3] Adding packaging to the install script --- install | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/install b/install index 819029eb2..ac3db0e7d 100755 --- a/install +++ b/install @@ -10,6 +10,7 @@ function display_help() echo "./install [-h|--help] " echo " [-h|--help] prints this help message" echo " [-i|--install] install after build" + echo " [-p]--package build package" #Not implemented yet # echo " [-d|--dependencies] install build dependencies" echo " [-c|--clients] build library clients too (combines with -i & -d)" @@ -21,6 +22,7 @@ function display_help() # global variables # ################################################# install_package=false +build_package=false build_clients=false build_release=true run_tests=false @@ -32,7 +34,7 @@ rocm_path=/opt/rocm/bin # check if we have a modern version of getopt that can handle whitespace and long parameters getopt -T if [[ $? -eq 4 ]]; then - GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,debug,test --options hicdt -- "$@") + GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,debug,test,package --options hicdtp -- "$@") else echo "Need a new version of getopt" exit 1 @@ -55,7 +57,10 @@ while true; do -i|--install) install_package=true shift ;; - -c|--clients) + -p|--package) + build_package=true + shift ;; + -c|--clients) build_clients=true shift ;; -g|--debug) @@ -99,7 +104,7 @@ fi CXX=$rocm_path/hcc cmake -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../. # Build -make -j32 +make -j$(nproc) if ($run_tests); then # Optionally, run tests if they're enabled. @@ -110,3 +115,8 @@ if ($install_package); then # Install make install fi + +if ($build_package); then +# Install +make package -j$(nproc) +fi From 63f4eff050cec99d7b7b2cc8ff6a9e77be03bcf6 Mon Sep 17 00:00:00 2001 From: Anton Gorenko Date: Fri, 31 May 2019 16:00:22 +0600 Subject: [PATCH 2/3] Fix TARGETS param of rocm_export_targets /opt/rocm/hipcub/lib/cmake/rocprim/rocprim-config.cmake contained: set(rocprim_LIBRARIES rocprim-targets) ... --- CMakeLists.txt | 12 ++++++------ rocprim/CMakeLists.txt | 5 +---- test/extra/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6acc581c4..107c1da85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,15 +73,15 @@ include(cmake/Dependencies.cmake) set(AMDGPU_TARGETS gfx803;gfx900;gfx906 CACHE STRING "List of specific machine types for library to target") # Setup VERSION -set ( VERSION_STRING "2.5.0." ) +set(VERSION_STRING "2.5.0.") -# Check if BUILD_NUMBER is defined in a Jenkins envirnment -if ($ENV{BUILD_NUMBER} ) +# Check if BUILD_NUMBER is defined in a Jenkins environment +if($ENV{BUILD_NUMBER}) string(CONCAT BUILD_VERSION ${VERSION_STRING} $ENV{BUILD_NUMBER}) -else () +else() string(CONCAT BUILD_VERSION ${VERSION_STRING} "0") -endif () -rocm_setup_version( VERSION ${BUILD_VERSION} NO_GIT_TAG_VERSION ) +endif() +rocm_setup_version(VERSION ${BUILD_VERSION} NO_GIT_TAG_VERSION) # Print configuration summary include(cmake/Summary.cmake) diff --git a/rocprim/CMakeLists.txt b/rocprim/CMakeLists.txt index 0af39353e..6d7b76b6e 100644 --- a/rocprim/CMakeLists.txt +++ b/rocprim/CMakeLists.txt @@ -53,9 +53,6 @@ set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) # does not support header-only libraries (INTERFACE targets) rocm_install_targets( TARGETS rocprim rocprim_hip -# INCLUDE -# ${CMAKE_SOURCE_DIR}/rocprim/include -# ${CMAKE_BINARY_DIR}/rocprim/include PREFIX rocprim ) @@ -72,7 +69,7 @@ install( # Export targets rocm_export_targets( - TARGETS rocprim-targets + TARGETS roc::rocprim roc::rocprim_hip PREFIX rocprim NAMESPACE roc:: ) diff --git a/test/extra/CMakeLists.txt b/test/extra/CMakeLists.txt index 172fb8b68..e469256db 100644 --- a/test/extra/CMakeLists.txt +++ b/test/extra/CMakeLists.txt @@ -57,7 +57,7 @@ function(add_rocprim_test TEST_NAME TEST_SOURCES) add_executable(${TEST_TARGET} ${TEST_SOURCES}) target_link_libraries(${TEST_TARGET} PRIVATE - roc::rocprim_hip + ${rocprim_LIBRARIES} # roc::rocprim_hip ) foreach(amdgpu_target ${AMDGPU_TARGETS}) target_link_libraries(${TEST_TARGET} From 16bb2e24d7b15378e4918efb783f9808432b5da6 Mon Sep 17 00:00:00 2001 From: Istvan Kiss Date: Fri, 7 Jun 2019 10:23:53 +0200 Subject: [PATCH 3/3] Local memory limit fix at scan, reduce and select --- .../include/rocprim/device/device_reduce_by_key_config.hpp | 4 ++-- rocprim/include/rocprim/device/device_reduce_config.hpp | 4 ++-- rocprim/include/rocprim/device/device_scan_config.hpp | 4 ++-- rocprim/include/rocprim/device/device_select_config.hpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rocprim/include/rocprim/device/device_reduce_by_key_config.hpp b/rocprim/include/rocprim/device/device_reduce_by_key_config.hpp index 8de5e62ba..d97e84f1e 100644 --- a/rocprim/include/rocprim/device/device_reduce_by_key_config.hpp +++ b/rocprim/include/rocprim/device/device_reduce_by_key_config.hpp @@ -65,7 +65,7 @@ struct reduce_by_key_config_803 (sizeof(Key) <= 8 && sizeof(Value) <= 8), reduce_by_key_config > >, - reduce_by_key_config > + reduce_by_key_config::value, ::rocprim::max(1u, 15u / item_scale)> > >; }; @@ -82,7 +82,7 @@ struct reduce_by_key_config_900 (sizeof(Key) <= 8 && sizeof(Value) <= 8), reduce_by_key_config > >, - reduce_by_key_config > + reduce_by_key_config::value, ::rocprim::max(1u, 15u / item_scale)> > >; }; diff --git a/rocprim/include/rocprim/device/device_reduce_config.hpp b/rocprim/include/rocprim/device/device_reduce_config.hpp index 4e39de71b..f2ee90cb4 100644 --- a/rocprim/include/rocprim/device/device_reduce_config.hpp +++ b/rocprim/include/rocprim/device/device_reduce_config.hpp @@ -65,7 +65,7 @@ struct reduce_config_803 ::rocprim::detail::ceiling_div(sizeof(Value), sizeof(int)); using type = reduce_config< - 256, + limit_block_size<256U, sizeof(Value)>::value, ::rocprim::max(1u, 16u / item_scale), ::rocprim::block_reduce_algorithm::using_warp_reduce >; @@ -78,7 +78,7 @@ struct reduce_config_900 ::rocprim::detail::ceiling_div(sizeof(Value), sizeof(int)); using type = reduce_config< - 256, + limit_block_size<256U, sizeof(Value)>::value, ::rocprim::max(1u, 16u / item_scale), ::rocprim::block_reduce_algorithm::using_warp_reduce >; diff --git a/rocprim/include/rocprim/device/device_scan_config.hpp b/rocprim/include/rocprim/device/device_scan_config.hpp index 126064732..79b23dbc4 100644 --- a/rocprim/include/rocprim/device/device_scan_config.hpp +++ b/rocprim/include/rocprim/device/device_scan_config.hpp @@ -79,7 +79,7 @@ struct scan_config_803 ::rocprim::detail::ceiling_div(sizeof(Value), sizeof(int)); using type = scan_config< - 256, + limit_block_size<256U, sizeof(Value)>::value, ::rocprim::max(1u, 16u / item_scale), ROCPRIM_DETAIL_USE_LOOKBACK_SCAN, ::rocprim::block_load_method::block_load_transpose, @@ -95,7 +95,7 @@ struct scan_config_900 ::rocprim::detail::ceiling_div(sizeof(Value), sizeof(int)); using type = scan_config< - 256, + limit_block_size<256U, sizeof(Value)>::value, ::rocprim::max(1u, 16u / item_scale), ROCPRIM_DETAIL_USE_LOOKBACK_SCAN, ::rocprim::block_load_method::block_load_transpose, diff --git a/rocprim/include/rocprim/device/device_select_config.hpp b/rocprim/include/rocprim/device/device_select_config.hpp index 901ede79c..dfc469c97 100644 --- a/rocprim/include/rocprim/device/device_select_config.hpp +++ b/rocprim/include/rocprim/device/device_select_config.hpp @@ -74,7 +74,7 @@ struct select_config_803 ::rocprim::detail::ceiling_div(sizeof(Value), sizeof(int)); using type = select_config< - 256, + limit_block_size<256U, sizeof(Value)>::value, ::rocprim::max(1u, 13u / item_scale), ::rocprim::block_load_method::block_load_transpose, ::rocprim::block_load_method::block_load_transpose, @@ -89,7 +89,7 @@ struct select_config_900 ::rocprim::detail::ceiling_div(sizeof(Value), sizeof(int)); using type = select_config< - 256, + limit_block_size<256U, sizeof(Value)>::value, ::rocprim::max(1u, 15u / item_scale), ::rocprim::block_load_method::block_load_transpose, ::rocprim::block_load_method::block_load_transpose,