Skip to content

Commit

Permalink
Preparation for deprecation of __AMDGCN_WAVEFRONT_SIZE
Browse files Browse the repository at this point in the history
See #4270 for more details.
  • Loading branch information
WeiqunZhang committed Jan 27, 2025
1 parent 4b34f9c commit d565128
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Docs/sphinx_documentation/source/Basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ reading from command line or input file.

Because many AMReX classes and functions (including destructors
inserted by the compiler) do not function properly after
:cpp:`amrex:Finalize` is called, it's best to put the codes between
:cpp:`amrex::Finalize` is called, it's best to put the codes between
:cpp:`amrex::Initialize` and :cpp:`amrex::Finalize` into its scope
(e.g., a pair of curly braces or a separate function) to make sure
resources are properly freed.
Expand Down
10 changes: 7 additions & 3 deletions Src/Base/AMReX_GpuDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ namespace {
namespace {
__host__ __device__ void amrex_check_wavefront_size () {
#ifdef __HIP_DEVICE_COMPILE__
// https://github.com/AMReX-Codes/amrex/issues/3792
// __AMDGCN_WAVEFRONT_SIZE is valid in device code only.
// Thus we have to check it this way.
// * https://github.com/AMReX-Codes/amrex/issues/3792
// __AMDGCN_WAVEFRONT_SIZE is valid in device code only.
// Thus we have to check it this way.
// * https://github.com/AMReX-Codes/amrex/issues/4270
// __AMDGCN_WAVEFRONT_SIZE will be deprecated.
#ifdef __AMDGCN_WAVEFRONT_SIZE
static_assert(__AMDGCN_WAVEFRONT_SIZE == AMREX_AMDGCN_WAVEFRONT_SIZE,
"Please let the amrex team know if you encounter this");
#endif
#endif
}
}
Expand Down

0 comments on commit d565128

Please sign in to comment.