Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake option: AMReX_CUDA_OBJDIR_AS_TEMPDIR #4246

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Docs/sphinx_documentation/source/GPU.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ check the :ref:`table <tab:cmakecudavar>` below.
+------------------------------+-------------------------------------------------+-------------+-----------------+
| AMReX_CUDA_KEEP_FILES | Keep intermediately files (folder: nvcc_tmp) | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| AMReX_CUDA_OBJDIR_AS_TEMPDIR | Place intermediate files in object file folder | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| AMReX_CUDA_LTO | Enable CUDA link-time-optimization | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| AMReX_CUDA_MAXREGCOUNT | Limits the number of CUDA registers available | 255 | User-defined |
Expand Down
3 changes: 3 additions & 0 deletions Tools/CMake/AMReXCUDAOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ cuda_print_option(AMReX_CUDA_BACKTRACE)

option(AMReX_CUDA_KEEP_FILES "Keep intermediately generated files (folder: nvcc_tmp)" OFF)
cuda_print_option(AMReX_CUDA_KEEP_FILES)

option(AMReX_CUDA_OBJDIR_AS_TEMPDIR "Place intermediate files in object file folder" OFF)
cuda_print_option(AMReX_CUDA_OBJDIR_AS_TEMPDIR)
5 changes: 5 additions & 0 deletions Tools/CMake/AMReXParallelBackends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ if ( AMReX_GPU_BACKEND STREQUAL "CUDA"
list(APPEND _cuda_flags --keep "SHELL:--keep-dir ${PROJECT_BINARY_DIR}/nvcc_tmp")
endif ()

# place intermediate files in object file folder
if (AMReX_CUDA_OBJDIR_AS_TEMPDIR)
list(APPEND _cuda_flags --objdir-as-tempdir)
endif ()

# compilation timings
if (AMReX_CUDA_COMPILATION_TIMER)
file(REMOVE "${PROJECT_BINARY_DIR}/nvcc_timings.csv")
Expand Down
5 changes: 5 additions & 0 deletions Tools/CMake/AMReX_SetupCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ if (AMReX_CUDA_KEEP_FILES)
string(APPEND CMAKE_CUDA_FLAGS " --keep --keep-dir ${PROJECT_BINARY_DIR}/nvcc_tmp")
endif ()

# place intermediate files in object file folder
if (AMReX_CUDA_OBJDIR_AS_TEMPDIR)
string(APPEND CMAKE_CUDA_FLAGS " --objdir-as-tempdir")
endif ()

# compilation timings
if (AMReX_CUDA_COMPILATION_TIMER)
file(REMOVE "${PROJECT_BINARY_DIR}/nvcc_timings.csv")
Expand Down
Loading