From 4aae47136ef80aefb494b8affb6688ee876f8c12 Mon Sep 17 00:00:00 2001 From: Wayne Franz Date: Thu, 19 Sep 2024 08:46:55 -0400 Subject: [PATCH] Mergeback 6.3 changes (#463) * Remove Thrust comments referencing website (#451) Referencing or using code from some websites is prohibited in rocThrust. Some comments with these kinds of references were recently added by Thrust, and then when we updated the API, were brought into rocThrust. This change removes the references in the comments. * Specify minimum version for Google benchmark (#450) * Remove Thrust comments referencing website (#447) Referencing or using code from some websites is prohibited in rocThrust. Some comments with these kinds of references were recently added by Thrust, and then when we updated the API, were brought into rocThrust. This change removes the references in the comments. * Bump rocm-docs-core from 1.6.2 to 1.7.1 in /docs/sphinx (#448) Bumps [rocm-docs-core](https://github.com/ROCm/rocm-docs-core) from 1.6.2 to 1.7.1. - [Release notes](https://github.com/ROCm/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ROCm/rocm-docs-core/compare/v1.6.2...v1.7.1) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Specify minimum version for Google benchmark Pass a minimum version to find_package to prevent it from using outdated versions of Google benchmark that may be present on the system. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Temporarily disable scan tests, re-enable tests on gfx11xx (#449) * Remove Thrust comments referencing website (#447) Referencing or using code from some websites is prohibited in rocThrust. Some comments with these kinds of references were recently added by Thrust, and then when we updated the API, were brought into rocThrust. This change removes the references in the comments. * Temporarily disable scan tests, re-enable tests on gfx11xx Remove code that excludes gfx11xx tests on Jenkins, since they work there now. Add a temporary exclusion for test_thrust_scan, which needs a compiler fix. * Remove website URL from comments (#456) Referencing or using code from some websites is prohibited in this repository. This change removes an informational reference in the comments. * Add checks around some platform-specific benchmark code (#455) There were two spots in the new benchmark code that were causing compile-time issues on some Windows systems. This change adds a check to make sure we have 128-bit integer support before using int128_t in generation_utils.hpp. It also avoids calling clock_gettime on Windows, since it seems to be causing build issues there. Instead, I've restored the old Windows timing code from PR #431, which uses QueryPerformanceFrequency/Counter instead. * Add gfx1151 build target (#457) (#459) * Add gfx1151 target * Revert "Add gfx1151 target" This reverts commit 5889238d5e754f79fbb9d353b0bf4def528cfc78. * Add gfx1151 target while preserving address sanitizer targets --------- Co-authored-by: Stanley Tsang * Remove website reference (#460) Removed the link to more information from the CRC algorithm comments. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: amd-garydeng Co-authored-by: Stanley Tsang --- .jenkins/common.groovy | 8 +--- benchmarks/bench_utils/generation_utils.hpp | 5 +++ cmake/Dependencies.cmake | 5 ++- internal/benchmark/timer.h | 45 +++++++++++++++++++++ scripts/copyright-date/check-copyright.sh | 1 - test/bitwise_repro/bwr_utils.hpp | 11 +++-- 6 files changed, 60 insertions(+), 15 deletions(-) diff --git a/.jenkins/common.groovy b/.jenkins/common.groovy index ae5dc592..8156008e 100644 --- a/.jenkins/common.groovy +++ b/.jenkins/common.groovy @@ -32,12 +32,8 @@ def runTestCommand (platform, project) def testCommand = "ctest --output-on-failure" def hmmTestCommand = '' - def excludeRegex = 'reduce_by_key.hip' - - if (platform.jenkinsLabel.contains('gfx11')) - { - excludeRegex = /(reduce_by_key.hip|partition.hip|sort.hip|sort_by_key.hip|stable_sort_by_key.hip|stable_sort.hip|async_copy.hip|async_reduce.hip|async_scan.hip|async_sort.hip|async_transform.hip)/ - } + // Note: temporarily disable scan tests below while waiting for a compiler fix + def excludeRegex = /(reduce_by_key.hip|scan)/ testCommandExclude = "--exclude-regex \"${excludeRegex}\"" if (platform.jenkinsLabel.contains('gfx90a')) diff --git a/benchmarks/bench_utils/generation_utils.hpp b/benchmarks/bench_utils/generation_utils.hpp index 9a93617f..ec56d34e 100644 --- a/benchmarks/bench_utils/generation_utils.hpp +++ b/benchmarks/bench_utils/generation_utils.hpp @@ -187,10 +187,15 @@ namespace detail template struct random_to_item_t::value>::type> { +#if THRUST_BENCHMARKS_HAVE_INT128_SUPPORT using CastT = typename std::conditional< std::is_same::value || std::is_same::value, typename std::conditional::value, long, unsigned long>::type, T>::type; +#else + using CastT = typename std::conditional::value, long, unsigned long>::type; +#endif + double m_min; double m_max; diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 3a1493fb..54225eed 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -112,9 +112,10 @@ endif() # Benchmark dependencies if(BUILD_BENCHMARKS) + set(BENCHMARK_VERSION 1.8.0) if(NOT DEPENDENCIES_FORCE_DOWNLOAD) # Google Benchmark (https://github.com/google/benchmark.git) - find_package(benchmark QUIET) + find_package(benchmark ${BENCHMARK_VERSION} QUIET) else() message(STATUS "Force installing Google Benchmark.") endif() @@ -137,7 +138,7 @@ if(BUILD_BENCHMARKS) download_project( PROJ googlebenchmark GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG v1.8.0 + GIT_TAG v${BENCHMARK_VERSION} INSTALL_DIR ${GOOGLEBENCHMARK_ROOT} CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX= -DCMAKE_CXX_STANDARD=14 ${COMPILER_OVERRIDE} LOG_DOWNLOAD TRUE diff --git a/internal/benchmark/timer.h b/internal/benchmark/timer.h index 0225c78f..cd0128e6 100644 --- a/internal/benchmark/timer.h +++ b/internal/benchmark/timer.h @@ -3,6 +3,50 @@ #include #include + +#if(THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC || defined(_WIN32)) +#include + +class steady_timer +{ + LARGE_INTEGER start_; + LARGE_INTEGER stop_; + LARGE_INTEGER frequency_; // Cached to avoid system calls. + + public: + steady_timer() : start_(), stop_(), frequency_() + { + BOOL const r = QueryPerformanceFrequency(&frequency_); + assert(0 != r); + (void)r; // Silence unused variable 'r' in Release builds, when + // the assertion evaporates. + } + + void start() + { + BOOL const r = QueryPerformanceCounter(&start_); + assert(0 != r); + (void)r; // Silence unused variable 'r' in Release builds, when + // the assertion evaporates. + } + + + void stop() + { + BOOL const r = QueryPerformanceCounter(&stop_); + assert(0 != r); + (void)r; // Silence unused variable 'r' in Release builds, when + // the assertion evaporates. + } + + double seconds_elapsed() + { + return double(stop_.QuadPart - start_.QuadPart) + / double(frequency_.QuadPart); + } +}; + +#else #include class steady_timer @@ -35,3 +79,4 @@ class steady_timer + double(stop_.tv_nsec - start_.tv_nsec) * 1.0e-9; } }; +#endif diff --git a/scripts/copyright-date/check-copyright.sh b/scripts/copyright-date/check-copyright.sh index a5168849..61d61068 100755 --- a/scripts/copyright-date/check-copyright.sh +++ b/scripts/copyright-date/check-copyright.sh @@ -61,7 +61,6 @@ if $forkdiff; then source_commit="remotes/$remote/HEAD" # don't use fork-point for finding fork point (lol) - # see: https://stackoverflow.com/a/53981615 diff_hash="$(git merge-base "$source_commit" "$branch")" fi diff --git a/test/bitwise_repro/bwr_utils.hpp b/test/bitwise_repro/bwr_utils.hpp index 8056ac30..fbfe288a 100644 --- a/test/bitwise_repro/bwr_utils.hpp +++ b/test/bitwise_repro/bwr_utils.hpp @@ -67,11 +67,9 @@ namespace crc } /*! \brief Performs a 32-bit cyclic redundancy check on the data it's passed. - * \note For more information on this algorithm and the optimizations used here, - * see: https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks. - * \param data Pointer to the data to compute the check for, as a byte-array. - * \param len Number of bytes in the data buffer. - */ + * \param data Pointer to the data to compute the check for, as a byte-array. + * \param len Number of bytes in the data buffer. + */ uint32_t crc(const uint8_t* data, size_t len) { // Precompute values we know we'll use frequently and store them in a @@ -503,4 +501,5 @@ class TokenHelper } // end namespace bwr_utils -#endif // BRW_UTILS_HPP \ No newline at end of file +#endif // BRW_UTILS_HPP +