From d5651281ebb9f9a6cc3c87c29ab25268335cc14b Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Mon, 27 Jan 2025 09:21:39 -0800 Subject: [PATCH] Preparation for deprecation of `__AMDGCN_WAVEFRONT_SIZE` See #4270 for more details. --- Docs/sphinx_documentation/source/Basics.rst | 2 +- Src/Base/AMReX_GpuDevice.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Docs/sphinx_documentation/source/Basics.rst b/Docs/sphinx_documentation/source/Basics.rst index 2eea502d2cc..16776d65cd3 100644 --- a/Docs/sphinx_documentation/source/Basics.rst +++ b/Docs/sphinx_documentation/source/Basics.rst @@ -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. diff --git a/Src/Base/AMReX_GpuDevice.cpp b/Src/Base/AMReX_GpuDevice.cpp index d911349a61f..3372483c528 100644 --- a/Src/Base/AMReX_GpuDevice.cpp +++ b/Src/Base/AMReX_GpuDevice.cpp @@ -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 } }