aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2022-03-08 18:38:25 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-08 09:38:25 -0800
commit0a64c2b8a42d766e5a893fcab2d4573b33cca74f (patch)
tree16f5979ff152251fc443f2e5ee67f929d6534228 /Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp
parent7425721ccced342615c054ea8147fbdc484d6620 (diff)
downloadWarpX-0a64c2b8a42d766e5a893fcab2d4573b33cca74f.tar.gz
WarpX-0a64c2b8a42d766e5a893fcab2d4573b33cca74f.tar.zst
WarpX-0a64c2b8a42d766e5a893fcab2d4573b33cca74f.zip
Make error and info messages visually uniform (#2939)
* initial work to add msg formatter * wip * replace AMREX_ALWAYS_ASSERT_WITH_MESSAGE with WarpX equivalent
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp b/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp
index f612143be..676d4a5bb 100644
--- a/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp
+++ b/Source/FieldSolver/SpectralSolver/WrapCuFFT.cpp
@@ -7,6 +7,8 @@
#include "AnyFFT.H"
+#include "Utils/TextMsg.H"
+
namespace AnyFFT
{
@@ -35,7 +37,7 @@ namespace AnyFFT
result = cufftPlan2d(
&(fft_plan.m_plan), real_size[1], real_size[0], VendorR2C);
} else {
- amrex::Abort("only dim=2 and dim=3 have been implemented");
+ amrex::Abort(Utils::TextMsg::Err("only dim=2 and dim=3 have been implemented"));
}
} else {
if (dim == 3) {
@@ -45,13 +47,14 @@ namespace AnyFFT
result = cufftPlan2d(
&(fft_plan.m_plan), real_size[1], real_size[0], VendorC2R);
} else {
- amrex::Abort("only dim=2 and dim=3 have been implemented");
+ amrex::Abort(Utils::TextMsg::Err("only dim=2 and dim=3 have been implemented"));
}
}
if ( result != CUFFT_SUCCESS ) {
- amrex::Print() << " cufftplan failed! Error: " <<
- cufftErrorToString(result) << "\n";
+ amrex::Print() << Utils::TextMsg::Err(
+ "cufftplan failed! Error: "
+ + cufftErrorToString(result));
}
// Store meta-data in fft_plan
@@ -89,8 +92,9 @@ namespace AnyFFT
amrex::Abort("direction must be AnyFFT::direction::R2C or AnyFFT::direction::C2R");
}
if ( result != CUFFT_SUCCESS ) {
- amrex::Print() << " forward transform using cufftExec failed ! Error: " <<
- cufftErrorToString(result) << "\n";
+ amrex::Print() << Utils::TextMsg::Err(
+ "forward transform using cufftExec failed ! Error: "
+ +cufftErrorToString(result));
}
}