Skip to content

Commit

Permalink
6.2 mergeback into develop (#524)
Browse files Browse the repository at this point in the history
* Update device-specific config headers with benchmark tuning results (#483)

I ran the benchmark tuning code and scripts on the remaining
architectures in our GPU support matrix. This change updates
the config headers with the results.

* Updates and test coverage for hipGraph support in rocRAND (#439) (#482)

This change allows device-side generators to be used inside of hipGraphs.
More specifically, you can wrap calls to rocrand_generate_* inside of a hipGraph. There are a few things to be aware of:
  - Generator creation (rocrand_create_generator), initialization (rocrand_initialize_generator), and destruction (rocrand_destroy_generator) must still happen outside the hipGraph.
  - After the generator is created, you may call API functions to set its seed, offset, and order.
  - After the generator is initialized (but before stream capture or manual graph creation begins), use rocrand_set_stream to set the stream the generator will use within the graph.
  - A generator's seed, offset, and stream may not be changed from within the hipGraph. Attempting to do so may result in unpredicable behaviour.
  - API calls for the poisson distribution (eg. rocrand_generate_poisson) are not yet supported inside of hipGraphs.

I've added a note to the changelog that mentions these details.
In addition to the changes necessary to support the behaviour described above, this change also:
- updates the changelog to alert the user to the restrictions mentioned above
- adds new unit test coverage to exercises generators and distributions within hipGraphs.

* workaround for regression in sobol kernel (#485) (#487)

introduced by generic codepath for host and device generator

Co-authored-by: Nol Moonen <[email protected]>

* Rename test_config_dispatch.cpp to test_rocrand_config_dispatch.cpp (#496)

* fix(lfsr113,mgr,,mtgp32,philox4x32,threefry,xorwow): force inline generate function (#495) (#497)

A compiler change caused the generate function to no longer be inlined which caused a performance regression. Force inlining resolves this.

Co-authored-by: Nara <[email protected]>

* cmake: don't set CMAKE_C_COMPILER, as rocRAND is a CXX project (#502)

* cherry picking documentation from develop into 6.2 (#507)

* organizing docs into subfolders

* update license and index

* Update LICENSE.txt

Co-authored-by: Nara <[email protected]>

* removing what-is-rocRAND

* Update Read the Docs configuration to use Python 3.10 and latest rocm-docs-core (#503)

* Bump urllib3 from 2.2.1 to 2.2.2 in /docs/sphinx (#505)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nara <[email protected]>
Co-authored-by: Sam Wu <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add an option for using TBB for host-side generators

* Add package dependencies on TBB if used

* Correct dependencies for RHEL / SLES

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Wayne Franz <[email protected]>
Co-authored-by: Nol Moonen <[email protected]>
Co-authored-by: Nara <[email protected]>
Co-authored-by: Steve Leung <[email protected]>
Co-authored-by: srawat <[email protected]>
Co-authored-by: Nara <[email protected]>
Co-authored-by: Sam Wu <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauren Wrubleski <[email protected]>
  • Loading branch information
10 people authored Jul 16, 2024
1 parent 2d549a1 commit f3a8622
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 22 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,6 @@ test:nvcc-parity:
-D BUILD_SHARED_LIBS="$BUILD_SHARED_LIBS"
-D BUILD_TEST=ON
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_C_COMPILER:FILEPATH="$ROCM_PATH/bin/clang.exe"
-D CMAKE_CXX_COMPILER:FILEPATH="$ROCM_PATH/bin/clang++.exe"
-D CMAKE_INSTALL_PREFIX:PATH="$CI_PROJECT_DIR/build/install"
-D CMAKE_PREFIX_PATH:PATH="$ROCM_PATH/lib/cmake"
Expand Down
5 changes: 1 addition & 4 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,12 @@ if(BUILD_TEST)
if(DEFINED CMAKE_CXX_COMPILER)
set(CXX_COMPILER_OPTION "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
endif()
if(DEFINED CMAKE_C_COMPILER)
set(C_COMPILER_OPTION "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}")
endif()
download_project(
PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
INSTALL_DIR ${GTEST_ROOT}
CMAKE_ARGS -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CXX_COMPILER_OPTION} ${C_COMPILER_OPTION} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
CMAKE_ARGS -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CXX_COMPILER_OPTION} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
LOG_DOWNLOAD TRUE
LOG_CONFIGURE TRUE
LOG_BUILD TRUE
Expand Down
15 changes: 10 additions & 5 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if (ROCRAND_HAVE_ASM_INCBIN)
enable_language(ASM)
list(TRANSFORM SOBOL_PRECOMPUTED_SOURCES APPEND ".S")
set_source_files_properties(${SOBOL_PRECOMPUTED_SOURCES} PROPERTIES
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/src)
else()
list(TRANSFORM SOBOL_PRECOMPUTED_SOURCES APPEND ".cpp")
endif()
Expand Down Expand Up @@ -123,12 +123,17 @@ else()
target_link_libraries(rocrand PUBLIC hip::host)
endif()

if(NOT WIN32)
option(ROCRAND_USE_TBB "Use TBB for host-side generators if available." ON)
if(NOT WIN32 AND ROCRAND_USE_TBB)
find_package(TBB QUIET)
if(NOT TARGET TBB::tbb)
message(WARNING "TBB is not found. Building without parallel STL support")
else()
target_link_libraries(rocrand PRIVATE TBB::tbb)
rocm_package_add_deb_dependencies("libtbb-dev")
set(CPACK_DEB_PACKAGE_REQUIRES "${CPACK_DEB_PACKAGE_REQUIRES}" PARENT_SCOPE)
rocm_package_add_rpm_dependencies("(tbb-devel or tbb)")
set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}" PARENT_SCOPE)

# Older libstdc++ headers require TBB to be installed to be able to #include <execution>
target_compile_definitions(rocrand PRIVATE ROCRAND_PARALLEL_STL)
Expand Down Expand Up @@ -187,7 +192,7 @@ if (WIN32)
install (TARGETS rocrand DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
if (BUILD_TEST)
add_custom_command(
TARGET rocrand
TARGET rocrand
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:rocrand>
Expand All @@ -196,13 +201,13 @@ if (WIN32)
endif()
if (BUILD_BENCHMARK)
add_custom_command(
TARGET rocrand
TARGET rocrand
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:rocrand>
${PROJECT_BINARY_DIR}/benchmark/$<TARGET_FILE_NAME:rocrand>
)
endif()
endif()
endif()

# Fortran wrappers for rocRAND
Expand Down
5 changes: 1 addition & 4 deletions test/cpp_wrapper/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@ if(NOT TARGET GTest::GTest AND NOT TARGET GTest::gtest)
if(DEFINED CMAKE_CXX_COMPILER)
set(CXX_COMPILER_OPTION "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
endif()
if(DEFINED CMAKE_C_COMPILER)
set(C_COMPILER_OPTION "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}")
endif()
download_project(
PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
INSTALL_DIR ${GTEST_ROOT}
CMAKE_ARGS -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CXX_COMPILER_OPTION} ${C_COMPILER_OPTION} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
CMAKE_ARGS -DBUILD_GTEST=ON -DINSTALL_GTEST=ON -Dgtest_force_shared_crt=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CXX_COMPILER_OPTION} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
LOG_DOWNLOAD TRUE
LOG_CONFIGURE TRUE
LOG_BUILD TRUE
Expand Down
7 changes: 0 additions & 7 deletions toolchain-linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,3 @@ if (NOT DEFINED ENV{CXX})
else()
set(CMAKE_CXX_COMPILER "$ENV{CXX}" CACHE PATH "Path to the C++ compiler")
endif()

if (NOT DEFINED ENV{CC})
set(CMAKE_C_COMPILER "${rocm_bin}/amdclang" CACHE PATH "Path to the C compiler")
set(CMAKE_CXX_FLAGS "-mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false")
else()
set(CMAKE_C_COMPILER "$ENV{CC}" CACHE PATH "Path to the C compiler")
endif()
1 change: 0 additions & 1 deletion toolchain-windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ else()
endif()

set(CMAKE_CXX_COMPILER "${rocm_bin}/clang++.exe")
set(CMAKE_C_COMPILER "${rocm_bin}/clang.exe")

if (NOT python)
set(python "python3") # take default for windows
Expand Down

0 comments on commit f3a8622

Please sign in to comment.