Skip to content

Commit

Permalink
Add CMake support for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
matyas-streamhpc committed Jan 26, 2024
1 parent ac68df1 commit 3a203e0
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ tags
.*.swp

# Visual Studio Code
.venv
.vscode

# documentation artifacts
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Documentation for hipFFT is available at

* `hipfftXtSetGPUs`, `hipfftXtMalloc, hipfftXtMemcpy`, `hipfftXtFree`, and `hipfftXtExecDescriptor` APIs
have been implemented to allow FFT computing on multiple devices in a single process
* CMake support for documentation.

## hipFFT 1.0.12 for ROCm 5.6.0

Expand Down
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# #############################################################################
# Copyright (C) 2020 - 2022 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2020 - 2023 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
Expand Down Expand Up @@ -67,6 +67,10 @@ option(BUILD_ADDRESS_SANITIZER "Build with address sanitizer enabled" OFF)

option( WERROR "Treat warnings as errors" OFF )

option(BUILD_DOCS "Build documentation" OFF)

include(GNUInstallDirs)

# Set internal BUILD_WITH_COMPILER.
if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
set( BUILD_WITH_COMPILER "HOST-default" )
Expand Down Expand Up @@ -215,6 +219,11 @@ if( BUILD_CLIENTS_BENCH OR BUILD_CLIENTS_SAMPLES OR BUILD_CLIENTS_TESTS )
add_subdirectory( clients )
endif()

# Build docs
if(BUILD_DOCS)
add_subdirectory(docs)
endif()

# Packaging...
if(WIN32)
set(CPACK_SOURCE_GENERATOR "ZIP")
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ pip3 install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
```

Alternatively, build with CMake:

```bash
cmake -DBUILD_DOCS=ON ...
```

## Build and install

You can download pre-built packages from the
Expand Down
3 changes: 3 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ if( ROCM_FOUND )
else()
message(WARNING "Could not find rocm-cmake, packaging will fail.")
endif( )

# Documenation dependencies
include(FetchContent)
40 changes: 40 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# MIT License
#
# Copyright (c) 2023 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

include(ROCMSphinxDoc)

file(COPY
"${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")

rocm_add_sphinx_doc(
"${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_DIR html
BUILDER html
USES_DOXYGEN
VARS
"doxyfile=${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
)

install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html"
DESTINATION "${CMAKE_INSTALL_DOCDIR}")
2 changes: 1 addition & 1 deletion docs/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE = ../README.md
USE_MDFILE_AS_MAINPAGE =

#---------------------------------------------------------------------------
# Configuration options related to source browsing
Expand Down

0 comments on commit 3a203e0

Please sign in to comment.